diff --git a/barrierfree/BUILD.gn b/barrierfree/BUILD.gn index 446df6c4edf5d780f1ef0fbbe3337a986a456e52..899aa4ac4c383461f589142f7aeed0a39cd92054 100644 --- a/barrierfree/BUILD.gn +++ b/barrierfree/BUILD.gn @@ -17,23 +17,13 @@ group("barrierfree") { testonly = true if (is_standard_system) { deps = [ - "accessibilityconfig:ActsAccessibilityConfigTest", - "accessibilityconfigreqreadpermission:ActsAccessibilityConfigReqReadPermissionTest", - "accessibilityelement:ActsAccessibilityElementTest", "accessibilityerrcode:ActsAccessibilityErrCodeTest", - "accessibilityevent:ActsAccessibilityEventTest", - "accessibilityextension:ActsAccessibilityExtensionTest", - "accessibilityextensioncontext:ActsAccessibilityExtensionContextTest", - "accessibilityextensioncontextcaperrcode:ActsAccessibilityExtensionContextCapErrCodeTest", - "accessibilitygestureevent:ActsAccessibilityGestureEventTest", "accessibilitysendaccessibilityevent:ActsAccessibilitySendAccessibilityEventTest", "accessibleabilitylist:ActsAccessibleAbilityListTest", "accessiblecaptionconfiguration:ActsAccessibleCaptionConfigurationTest", "accessiblecheckability:ActsAccessibleCheckAbilityTest", "accessibleregisterstate:ActsAccessibleRegisterStateTest", "accessiblesendevent:ActsAccessibleSendEventTest", - "accessibletest:actsaccessibletest", - "targetProject/aceTest:aceTest", ] } } diff --git a/barrierfree/accessibilityconfig/AppScope/app.json b/barrierfree/accessibilityconfig/AppScope/app.json deleted file mode 100644 index c56032d28250fe436c77d52a624702c89d1a5d07..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfig/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.accessibilityconfig", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon": "$media:icon", - "label": "$string:app_name", - "description": "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfig/AppScope/resources/base/element/string.json b/barrierfree/accessibilityconfig/AppScope/resources/base/element/string.json deleted file mode 100644 index 2c46549041c0fbe208c580a5587b0dc9b5500dbd..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfig/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - }, - { - "name": "mainability_description", - "value": "ETS_Phone_Empty Stage Ability" - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfig/AppScope/resources/base/media/app_icon.png b/barrierfree/accessibilityconfig/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityconfig/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/barrierfree/accessibilityconfig/BUILD.gn b/barrierfree/accessibilityconfig/BUILD.gn deleted file mode 100644 index ed7074adc45ee830226a25a2f6b9caa76baff0ab..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfig/BUILD.gn +++ /dev/null @@ -1,42 +0,0 @@ -# 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("ActsAccessibilityConfigTest") { - hap_profile = "entry/src/main/module.json" - deps = [ - ":accessibilityconfig_js_assets", - ":accessibilityconfig_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAccessibilityConfigTest" - part_name = "accessibility" - subsystem_name = "barrierfree" -} - -ohos_app_scope("accessibilityconfig_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("accessibilityconfig_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("accessibilityconfig_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":accessibilityconfig_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/barrierfree/accessibilityconfig/Test.json b/barrierfree/accessibilityconfig/Test.json deleted file mode 100644 index 488a0decf8abfc2cd94f7c6095a19b264205405d..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfig/Test.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "240000", - "bundle-name": "com.example.accessibilityconfig", - "module-name": "phone", - "shell-timeout": "600000", - "testcase-timeout": 70000 - }, - "kits": [ - { - "test-file-name": [ - "ActsAccessibilityConfigTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "power-shell wakeup", - "power-shell setmode 602" - ], - "teardown-command":[ - "bm uninstall -n com.example.accessibilityconfig" - ] - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfig/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts b/barrierfree/accessibilityconfig/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts deleted file mode 100644 index 5a10e42a4e2eb32383196a4a477743cdfc94e77d..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfig/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtensionAbility'; - -class AccessibilityExtAbility extends AccessibilityExtensionAbility { - - onConnect() { - console.info("[Demo] AccessibilityExtAbility onConnect"); - } - - onDisconnect() { - console.info("[Demo] AccessibilityExtAbility onDisconnect"); - } - - onAccessibilityEvent(accessibilityEvent) { - console.info("[Demo] AccessibilityExtAbility onAccessibilityEvent: " + JSON.stringify(accessibilityEvent)); - } -} - -export default AccessibilityExtAbility; \ No newline at end of file diff --git a/barrierfree/accessibilityconfig/entry/src/main/ets/Application/AbilityStage.ts b/barrierfree/accessibilityconfig/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 071c0d862407f266470cd7488a13b6bd745ee8fa..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfig/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,7 +0,0 @@ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} diff --git a/barrierfree/accessibilityconfig/entry/src/main/ets/MainAbility/MainAbility.ts b/barrierfree/accessibilityconfig/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index e5dba418d4e32bdebb3e528b1316c0328a04d87c..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfig/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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 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() { - // Ability is destroying, release resources for this ability - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate windowStage="+ windowStage) - //globalThis.windowStage = windowStage - //globalThis.abilityStorage = this.storage - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "MainAbility/pages/index/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") - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityconfig/entry/src/main/ets/MainAbility/pages/index/index.ets b/barrierfree/accessibilityconfig/entry/src/main/ets/MainAbility/pages/index/index.ets deleted file mode 100644 index 51bf7178e8c554cc5f4fb4ad6359e9356f97aadc..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfig/entry/src/main/ets/MainAbility/pages/index/index.ets +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 { - @State message: string = 'Hello World'; - - aboutToAppear(){ - console.info("start run testcase!!!!"); - } - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfig/entry/src/main/ets/TestAbility/TestAbility.ts b/barrierfree/accessibilityconfig/entry/src/main/ets/TestAbility/TestAbility.ts deleted file mode 100644 index 89a84730505783ba229175ab4b55d37f91a16266..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfig/entry/src/main/ets/TestAbility/TestAbility.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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' - -export default class TestAbility extends Ability { - onCreate(want, launchParam) { - console.log('TestAbility onCreate') - } - - 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') - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityconfig/entry/src/main/ets/TestAbility/pages/index.ets b/barrierfree/accessibilityconfig/entry/src/main/ets/TestAbility/pages/index.ets deleted file mode 100644 index b93567f962921124b282f78c8ef123965d1460c9..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfig/entry/src/main/ets/TestAbility/pages/index.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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%') - } - } \ No newline at end of file diff --git a/barrierfree/accessibilityconfig/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/barrierfree/accessibilityconfig/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index fde2966cd3df4d631cff5b012cbe4421d902d19c..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfig/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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.accessibilityxts.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') - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityconfig/entry/src/main/ets/test/AccessibilityConfig.test.ets b/barrierfree/accessibilityconfig/entry/src/main/ets/test/AccessibilityConfig.test.ets deleted file mode 100644 index b4114743b2c0b4e7fd0b3f8f3b4bfa217ad2109b..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfig/entry/src/main/ets/test/AccessibilityConfig.test.ets +++ /dev/null @@ -1,2290 +0,0 @@ -/* - * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" -import config from '@ohos.accessibility.config' - -export default function abilityTest() { - describe('AccessibilityConfigTest', function () { - - beforeEach(async function (done) { - console.info(`AccessibilityConfigTest: beforeEach starts`); - done(); - }) - - afterEach(async function (done) { - console.info(`AccessibilityConfigTest: afterEach starts`); - setTimeout(done, 1000); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncCallback_0100 - * @tc.name AccessibilityConfigTest_set_asyncCallback_0100 - * @tc.desc Test highContrastText.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncCallback_0100', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncCallback_0100'); - config.highContrastText.set(true, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_set_asyncCallback_0100 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncPromise_0200 - * @tc.name AccessibilityConfigTest_set_asyncPromise_0200 - * @tc.desc Test highContrastText.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncPromise_0200', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncPromise_0200'); - config.highContrastText.set(false).then((result) => { - console.info(`AccessibilityConfigTest_set_asyncPromise_0200 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_set_asyncPromise_0200 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncCallback_0300 - * @tc.name AccessibilityConfigTest_get_asyncCallback_0300 - * @tc.desc Test highContrastText.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncCallback_0300', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncCallback_0300'); - config.highContrastText.get((err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_get_asyncCallback_0300 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect('boolean').assertEqual(typeof (result)); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncPromise_0400 - * @tc.name AccessibilityConfigTest_get_asyncPromise_0400 - * @tc.desc Test highContrastText.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncPromise_0400', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncPromise_0400'); - config.highContrastText.get().then((result) => { - console.info(`AccessibilityConfigTest_get_asyncPromise_0400 result: ${result}`); - expect('boolean').assertEqual(typeof (result)); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_get_asyncPromise_0400 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_on_asyncCallback_0500 - * @tc.name AccessibilityConfigTest_on_asyncCallback_0500 - * @tc.desc Test highContrastText.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_on_asyncCallback_0500', 0, async function(done) { - console.info('AccessibilityConfigTest_on_asyncCallback_0500'); - let ret = config.highContrastText.on((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_off_asyncCallback_0600 - * @tc.name AccessibilityConfigTest_off_asyncCallback_0600 - * @tc.desc Test highContrastText.off() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_off_asyncCallback_0600', 0, async function(done) { - console.info('AccessibilityConfigTest_off_asyncCallback_0600'); - let ret = config.highContrastText.off((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncCallback_0700 - * @tc.name AccessibilityConfigTest_set_asyncCallback_0700 - * @tc.desc Test invertColor.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncCallback_0700', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncCallback_0700'); - config.invertColor.set(true, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_set_asyncCallback_0700 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncPromise_0800 - * @tc.name AccessibilityConfigTest_set_asyncPromise_0800 - * @tc.desc Test invertColor.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncPromise_0800', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncPromise_0800'); - config.invertColor.set(false).then((result) => { - console.info(`AccessibilityConfigTest_set_asyncPromise_0800 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_set_asyncPromise_0800 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncCallback_0900 - * @tc.name AccessibilityConfigTest_get_asyncCallback_0900 - * @tc.desc Test invertColor.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncCallback_0900', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncCallback_0900'); - config.invertColor.get((err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_get_asyncCallback_0900 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect('boolean').assertEqual(typeof (result)); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncPromise_1000 - * @tc.name AccessibilityConfigTest_get_asyncPromise_1000 - * @tc.desc Test invertColor.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncPromise_1000', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncPromise_1000'); - config.invertColor.get().then((result) => { - console.info(`AccessibilityConfigTest_get_asyncPromise_1000 result: ${result}`); - expect('boolean').assertEqual(typeof (result)); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_get_asyncPromise_1000 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_on_asyncCallback_1100 - * @tc.name AccessibilityConfigTest_on_asyncCallback_1100 - * @tc.desc Test invertColor.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_on_asyncCallback_1100', 0, async function(done) { - console.info('AccessibilityConfigTest_on_asyncCallback_1100'); - let ret = config.invertColor.on((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_off_asyncCallback_1200 - * @tc.name AccessibilityConfigTest_off_asyncCallback_1200 - * @tc.desc Test invertColor.off() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_off_asyncCallback_1200', 0, async function(done) { - console.info('AccessibilityConfigTest_off_asyncCallback_1200'); - let ret = config.invertColor.off((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncCallback_1300 - * @tc.name AccessibilityConfigTest_set_asyncCallback_1300 - * @tc.desc Test contentTimeout.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncCallback_1300', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncCallback_1300'); - config.contentTimeout.set(0, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_set_asyncCallback_1300 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncPromise_1400 - * @tc.name AccessibilityConfigTest_set_asyncPromise_1400 - * @tc.desc Test contentTimeout.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncPromise_1400', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncPromise_1400'); - config.contentTimeout.set(5000).then((result) => { - console.info(`AccessibilityConfigTest_set_asyncPromise_1400 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_set_asyncPromise_1400 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncCallback_1500 - * @tc.name AccessibilityConfigTest_get_asyncCallback_1500 - * @tc.desc Test contentTimeout.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncCallback_1500', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncCallback_1500'); - config.contentTimeout.get((err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_get_asyncCallback_1500 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect('number').assertEqual(typeof (result)); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncPromise_1600 - * @tc.name AccessibilityConfigTest_get_asyncPromise_1600 - * @tc.desc Test contentTimeout.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncPromise_1600', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncPromise_1600'); - config.contentTimeout.get().then((result) => { - console.info(`AccessibilityConfigTest_get_asyncPromise_1600 result: ${result}`); - expect('number').assertEqual(typeof (result)); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_get_asyncPromise_1600 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_on_asyncCallback_1700 - * @tc.name AccessibilityConfigTest_on_asyncCallback_1700 - * @tc.desc Test contentTimeout.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_on_asyncCallback_1700', 0, async function(done) { - console.info('AccessibilityConfigTest_on_asyncCallback_1700'); - let ret = config.contentTimeout.on((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_off_asyncCallback_1800 - * @tc.name AccessibilityConfigTest_off_asyncCallback_1800 - * @tc.desc Test contentTimeout.off() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_off_asyncCallback_1800', 0, async function(done) { - console.info('AccessibilityConfigTest_off_asyncCallback_1800'); - let ret = config.contentTimeout.off((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncCallback_1900 - * @tc.name AccessibilityConfigTest_set_asyncCallback_1900 - * @tc.desc Test animationOff.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncCallback_1900', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncCallback_1900'); - config.animationOff.set(true, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_set_asyncCallback_1900 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncPromise_2000 - * @tc.name AccessibilityConfigTest_set_asyncPromise_2000 - * @tc.desc Test animationOff.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncPromise_2000', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncPromise_2000'); - config.animationOff.set(false).then((result) => { - console.info(`AccessibilityConfigTest_set_asyncPromise_2000 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_set_asyncPromise_2000 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncCallback_2100 - * @tc.name AccessibilityConfigTest_get_asyncCallback_2100 - * @tc.desc Test animationOff.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncCallback_2100', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncCallback_2100'); - config.animationOff.get((err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_get_asyncCallback_2100 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect('boolean').assertEqual(typeof (result)); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncPromise_2200 - * @tc.name AccessibilityConfigTest_get_asyncPromise_2200 - * @tc.desc Test animationOff.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncPromise_2200', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncPromise_2200'); - config.animationOff.get().then((result) => { - console.info(`AccessibilityConfigTest_get_asyncPromise_2200 result: ${result}`); - expect('boolean').assertEqual(typeof (result)); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_get_asyncPromise_2200 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_on_asyncCallback_2300 - * @tc.name AccessibilityConfigTest_on_asyncCallback_2300 - * @tc.desc Test animationOff.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_on_asyncCallback_2300', 0, async function(done) { - console.info('AccessibilityConfigTest_on_asyncCallback_2300'); - let ret = config.animationOff.on((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_off_asyncCallback_2400 - * @tc.name AccessibilityConfigTest_off_asyncCallback_2400 - * @tc.desc Test animationOff.off() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_off_asyncCallback_2400', 0, async function(done) { - console.info('AccessibilityConfigTest_off_asyncCallback_2400'); - let ret = config.animationOff.off((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncCallback_2500 - * @tc.name AccessibilityConfigTest_set_asyncCallback_2500 - * @tc.desc Test brightnessDiscount.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncCallback_2500', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncCallback_2500'); - config.brightnessDiscount.set(0.1, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_set_asyncCallback_2500 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncPromise_2600 - * @tc.name AccessibilityConfigTest_set_asyncPromise_2600 - * @tc.desc Test brightnessDiscount.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncPromise_2600', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncPromise_2600'); - config.brightnessDiscount.set(0.9).then((result) => { - console.info(`AccessibilityConfigTest_set_asyncPromise_2600 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_set_asyncPromise_2600 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncCallback_2700 - * @tc.name AccessibilityConfigTest_get_asyncCallback_2700 - * @tc.desc Test brightnessDiscount.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncCallback_2700', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncCallback_2700'); - config.brightnessDiscount.get((err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_get_asyncCallback_2700 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect('number').assertEqual(typeof (result)); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncPromise_2800 - * @tc.name AccessibilityConfigTest_get_asyncPromise_2800 - * @tc.desc Test brightnessDiscount.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncPromise_2800', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncPromise_2800'); - config.brightnessDiscount.get().then((result) => { - console.info(`AccessibilityConfigTest_get_asyncPromise_2800 result: ${result}`); - expect('number').assertEqual(typeof (result)); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_get_asyncPromise_2800 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_on_asyncCallback_2900 - * @tc.name AccessibilityConfigTest_on_asyncCallback_2900 - * @tc.desc Test brightnessDiscount.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_on_asyncCallback_2900', 0, async function(done) { - console.info('AccessibilityConfigTest_on_asyncCallback_2900'); - let ret = config.brightnessDiscount.on((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_off_asyncCallback_3000 - * @tc.name AccessibilityConfigTest_off_asyncCallback_3000 - * @tc.desc Test brightnessDiscount.off() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_off_asyncCallback_3000', 0, async function(done) { - console.info('AccessibilityConfigTest_off_asyncCallback_3000'); - let ret = config.brightnessDiscount.off((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncCallback_4900 - * @tc.name AccessibilityConfigTest_set_asyncCallback_4900 - * @tc.desc Test mouseKey.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncCallback_4900', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncCallback_4900'); - config.mouseKey.set(true, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_set_asyncCallback_4900 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncPromise_5000 - * @tc.name AccessibilityConfigTest_set_asyncPromise_5000 - * @tc.desc Test mouseKey.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncPromise_5000', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncPromise_5000'); - config.mouseKey.set(false).then((result) => { - console.info(`AccessibilityConfigTest_set_asyncPromise_5000 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_set_asyncPromise_5000 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncCallback_5100 - * @tc.name AccessibilityConfigTest_get_asyncCallback_5100 - * @tc.desc Test mouseKey.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncCallback_5100', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncCallback_5100'); - config.mouseKey.get((err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_get_asyncCallback_5100 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect('boolean').assertEqual(typeof (result)); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncPromise_5200 - * @tc.name AccessibilityConfigTest_get_asyncPromise_5200 - * @tc.desc Test mouseKey.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncPromise_5200', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncPromise_5200'); - config.mouseKey.get().then((result) => { - console.info(`AccessibilityConfigTest_get_asyncPromise_5200 result: ${result}`); - expect('boolean').assertEqual(typeof (result)); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_get_asyncPromise_5200 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_on_asyncCallback_5300 - * @tc.name AccessibilityConfigTest_on_asyncCallback_5300 - * @tc.desc Test mouseKey.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_on_asyncCallback_5300', 0, async function(done) { - console.info('AccessibilityConfigTest_on_asyncCallback_5300'); - let ret = config.mouseKey.on((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_off_asyncCallback_5400 - * @tc.name AccessibilityConfigTest_off_asyncCallback_5400 - * @tc.desc Test mouseKey.off() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_off_asyncCallback_5400', 0, async function(done) { - console.info('AccessibilityConfigTest_off_asyncCallback_5400'); - let ret = config.mouseKey.off((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncCallback_5500 - * @tc.name AccessibilityConfigTest_set_asyncCallback_5500 - * @tc.desc Test mouseAutoClick.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncCallback_5500', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncCallback_5500'); - config.mouseAutoClick.set(1, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_set_asyncCallback_5500 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncPromise_5600 - * @tc.name AccessibilityConfigTest_set_asyncPromise_5600 - * @tc.desc Test mouseAutoClick.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncPromise_5600', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncPromise_5600'); - config.mouseAutoClick.set(5000).then((result) => { - console.info(`AccessibilityConfigTest_set_asyncPromise_5600 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_set_asyncPromise_5600 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncCallback_5700 - * @tc.name AccessibilityConfigTest_get_asyncCallback_5700 - * @tc.desc Test mouseAutoClick.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncCallback_5700', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncCallback_5700'); - config.mouseAutoClick.get((err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_get_asyncCallback_5700 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect('number').assertEqual(typeof (result)); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncPromise_5800 - * @tc.name AccessibilityConfigTest_get_asyncPromise_5800 - * @tc.desc Test mouseAutoClick.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncPromise_5800', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncPromise_5800'); - config.mouseAutoClick.get().then((result) => { - console.info(`AccessibilityConfigTest_get_asyncPromise_5800 result: ${result}`); - expect('number').assertEqual(typeof (result)); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_get_asyncPromise_5800 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_on_asyncCallback_5900 - * @tc.name AccessibilityConfigTest_on_asyncCallback_5900 - * @tc.desc Test mouseAutoClick.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_on_asyncCallback_5900', 0, async function(done) { - console.info('AccessibilityConfigTest_on_asyncCallback_5900'); - let ret = config.mouseAutoClick.on((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_off_asyncCallback_6000 - * @tc.name AccessibilityConfigTest_off_asyncCallback_6000 - * @tc.desc Test mouseAutoClick.off() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_off_asyncCallback_6000', 0, async function(done) { - console.info('AccessibilityConfigTest_off_asyncCallback_6000'); - let ret = config.mouseAutoClick.off((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncCallback_6100 - * @tc.name AccessibilityConfigTest_set_asyncCallback_6100 - * @tc.desc Test shortkey.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncCallback_6100', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncCallback_6100'); - config.shortkey.set(true, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_set_asyncCallback_6100 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncPromise_6200 - * @tc.name AccessibilityConfigTest_set_asyncPromise_6200 - * @tc.desc Test shortkey.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncPromise_6200', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncPromise_6200'); - config.shortkey.set(false).then((result) => { - console.info(`AccessibilityConfigTest_set_asyncPromise_6200 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_set_asyncPromise_6200 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncCallback_6300 - * @tc.name AccessibilityConfigTest_get_asyncCallback_6300 - * @tc.desc Test shortkey.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncCallback_6300', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncCallback_6300'); - config.shortkey.get((err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_get_asyncCallback_6300 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect('boolean').assertEqual(typeof (result)); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncPromise_6400 - * @tc.name AccessibilityConfigTest_get_asyncPromise_6400 - * @tc.desc Test shortkey.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncPromise_6400', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncPromise_6400'); - config.shortkey.get().then((result) => { - console.info(`AccessibilityConfigTest_get_asyncPromise_6400 result: ${result}`); - expect('boolean').assertEqual(typeof (result)); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_get_asyncPromise_6400 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_on_asyncCallback_6500 - * @tc.name AccessibilityConfigTest_on_asyncCallback_6500 - * @tc.desc Test shortkey.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_on_asyncCallback_6500', 0, async function(done) { - console.info('AccessibilityConfigTest_on_asyncCallback_6500'); - let ret = config.shortkey.on((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_off_asyncCallback_6600 - * @tc.name AccessibilityConfigTest_off_asyncCallback_6600 - * @tc.desc Test shortkey.off() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_off_asyncCallback_6600', 0, async function(done) { - console.info('AccessibilityConfigTest_off_asyncCallback_6600'); - let ret = config.shortkey.off((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncCallback_6700 - * @tc.name AccessibilityConfigTest_set_asyncCallback_6700 - * @tc.desc Test shortkeyTarget.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncCallback_6700', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncCallback_6700'); - let value = 'teststr' - config.shortkeyTarget.set(value, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_set_asyncCallback_6700 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncPromise_6800 - * @tc.name AccessibilityConfigTest_set_asyncPromise_6800 - * @tc.desc Test shortkeyTarget.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncPromise_6800', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncPromise_6800'); - let value = 'test' - config.shortkeyTarget.set(value).then((result) => { - console.info(`AccessibilityConfigTest_set_asyncPromise_6800 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_set_asyncPromise_6800 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncCallback_6900 - * @tc.name AccessibilityConfigTest_get_asyncCallback_6900 - * @tc.desc Test shortkeyTarget.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncCallback_6900', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncCallback_6900'); - config.shortkeyTarget.get((err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_get_asyncCallback_6900 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect('string').assertEqual(typeof (result)); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncPromise_7000 - * @tc.name AccessibilityConfigTest_get_asyncPromise_7000 - * @tc.desc Test shortkeyTarget.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncPromise_7000', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncPromise_7000'); - config.shortkeyTarget.get().then((result) => { - console.info(`AccessibilityConfigTest_get_asyncPromise_7000 result: ${result}`); - expect('string').assertEqual(typeof (result)); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_get_asyncPromise_7000 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_on_asyncCallback_7100 - * @tc.name AccessibilityConfigTest_on_asyncCallback_7100 - * @tc.desc Test shortkeyTarget.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_on_asyncCallback_7100', 0, async function(done) { - console.info('AccessibilityConfigTest_on_asyncCallback_7100'); - let ret = config.shortkeyTarget.on((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_off_asyncCallback_7200 - * @tc.name AccessibilityConfigTest_off_asyncCallback_7200 - * @tc.desc Test shortkeyTarget.off() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_off_asyncCallback_7200', 0, async function(done) { - console.info('AccessibilityConfigTest_off_asyncCallback_7200'); - let ret = config.shortkeyTarget.off((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncCallback_7300 - * @tc.name AccessibilityConfigTest_set_asyncCallback_7300 - * @tc.desc Test captions.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncCallback_7300', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncCallback_7300'); - config.captions.set(true, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_set_asyncCallback_7300 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncPromise_7400 - * @tc.name AccessibilityConfigTest_set_asyncPromise_7400 - * @tc.desc Test captions.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncPromise_7400', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncPromise_7400'); - config.captions.set(false).then((result) => { - console.info(`AccessibilityConfigTest_set_asyncPromise_7400 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_set_asyncPromise_7400 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncCallback_7500 - * @tc.name AccessibilityConfigTest_get_asyncCallback_7500 - * @tc.desc Test captions.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncCallback_7500', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncCallback_7500'); - config.captions.get((err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_get_asyncCallback_7500 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect('boolean').assertEqual(typeof (result)); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncPromise_7600 - * @tc.name AccessibilityConfigTest_get_asyncPromise_7600 - * @tc.desc Test captions.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncPromise_7600', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncPromise_7600'); - config.captions.get().then((result) => { - console.info(`AccessibilityConfigTest_get_asyncPromise_7600 result: ${result}`); - expect('boolean').assertEqual(typeof (result)); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_get_asyncPromise_7600 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_on_asyncCallback_7700 - * @tc.name AccessibilityConfigTest_on_asyncCallback_7700 - * @tc.desc Test captions.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_on_asyncCallback_7700', 0, async function(done) { - console.info('AccessibilityConfigTest_on_asyncCallback_7700'); - let ret = config.captions.on((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_off_asyncCallback_7800 - * @tc.name AccessibilityConfigTest_off_asyncCallback_7800 - * @tc.desc Test captions.off() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_off_asyncCallback_7800', 0, async function(done) { - console.info('AccessibilityConfigTest_off_asyncCallback_7800'); - let ret = config.captions.off((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncCallback_7900 - * @tc.name AccessibilityConfigTest_set_asyncCallback_7900 - * @tc.desc Test daltonizationColorFilter.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncCallback_7900', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncCallback_7900'); - config.daltonizationColorFilter.set('Normal', (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_set_asyncCallback_7900 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncCallback_8000 - * @tc.name AccessibilityConfigTest_set_asyncCallback_8000 - * @tc.desc Test daltonizationColorFilter.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncCallback_8000', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncCallback_8000'); - config.daltonizationColorFilter.set('Deuteranomaly', (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_set_asyncCallback_8000 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncPromise_8100 - * @tc.name AccessibilityConfigTest_set_asyncPromise_8100 - * @tc.desc Test daltonizationColorFilter.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncPromise_8100', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncPromise_8100'); - config.daltonizationColorFilter.set('Protanomaly').then((result) => { - console.info(`AccessibilityConfigTest_set_asyncPromise_8100 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_set_asyncPromise_8100 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncPromise_8200 - * @tc.name AccessibilityConfigTest_set_asyncPromise_8200 - * @tc.desc Test daltonizationColorFilter.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncPromise_8200', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncPromise_8200'); - config.daltonizationColorFilter.set('Tritanomaly').then((result) => { - console.info(`AccessibilityConfigTest_set_asyncPromise_8200 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_set_asyncPromise_8200 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncCallback_8300 - * @tc.name AccessibilityConfigTest_get_asyncCallback_8300 - * @tc.desc Test daltonizationColorFilter.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncCallback_8300', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncCallback_8300'); - config.daltonizationColorFilter.get((err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_get_asyncCallback_8300 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect('string').assertEqual(typeof (result)); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncPromise_8400 - * @tc.name AccessibilityConfigTest_get_asyncPromise_8400 - * @tc.desc Test daltonizationColorFilter.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncPromise_8400', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncPromise_8400'); - config.daltonizationColorFilter.get().then((result) => { - console.info(`AccessibilityConfigTest_get_asyncPromise_8400 result: ${result}`); - expect('string').assertEqual(typeof (result)); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_get_asyncPromise_8400 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_on_asyncCallback_8500 - * @tc.name AccessibilityConfigTest_on_asyncCallback_8500 - * @tc.desc Test daltonizationColorFilter.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_on_asyncCallback_8500', 0, async function(done) { - console.info('AccessibilityConfigTest_on_asyncCallback_8500'); - let ret = config.daltonizationColorFilter.on((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_off_asyncCallback_8600 - * @tc.name AccessibilityConfigTest_off_asyncCallback_8600 - * @tc.desc Test daltonizationColorFilter.off() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_off_asyncCallback_8600', 0, async function(done) { - console.info('AccessibilityConfigTest_off_asyncCallback_8600'); - let ret = config.daltonizationColorFilter.off((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncCallback_8700 - * @tc.name AccessibilityConfigTest_set_asyncCallback_8700 - * @tc.desc Test captionsStyle.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncCallback_8700', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncCallback_8700'); - config.captionsStyle.set({ - fontFamily: 'default', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'none', - backgroundColor: 'blue', - windowColor: 'blue' - }, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_set_asyncCallback_8700 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_set_asyncPromise_8800 - * @tc.name AccessibilityConfigTest_set_asyncPromise_8800 - * @tc.desc Test captionsStyle.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_set_asyncPromise_8800', 0, async function(done) { - console.info('AccessibilityConfigTest_set_asyncPromise_8800'); - config.captionsStyle.set({ - fontFamily: 'default', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'none', - backgroundColor: 'blue', - windowColor: 'blue' - }).then((result) => { - console.info(`AccessibilityConfigTest_set_asyncPromise_8800 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_set_asyncPromise_8800 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncCallback_8900 - * @tc.name AccessibilityConfigTest_get_asyncCallback_8900 - * @tc.desc Test captionsStyle.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncCallback_8900', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncCallback_8900'); - config.captionsStyle.get((err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_get_asyncCallback_8900 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect('object').assertEqual(typeof (result)); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_get_asyncPromise_9000 - * @tc.name AccessibilityConfigTest_get_asyncPromise_9000 - * @tc.desc Test captionsStyle.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_get_asyncPromise_9000', 0, async function(done) { - console.info('AccessibilityConfigTest_get_asyncPromise_9000'); - config.captionsStyle.get().then((result) => { - console.info(`AccessibilityConfigTest_get_asyncPromise_9000 result: ${result}`); - expect('object').assertEqual(typeof (result)); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigTest_get_asyncPromise_9000 has error: ${err.code}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_on_asyncCallback_9100 - * @tc.name AccessibilityConfigTest_on_asyncCallback_9100 - * @tc.desc Test captionsStyle.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_on_asyncCallback_9100', 0, async function(done) { - console.info('AccessibilityConfigTest_on_asyncCallback_9100'); - let ret = config.captionsStyle.on((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_off_asyncCallback_9200 - * @tc.name AccessibilityConfigTest_off_asyncCallback_9200 - * @tc.desc Test captionsStyle.off() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_off_asyncCallback_9200', 0, async function(done) { - console.info('AccessibilityConfigTest_off_asyncCallback_9200'); - let ret = config.captionsStyle.off((data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_enableAbility_asyncCallback_9300 - * @tc.name AccessibilityConfigTest_enableAbility_asyncCallback_9300 - * @tc.desc Test enableAbility() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_enableAbility_asyncCallback_9300', 0, async function(done) { - console.info('AccessibilityConfigTest_enableAbility_asyncCallback_9300'); - let name = ''; - config.enableAbility(name, [], (err) => { - console.info(`AccessibilityConfigTest_enableAbility_asyncCallback_9300 error: ${JSON.stringify(err)}`); - if (err.code != 0) { - expect(true).assertTrue(); - } else { - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_enableAbility_asyncCallback_9400 - * @tc.name AccessibilityConfigTest_enableAbility_asyncCallback_9400 - * @tc.desc Test enableAbility() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_enableAbility_asyncCallback_9400', 0, async function(done) { - console.info('AccessibilityConfigTest_enableAbility_asyncCallback_9400'); - let name = 'test'; - config.enableAbility(name, ['retrieve'], (err) => { - console.info(`AccessibilityConfigTest_enableAbility_asyncCallback_9400 error: ${JSON.stringify(err)}`); - if (err.code != 0) { - expect(true).assertTrue(); - } else { - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_enableAbility_asyncCallback_9500 - * @tc.name AccessibilityConfigTest_enableAbility_asyncCallback_9500 - * @tc.desc Test enableAbility() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_enableAbility_asyncCallback_9500', 0, async function(done) { - console.info('AccessibilityConfigTest_enableAbility_asyncCallback_9500'); - let name = 'test.com'; - config.enableAbility(name, ['retrieve', 'touchGuide'], (err) => { - console.info(`AccessibilityConfigTest_enableAbility_asyncCallback_9500 error: ${JSON.stringify(err)}`); - if (err.code != 0) { - expect(true).assertTrue(); - } else { - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_enableAbility_asyncCallback_9600 - * @tc.name AccessibilityConfigTest_enableAbility_asyncCallback_9600 - * @tc.desc Test enableAbility() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_enableAbility_asyncCallback_9600', 0, async function(done) { - console.info('AccessibilityConfigTest_enableAbility_asyncCallback_9600'); - let name = 'com.example.accessibilityconfig/AccessibilityExtAbility'; - config.enableAbility(name, ['retrieve', 'touchGuide', 'keyEventObserver'], (err) => { - console.info(`AccessibilityConfigTest_enableAbility_asyncCallback_9600 error: ${JSON.stringify(err)}`); - if (err && err.code != 0) { - expect(null).assertFail(); - } else { - expect(true).assertTrue(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_enableAbility_asyncCallback_9700 - * @tc.name AccessibilityConfigTest_enableAbility_asyncCallback_9700 - * @tc.desc Test enableAbility() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_enableAbility_asyncCallback_9700', 0, async function(done) { - console.info('AccessibilityConfigTest_enableAbility_asyncCallback_9700'); - let name = 'xxx'; - config.enableAbility(name, ['retrieve'], (err) => { - console.info(`AccessibilityConfigTest_enableAbility_asyncCallback_9700 error: ${JSON.stringify(err)}`); - if (err && err.code != 0) { - expect(9300001).assertEqual(err.code); - } else { - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_enableAbility_asyncPromise_10000 - * @tc.name AccessibilityConfigTest_enableAbility_asyncPromise_10000 - * @tc.desc Test enableAbility() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_enableAbility_asyncPromise_10000', 0, async function(done) { - console.info('AccessibilityConfigTest_enableAbility_asyncPromise_10000'); - let name = 'com.example.accessibilityconfig/AccessibilityExtAbility'; - config.enableAbility(name, ['retrieve', 'touchGuide']).then(() => { - console.info('AccessibilityConfigTest_enableAbility_asyncPromise_10000 result back'); - expect(null).assertFail(); - done(); - }).catch((err) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_enableAbility_asyncPromise_10000 has error: ${JSON.stringify(err)}`); - expect(9300002 ).assertEqual(err.code); - done(); - } - }); - }) - - /* - * @tc.number AccessibilityConfigTest_enableAbility_asyncPromise_10100 - * @tc.name AccessibilityConfigTest_enableAbility_asyncPromise_10100 - * @tc.desc Test enableAbility() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_enableAbility_asyncPromise_10100', 0, async function(done) { - console.info('AccessibilityConfigTest_enableAbility_asyncPromise_10100'); - let name = 'com.test'; - config.enableAbility(name, ['retrieve', 'touchGuide', 'keyEventObserver']).then(() => { - console.info('AccessibilityConfigTest_enableAbility_asyncPromise_10100 result back'); - expect(null).assertFail(); - done(); - }).catch((err) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_enableAbility_asyncPromise_10100 has error: ${JSON.stringify(err)}`); - expect(9300001 ).assertEqual(err.code); - done(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_disableAbility_asyncCallback_10400 - * @tc.name AccessibilityConfigTest_disableAbility_asyncCallback_10400 - * @tc.desc Test disableAbility() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_disableAbility_asyncCallback_10400', 0, async function(done) { - console.info('AccessibilityConfigTest_disableAbility_asyncCallback_10400'); - let name = 'test'; - config.disableAbility(name, (err) => { - console.info(`AccessibilityConfigTest_disableAbility_asyncCallback_10400 err: ${JSON.stringify(err)}`); - if (err && err.code != 0) { - expect(9300001).assertEqual(err.code); - } else { - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_disableAbility_asyncCallback_10500 - * @tc.name AccessibilityConfigTest_disableAbility_asyncCallback_10500 - * @tc.desc Test disableAbility() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_disableAbility_asyncCallback_10500', 0, async function(done) { - console.info('AccessibilityConfigTest_disableAbility_asyncCallback_10500'); - let name = 'com.example.accessibilityconfig/AccessibilityExtAbility'; - config.disableAbility(name, (err) => { - console.info(`AccessibilityConfigTest_disableAbility_asyncCallback_10500 err: ${JSON.stringify(err)}`); - if (err && err.code != 0) { - expect(null).assertFail(); - } else { - expect(true).assertTrue(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_disableAbility_asyncPromise_10900 - * @tc.name AccessibilityConfigTest_disableAbility_asyncPromise_10900 - * @tc.desc Test disableAbility() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_disableAbility_asyncPromise_10900', 0, async function(done) { - console.info('AccessibilityConfigTest_disableAbility_asyncPromise_10900'); - let name = 'test'; - config.disableAbility(name).then(() => { - console.info('AccessibilityConfigTest_disableAbility_asyncPromise_10900 result back'); - expect(null).assertFail(); - done(); - }).catch((err) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_disableAbility_asyncPromise_10900 has error: ${JSON.stringify(err)}`); - expect(9300001).assertEqual(err.code); - done(); - } - }); - }) - - /* - * @tc.number AccessibilityConfigTest_disableAbility_asyncPromise_11000 - * @tc.name AccessibilityConfigTest_disableAbility_asyncPromise_11000 - * @tc.desc Test disableAbility() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_disableAbility_asyncPromise_11000', 0, async function(done) { - console.info('AccessibilityConfigTest_disableAbility_asyncPromise_11000'); - let name = 'test.com'; - config.disableAbility(name).then(() => { - console.info('AccessibilityConfigTest_disableAbility_asyncPromise_11000 result back'); - expect(null).assertFail(); - done(); - }).catch((err) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_disableAbility_asyncPromise_11000 has error: ${JSON.stringify(err)}`); - expect(true).assertTrue(); - done(); - } - }); - }) - - /* - * @tc.number AccessibilityConfigTest_disableAbility_asyncPromise_11100 - * @tc.name AccessibilityConfigTest_disableAbility_asyncPromise_11100 - * @tc.desc Test disableAbility() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_disableAbility_asyncPromise_11100', 0, async function(done) { - console.info('AccessibilityConfigTest_disableAbility_asyncPromise_11100'); - let name = 'com.test'; - config.disableAbility(name).then(() => { - console.info('AccessibilityConfigTest_disableAbility_asyncPromise_11100 result back'); - expect(null).assertFail(); - done(); - }).catch((err) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_disableAbility_asyncPromise_11100 has error: ${JSON.stringify(err)}`); - expect(true).assertTrue(); - done(); - } - }); - }) - - /* - * @tc.number AccessibilityConfigTest_on_asyncCallback_11300 - * @tc.name AccessibilityConfigTest_on_asyncCallback_11300 - * @tc.desc Test on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_on_asyncCallback_11300', 0, async function(done) { - console.info('AccessibilityConfigTest_on_asyncCallback_11300'); - let ret = config.on('enabledAccessibilityExtensionListChange', (data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_off_asyncCallback_11400 - * @tc.name AccessibilityConfigTest_off_asyncCallback_11400 - * @tc.desc Test off() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_off_asyncCallback_11400', 0, async function(done) { - console.info('AccessibilityConfigTest_off_asyncCallback_11400'); - let ret = config.off('enabledAccessibilityExtensionListChange', (data) => {}); - expect(ret).assertEqual(undefined); - done(); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncCallback_0100 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncCallback_0100 - * @tc.desc Test captionsStyle.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncCallback_0100', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncCallback_0100'); - config.captionsStyle.set({ - fontFamily: 'monospacedSerif', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'none', - backgroundColor: 'blue', - windowColor: 'blue' - }, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncCallback_0100 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncCallback_0200 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncCallback_0200 - * @tc.desc Test captionsStyle.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncCallback_0200', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncCallback_0200'); - config.captionsStyle.set({ - fontFamily: 'serif', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'none', - backgroundColor: 'blue', - windowColor: 'blue' - }, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncCallback_0200 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncCallback_0300 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncCallback_0300 - * @tc.desc Test captionsStyle.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncCallback_0300', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncCallback_0300'); - config.captionsStyle.set({ - fontFamily: 'monospacedSansSerif', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'none', - backgroundColor: 'blue', - windowColor: 'blue' - }, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncCallback_0300 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncCallback_0400 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncCallback_0400 - * @tc.desc Test captionsStyle.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncCallback_0400', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncCallback_0400'); - config.captionsStyle.set({ - fontFamily: 'sansSerif', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'none', - backgroundColor: 'blue', - windowColor: 'blue' - }, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncCallback_0400 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncCallback_0500 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncCallback_0500 - * @tc.desc Test captionsStyle.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncCallback_0500', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncCallback_0500'); - config.captionsStyle.set({ - fontFamily: 'casual', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'none', - backgroundColor: 'blue', - windowColor: 'blue' - }, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncCallback_0500 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncCallback_0600 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncCallback_0600 - * @tc.desc Test captionsStyle.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncCallback_0600', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncCallback_0600'); - config.captionsStyle.set({ - fontFamily: 'cursive', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'none', - backgroundColor: 'blue', - windowColor: 'blue' - }, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncCallback_0600 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncCallback_0700 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncCallback_0700 - * @tc.desc Test captionsStyle.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncCallback_0700', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncCallback_0700'); - config.captionsStyle.set({ - fontFamily: 'smallCapitals', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'none', - backgroundColor: 'blue', - windowColor: 'blue' - }, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncCallback_0700 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncCallback_0800 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncCallback_0800 - * @tc.desc Test captionsStyle.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncCallback_0800', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncCallback_0800'); - config.captionsStyle.set({ - fontFamily: 'default', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'raised', - backgroundColor: 'blue', - windowColor: 'blue' - }, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncCallback_0800 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncCallback_0900 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncCallback_0900 - * @tc.desc Test captionsStyle.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncCallback_0900', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncCallback_0900'); - config.captionsStyle.set({ - fontFamily: 'default', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'depressed', - backgroundColor: 'blue', - windowColor: 'blue' - }, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncCallback_0900 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncCallback_1000 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncCallback_1000 - * @tc.desc Test captionsStyle.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncCallback_1000', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncCallback_1000'); - config.captionsStyle.set({ - fontFamily: 'default', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'uniform', - backgroundColor: 'blue', - windowColor: 'blue' - }, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncCallback_1000 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncCallback_1100 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncCallback_1100 - * @tc.desc Test captionsStyle.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncCallback_1100', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncCallback_1100'); - config.captionsStyle.set({ - fontFamily: 'default', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'dropShadow', - backgroundColor: 'blue', - windowColor: 'blue' - }, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncCallback_1100 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - expect(result).assertEqual(undefined); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncPromise_0100 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncPromise_0100 - * @tc.desc Test captionsStyle.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncPromise_0100', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncPromise_0100'); - config.captionsStyle.set({ - fontFamily: 'monospacedSerif', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'none', - backgroundColor: 'blue', - windowColor: 'blue' - }).then((result) => { - console.info(`AccessibilityConfigTest_captionsStyle_asyncPromise_0100 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncPromise_0100 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncPromise_0200 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncPromise_0200 - * @tc.desc Test captionsStyle.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncPromise_0200', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncPromise_0200'); - config.captionsStyle.set({ - fontFamily: 'serif', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'none', - backgroundColor: 'blue', - windowColor: 'blue' - }).then((result) => { - console.info(`AccessibilityConfigTest_captionsStyle_asyncPromise_0200 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncPromise_0200 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncPromise_0300 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncPromise_0300 - * @tc.desc Test captionsStyle.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncPromise_0300', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncPromise_0300'); - config.captionsStyle.set({ - fontFamily: 'monospacedSansSerif', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'none', - backgroundColor: 'blue', - windowColor: 'blue' - }).then((result) => { - console.info(`AccessibilityConfigTest_captionsStyle_asyncPromise_0300 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncPromise_0300 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncPromise_0400 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncPromise_0400 - * @tc.desc Test captionsStyle.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncPromise_0400', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncPromise_0400'); - config.captionsStyle.set({ - fontFamily: 'sansSerif', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'none', - backgroundColor: 'blue', - windowColor: 'blue' - }).then((result) => { - console.info(`AccessibilityConfigTest_captionsStyle_asyncPromise_0400 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncPromise_0400 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncPromise_0500 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncPromise_0500 - * @tc.desc Test captionsStyle.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncPromise_0500', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncPromise_0500'); - config.captionsStyle.set({ - fontFamily: 'casual', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'none', - backgroundColor: 'blue', - windowColor: 'blue' - }).then((result) => { - console.info(`AccessibilityConfigTest_captionsStyle_asyncPromise_0500 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncPromise_0500 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncPromise_0600 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncPromise_0600 - * @tc.desc Test captionsStyle.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncPromise_0600', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncPromise_0600'); - config.captionsStyle.set({ - fontFamily: 'cursive', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'none', - backgroundColor: 'blue', - windowColor: 'blue' - }).then((result) => { - console.info(`AccessibilityConfigTest_captionsStyle_asyncPromise_0600 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncPromise_0600 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncPromise_0700 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncPromise_0700 - * @tc.desc Test captionsStyle.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncPromise_0700', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncPromise_0700'); - config.captionsStyle.set({ - fontFamily: 'smallCapitals', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'none', - backgroundColor: 'blue', - windowColor: 'blue' - }).then((result) => { - console.info(`AccessibilityConfigTest_captionsStyle_asyncPromise_0700 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncPromise_0700 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncPromise_0800 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncPromise_0800 - * @tc.desc Test captionsStyle.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncPromise_0800', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncPromise_0800'); - config.captionsStyle.set({ - fontFamily: 'default', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'raised', - backgroundColor: 'blue', - windowColor: 'blue' - }).then((result) => { - console.info(`AccessibilityConfigTest_captionsStyle_asyncPromise_0800 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncPromise_0800 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncPromise_0900 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncPromise_0900 - * @tc.desc Test captionsStyle.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncPromise_0900', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncPromise_0900'); - config.captionsStyle.set({ - fontFamily: 'default', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'depressed', - backgroundColor: 'blue', - windowColor: 'blue' - }).then((result) => { - console.info(`AccessibilityConfigTest_captionsStyle_asyncPromise_0900 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncPromise_0900 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncPromise_1000 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncPromise_1000 - * @tc.desc Test captionsStyle.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncPromise_1000', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncPromise_1000'); - config.captionsStyle.set({ - fontFamily: 'default', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'uniform', - backgroundColor: 'blue', - windowColor: 'blue' - }).then((result) => { - console.info(`AccessibilityConfigTest_captionsStyle_asyncPromise_1000 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncPromise_1000 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - }); - }) - - /* - * @tc.number AccessibilityConfigTest_captionsStyle_asyncPromise_1100 - * @tc.name AccessibilityConfigTest_captionsStyle_asyncPromise_1100 - * @tc.desc Test captionsStyle.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigTest_captionsStyle_asyncPromise_1100', 0, async function(done) { - console.info('AccessibilityConfigTest_captionsStyle_asyncPromise_1100'); - config.captionsStyle.set({ - fontFamily: 'default', - fontScale: 10, - fontColor: 'blue', - fontEdgeType: 'dropShadow', - backgroundColor: 'blue', - windowColor: 'blue' - }).then((result) => { - console.info(`AccessibilityConfigTest_captionsStyle_asyncPromise_1100 result: ${result}`); - expect(result).assertEqual(undefined); - done(); - }).catch((err) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigTest_captionsStyle_asyncPromise_1100 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - }); - }) - }) -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfig/entry/src/main/ets/test/List.test.ets b/barrierfree/accessibilityconfig/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 8cfe3dd44fdfca24d897039ddab1dc4dfb52d7e9..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfig/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 './AccessibilityConfig.test.ets' - -export default function testsuite() { - abilityTest() -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfig/entry/src/main/module.json b/barrierfree/accessibilityconfig/entry/src/main/module.json deleted file mode 100644 index b27cad102a8d00c418ecf3417ebf029139253a28..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfig/entry/src/main/module.json +++ /dev/null @@ -1,59 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default", - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [{ - "name": "com.example.accessibilityxts.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [{ - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - }] - }], - "extensionAbilities": [ - { - "name": "AccessibilityExtAbility", - "srcEntrance": "./ets/AccessibilityExtAbility/AccessibilityExtAbility.ts", - "label": "$string:Accessibility_label", - "description": "$string:Accessibility_desc", - "type": "accessibility", - "metadata": [ - { - "name": "ohos.accessibleability", - "resource": "$profile:accessibility_config" - } - ], - "permissions": ["ohos.permission.GET_BUNDLE_INFO"] - }], - "requestPermissions": [{ - "name": "ohos.permission.READ_ACCESSIBILITY_CONFIG", - "reason": "need use ohos.permission.READ_ACCESSIBILITY_CONFIG" - }, - { - "name": "ohos.permission.WRITE_ACCESSIBILITY_CONFIG", - "reason": "need use ohos.permission.WRITE_ACCESSIBILITY_CONFIG" - } - ] - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfig/entry/src/main/resources/base/element/string.json b/barrierfree/accessibilityconfig/entry/src/main/resources/base/element/string.json deleted file mode 100644 index eb6f24dd58e2e4b664a1ea53719a2754b68107d7..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfig/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsAccessibilityConfigTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - }, - { - "name": "Accessibility_desc", - "value": "accessibility_description" - }, - { - "name": "Accessibility_label", - "value": "accessibility_label" - } - ] -} diff --git a/barrierfree/accessibilityconfig/entry/src/main/resources/base/media/icon.png b/barrierfree/accessibilityconfig/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityconfig/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/barrierfree/accessibilityconfig/entry/src/main/resources/base/profile/accessibility_config.json b/barrierfree/accessibilityconfig/entry/src/main/resources/base/profile/accessibility_config.json deleted file mode 100644 index 9ecc070afc00a6c0a5e4ba95a47e3e627fcc3fbe..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfig/entry/src/main/resources/base/profile/accessibility_config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "accessibilityCapabilities": [ - "retrieve" - ], - "accessibilityCapabilityRationale": "a11y_rationale", - "settingsAbility": "com.accessibility.voiceaid.voiceAidSetting" -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfig/entry/src/main/resources/base/profile/main_pages.json b/barrierfree/accessibilityconfig/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index b26cd549a859adb13edff2f57b94be49566e5bb3..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfig/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index/index" - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfig/signature/openharmony_sx.p7b b/barrierfree/accessibilityconfig/signature/openharmony_sx.p7b deleted file mode 100644 index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityconfig/signature/openharmony_sx.p7b and /dev/null differ diff --git a/barrierfree/accessibilityconfigreqreadpermission/AppScope/app.json b/barrierfree/accessibilityconfigreqreadpermission/AppScope/app.json deleted file mode 100644 index 58b2c62b1b4c263a3717aad173175ca529b2cbc2..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqreadpermission/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.accessibilityconfigreqreadpermission", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon": "$media:icon", - "label": "$string:app_name", - "description": "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqreadpermission/AppScope/resources/base/element/string.json b/barrierfree/accessibilityconfigreqreadpermission/AppScope/resources/base/element/string.json deleted file mode 100644 index 2c46549041c0fbe208c580a5587b0dc9b5500dbd..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqreadpermission/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - }, - { - "name": "mainability_description", - "value": "ETS_Phone_Empty Stage Ability" - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqreadpermission/AppScope/resources/base/media/app_icon.png b/barrierfree/accessibilityconfigreqreadpermission/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityconfigreqreadpermission/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/barrierfree/accessibilityconfigreqreadpermission/BUILD.gn b/barrierfree/accessibilityconfigreqreadpermission/BUILD.gn deleted file mode 100755 index 8751e528674464b40f070abd3a23336b89eb347a..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqreadpermission/BUILD.gn +++ /dev/null @@ -1,42 +0,0 @@ -# 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("ActsAccessibilityConfigReqReadPermissionTest") { - hap_profile = "entry/src/main/module.json" - deps = [ - ":accessibilityconfigreqreadpermission_js_assets", - ":accessibilityconfigreqreadpermission_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAccessibilityConfigReqReadPermissionTest" - part_name = "accessibility" - subsystem_name = "barrierfree" -} - -ohos_app_scope("accessibilityconfigreqreadpermission_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("accessibilityconfigreqreadpermission_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("accessibilityconfigreqreadpermission_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":accessibilityconfigreqreadpermission_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/barrierfree/accessibilityconfigreqreadpermission/Test.json b/barrierfree/accessibilityconfigreqreadpermission/Test.json deleted file mode 100644 index 13da2ec56104d3fb24fb54fcf8e054113eb69fc4..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqreadpermission/Test.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "240000", - "bundle-name": "com.example.accessibilityconfigreqreadpermission", - "module-name": "phone", - "shell-timeout": "600000", - "testcase-timeout": 70000 - }, - "kits": [ - { - "test-file-name": [ - "ActsAccessibilityConfigReqReadPermissionTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "power-shell wakeup", - "power-shell setmode 602", - "param set persist.ace.testmode.enabled 1" - ], - "teardown-command":[ - "bm uninstall -n com.example.accessibilityconfigreqreadpermission" - ] - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts b/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts deleted file mode 100644 index 5a10e42a4e2eb32383196a4a477743cdfc94e77d..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtensionAbility'; - -class AccessibilityExtAbility extends AccessibilityExtensionAbility { - - onConnect() { - console.info("[Demo] AccessibilityExtAbility onConnect"); - } - - onDisconnect() { - console.info("[Demo] AccessibilityExtAbility onDisconnect"); - } - - onAccessibilityEvent(accessibilityEvent) { - console.info("[Demo] AccessibilityExtAbility onAccessibilityEvent: " + JSON.stringify(accessibilityEvent)); - } -} - -export default AccessibilityExtAbility; \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/Application/AbilityStage.ts b/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 071c0d862407f266470cd7488a13b6bd745ee8fa..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,7 +0,0 @@ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} diff --git a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/MainAbility/MainAbility.ts b/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index d12485060a8c43a2d05e7221d4c2893c70f64ac2..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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 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() { - // Ability is destroying, release resources for this ability - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate windowStage=" + windowStage) - //globalThis.windowStage = windowStage - //globalThis.abilityStorage = this.storage - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "MainAbility/pages/index/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") - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/MainAbility/pages/index/index.ets b/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/MainAbility/pages/index/index.ets deleted file mode 100644 index 04a0764afe12c378c1ea002ae58dfa6ed73290d1..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/MainAbility/pages/index/index.ets +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 { - @State message: string = 'request read permission for configuration'; - - aboutToAppear(){ - console.info("start run testcase!!!!"); - } - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/TestAbility/TestAbility.ts b/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/TestAbility/TestAbility.ts deleted file mode 100644 index 75889c25d1d74af950262f3fd26da4d1cc3e4aa1..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/TestAbility/TestAbility.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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' - -export default class TestAbility extends Ability { - onCreate(want, launchParam) { - console.log('TestAbility onCreate') - } - - 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') - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/TestAbility/pages/index.ets b/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/TestAbility/pages/index.ets deleted file mode 100644 index e29d33fb1f74914762edf3a6b3abc01b92299ad3..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/TestAbility/pages/index.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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%') - } - } \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 3e708867dfc5e6468c598957128791fa5328c99c..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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.accessibilityxts.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') - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/test/AccessibilityConfigReqReadPermission.test.ets b/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/test/AccessibilityConfigReqReadPermission.test.ets deleted file mode 100644 index c0ec7b98f0cd3c70753c089601d410c281dbc1af..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/test/AccessibilityConfigReqReadPermission.test.ets +++ /dev/null @@ -1,526 +0,0 @@ -/* - * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" -import config from '@ohos.accessibility.config' - -export default function abilityTest() { - describe('AccessibilityConfigReqReadPermissionTest', function () { - - beforeEach(async function (done) { - console.info(`AccessibilityConfigReqReadPermissionTest: beforeEach starts`); - done(); - }) - - afterEach(async function (done) { - console.info(`AccessibilityConfigReqReadPermissionTest: afterEach starts`); - setTimeout(done, 1000); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncCallback_0100 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncCallback_0100 - * @tc.desc Test highContrastText.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_0100', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_0100'); - config.highContrastText.set(true, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_0100 has error: ${err.code}`); - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_0100 has no write permission`); - expect(null).assertFail(); - } - }); - done(); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncPromise_0200 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncPromise_0200 - * @tc.desc Test highContrastText.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_0200', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_0200'); - config.highContrastText.set(false).then((result) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_0200 has no write permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_0200 has error: ${err.code}`); - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncCallback_0700 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncCallback_0700 - * @tc.desc Test invertColor.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_0700', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_0700'); - config.invertColor.set(true, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_0700 has error: ${err.code}`); - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_0700 has no write permission`); - expect(null).assertFail(); - } - }); - done(); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncPromise_0800 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncPromise_0800 - * @tc.desc Test invertColor.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_0800', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_0800'); - config.invertColor.set(false).then((result) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_0800 has no write permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_0800 has error: ${err.code}`); - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncCallback_1300 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncCallback_1300 - * @tc.desc Test contentTimeout.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_1300', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_1300'); - config.contentTimeout.set(0, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_1300 has error: ${err.code}`); - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_1300 has no write permission`); - expect(null).assertFail(); - } - }); - done(); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncPromise_1400 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncPromise_1400 - * @tc.desc Test contentTimeout.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_1400', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_1400'); - config.contentTimeout.set(5000).then((result) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_1400 has no write permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_1400 has error: ${err.code}`); - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncCallback_1900 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncCallback_1900 - * @tc.desc Test animationOff.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_1900', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_1900'); - config.animationOff.set(true, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_1900 has error: ${err.code}`); - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_1900 has no write permission`); - expect(null).assertFail(); - } - }); - done(); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncPromise_2000 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncPromise_2000 - * @tc.desc Test animationOff.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_2000', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_2000'); - config.animationOff.set(false).then((result) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_2000 has no write permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_2000 has error: ${err.code}`); - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncCallback_2500 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncCallback_2500 - * @tc.desc Test brightnessDiscount.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_2500', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_2500'); - config.brightnessDiscount.set(0.1, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_2500 has error: ${err.code}`); - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_2500 has no write permission`); - expect(null).assertFail(); - } - }); - done(); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncPromise_2600 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncPromise_2600 - * @tc.desc Test brightnessDiscount.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_2600', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_2600'); - config.brightnessDiscount.set(0.9).then((result) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_2600 has no write permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_2600 has error: ${err.code}`); - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncCallback_4900 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncCallback_4900 - * @tc.desc Test mouseKey.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_4900', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_4900'); - config.mouseKey.set(true, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_4900 has error: ${err.code}`); - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_4900 has no write permission`); - expect(null).assertFail(); - } - }); - done(); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncPromise_5000 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncPromise_5000 - * @tc.desc Test mouseKey.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_5000', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_5000'); - config.mouseKey.set(false).then((result) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_5000 has no write permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_5000 has error: ${err.code}`); - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncCallback_5500 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncCallback_5500 - * @tc.desc Test mouseAutoClick.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_5500', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_5500'); - config.mouseAutoClick.set(1, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_5500 has error: ${err.code}`); - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_5500 has no write permission`); - expect(null).assertFail(); - } - }); - done(); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncPromise_5600 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncPromise_5600 - * @tc.desc Test mouseAutoClick.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_5600', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_5600'); - config.mouseAutoClick.set(5000).then((result) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_5600 has no write permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_5600 has error: ${err.code}`); - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncCallback_6100 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncCallback_6100 - * @tc.desc Test shortkey.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_6100', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_6100'); - config.shortkey.set(true, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_6100 has error: ${err.code}`); - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_6100 has no write permission`); - expect(null).assertFail(); - } - }); - done(); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncPromise_6200 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncPromise_6200 - * @tc.desc Test shortkey.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_6200', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_6200'); - config.shortkey.set(false).then((result) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_6200 has no write permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_6200 has error: ${err.code}`); - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncCallback_6700 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncCallback_6700 - * @tc.desc Test shortkeyTarget.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_6700', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_6700'); - let value = 'teststr' - config.shortkeyTarget.set(value, (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_6700 has error: ${err.code}`); - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_6700 has no write permission`); - expect(null).assertFail(); - } - }); - done(); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncPromise_6800 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncPromise_6800 - * @tc.desc Test shortkeyTarget.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_6800', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_6800'); - let value = 'test' - config.shortkeyTarget.set(value).then((result) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_6800 has no write permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_6800 has error: ${err.code}`); - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncCallback_7900 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncCallback_7900 - * @tc.desc Test daltonizationColorFilter.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_7900', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_7900'); - config.daltonizationColorFilter.set('Normal', (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_7900 has error: ${err.code}`); - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_7900 has no write permission`); - expect(null).assertFail(); - } - }); - done(); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncCallback_8000 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncCallback_8000 - * @tc.desc Test daltonizationColorFilter.set() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_8000', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_8000'); - config.daltonizationColorFilter.set('Deuteranomaly', (err, result) => { - if (err && err.code != 0) { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_8000 has error: ${err.code}`); - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_8000 has no write permission`); - expect(null).assertFail(); - } - }); - done(); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncPromise_8100 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncPromise_8100 - * @tc.desc Test daltonizationColorFilter.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_8100', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_8100'); - config.daltonizationColorFilter.set('Protanomaly').then((result) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_8100 has no write permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_8100 has error: ${err.code}`); - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncPromise_8200 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncPromise_8200 - * @tc.desc Test daltonizationColorFilter.set() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_8200', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncPromise_8200'); - config.daltonizationColorFilter.set('Tritanomaly').then((result) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_8200 has no write permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncPromise_8200 has error: ${err.code}`); - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncCallback_8300 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncCallback_8300 - * @tc.desc Test enableAbility() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_8300', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_8300'); - let name = 'com.example.accessibilityconfigreqreadpermission/AccessibilityExtAbility'; - config.enableAbility(name, ['retrieve', 'touchGuide', 'keyEventObserver'], (err) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_8300 error: ${JSON.stringify(err)}`); - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqReadPermissionTest_set_asyncCallback_8400 - * @tc.name AccessibilityConfigReqReadPermissionTest_set_asyncCallback_8400 - * @tc.desc Test disableAbility() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_8400', 0, async function(done) { - console.info('AccessibilityConfigReqReadPermissionTest_set_asyncCallback_8400'); - let name = 'com.example.accessibilityconfigreqreadpermission/AccessibilityExtAbility'; - config.disableAbility(name, (err) => { - console.error(`AccessibilityConfigReqReadPermissionTest_set_asyncCallback_8400 err: ${JSON.stringify(err)}`); - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - expect(null).assertFail(); - } - done(); - }); - }) - }) -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/test/List.test.ets b/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 6b5047885bd4e364ca87d44927ee6cd5a66c36d3..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 './AccessibilityConfigReqReadPermission.test.ets' - -export default function testsuite() { - abilityTest() -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/module.json b/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/module.json deleted file mode 100644 index 708fbe4257e5159834a07aa47225a28a4ce8a540..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/module.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [{ - "name": "com.example.accessibilityxts.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [{ - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - }] - }], - "extensionAbilities": [ - { - "name": "AccessibilityExtAbility", - "srcEntrance": "./ets/AccessibilityExtAbility/AccessibilityExtAbility.ts", - "label": "$string:Accessibility_label", - "description": "$string:Accessibility_desc", - "type": "accessibility", - "metadata": [ - { - "name": "ohos.accessibleability", - "resource": "$profile:accessibility_config" - } - ], - "permissions": ["ohos.permission.GET_BUNDLE_INFO"] - }], - "requestPermissions": [{ - "name": "ohos.permission.READ_ACCESSIBILITY_CONFIG", - "reason": "need use ohos.permission.READ_ACCESSIBILITY_CONFIG" - } - ] - } -} diff --git a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/resources/base/element/string.json b/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 45a71c1e5142f79ebcef5bb613c1ca3b711c950f..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsAccessibilityConfigReqReadPermissionTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - }, - { - "name": "Accessibility_desc", - "value": "accessibility_description" - }, - { - "name": "Accessibility_label", - "value": "accessibility_label" - } - ] -} diff --git a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/resources/base/media/icon.png b/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/resources/base/profile/accessibility_config.json b/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/resources/base/profile/accessibility_config.json deleted file mode 100644 index 9ecc070afc00a6c0a5e4ba95a47e3e627fcc3fbe..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/resources/base/profile/accessibility_config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "accessibilityCapabilities": [ - "retrieve" - ], - "accessibilityCapabilityRationale": "a11y_rationale", - "settingsAbility": "com.accessibility.voiceaid.voiceAidSetting" -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/resources/base/profile/main_pages.json b/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index b26cd549a859adb13edff2f57b94be49566e5bb3..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqreadpermission/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index/index" - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqreadpermission/signature/openharmony_sx.p7b b/barrierfree/accessibilityconfigreqreadpermission/signature/openharmony_sx.p7b deleted file mode 100644 index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityconfigreqreadpermission/signature/openharmony_sx.p7b and /dev/null differ diff --git a/barrierfree/accessibilityconfigreqwritepermission/AppScope/app.json b/barrierfree/accessibilityconfigreqwritepermission/AppScope/app.json deleted file mode 100644 index ba716ccae636be40953ffdbcf4ffda4b903022f7..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqwritepermission/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.accessibilityconfigreqwritepermission", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon": "$media:icon", - "label": "$string:app_name", - "description": "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqwritepermission/AppScope/resources/base/element/string.json b/barrierfree/accessibilityconfigreqwritepermission/AppScope/resources/base/element/string.json deleted file mode 100644 index 2c46549041c0fbe208c580a5587b0dc9b5500dbd..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqwritepermission/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - }, - { - "name": "mainability_description", - "value": "ETS_Phone_Empty Stage Ability" - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqwritepermission/AppScope/resources/base/media/app_icon.png b/barrierfree/accessibilityconfigreqwritepermission/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityconfigreqwritepermission/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/barrierfree/accessibilityconfigreqwritepermission/BUILD.gn b/barrierfree/accessibilityconfigreqwritepermission/BUILD.gn deleted file mode 100755 index 3da81b62109e068f384d016b61eeb0b51a62dffb..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqwritepermission/BUILD.gn +++ /dev/null @@ -1,42 +0,0 @@ -# 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("ActsAccessibilityConfigReqWritePermissionTest") { - hap_profile = "entry/src/main/module.json" - deps = [ - ":accessibilityconfigreqwritepermission_js_assets", - ":accessibilityconfigreqwritepermission_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAccessibilityConfigReqWritePermissionTest" - part_name = "accessibility" - subsystem_name = "barrierfree" -} - -ohos_app_scope("accessibilityconfigreqwritepermission_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("accessibilityconfigreqwritepermission_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("accessibilityconfigreqwritepermission_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":accessibilityconfigreqwritepermission_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/barrierfree/accessibilityconfigreqwritepermission/Test.json b/barrierfree/accessibilityconfigreqwritepermission/Test.json deleted file mode 100644 index 0e0a03a1e52d3757559e99e99744b0d87b5bc43e..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqwritepermission/Test.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "240000", - "bundle-name": "com.example.accessibilityconfigreqwritepermission", - "module-name": "phone", - "shell-timeout": "600000", - "testcase-timeout": 70000 - }, - "kits": [ - { - "test-file-name": [ - "ActsAccessibilityConfigReqWritePermissionTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "power-shell wakeup", - "power-shell setmode 602", - "param set persist.ace.testmode.enabled 1" - ], - "teardown-command":[ - "bm uninstall -n com.example.accessibilityconfigreqwritepermission" - ] - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/Application/AbilityStage.ts b/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 071c0d862407f266470cd7488a13b6bd745ee8fa..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,7 +0,0 @@ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} diff --git a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/MainAbility/MainAbility.ts b/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index f9014b87a17cf7c30fb45d2f0455ac8e783a64f7..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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' - -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; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate windowStage=" + windowStage) - //globalThis.windowStage = windowStage - //globalThis.abilityStorage = this.storage - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "MainAbility/pages/index/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") - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/MainAbility/pages/index/index.ets b/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/MainAbility/pages/index/index.ets deleted file mode 100644 index 8da0a30ab3307f925e6c51d4a574d0f035a0980d..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/MainAbility/pages/index/index.ets +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 { - @State message: string = 'request write permission for configuration'; - - aboutToAppear(){ - console.info("start run testcase!!!!"); - } - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/TestAbility/TestAbility.ts b/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/TestAbility/TestAbility.ts deleted file mode 100644 index 78935adb89211ab492fb41a13635b475f5224b0b..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/TestAbility/TestAbility.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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.setUIContent(this.context, 'TestAbility/pages/index', null) - - globalThis.abilityContext = this.context; - } - - onWindowStageDestroy() { - console.log('TestAbility onWindowStageDestroy') - } - - onForeground() { - console.log('TestAbility onForeground') - } - - onBackground() { - console.log('TestAbility onBackground') - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/TestAbility/pages/index.ets b/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/TestAbility/pages/index.ets deleted file mode 100644 index e29d33fb1f74914762edf3a6b3abc01b92299ad3..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/TestAbility/pages/index.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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%') - } - } \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 8a7aa876957265ef4af010a245082752ac364887..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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' - ]) - 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 + '.TestAbility' - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - 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') - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/test/AccessibilityConfigReqWritePermission.test.ets b/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/test/AccessibilityConfigReqWritePermission.test.ets deleted file mode 100644 index b1c00bcefe9d3ae60f760efbcbdf43d607bc0c83..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/test/AccessibilityConfigReqWritePermission.test.ets +++ /dev/null @@ -1,720 +0,0 @@ -/* - * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" -import config from '@ohos.accessibility.config' - -export default function abilityTest() { - describe('AccessibilityConfigReqWritePermissionTest', function () { - - beforeEach(async function (done) { - console.info(`AccessibilityConfigReqWritePermissionTest: beforeEach starts`); - done(); - }) - - afterEach(async function (done) { - console.info(`AccessibilityConfigReqWritePermissionTest: afterEach starts`); - setTimeout(done, 1000); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_get_asyncCallback_0300 - * @tc.name AccessibilityConfigReqWritePermissionTest_get_asyncCallback_0300 - * @tc.desc Test highContrastText.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_get_asyncCallback_0300', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_get_asyncCallback_0300'); - config.highContrastText.get((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_get_asyncCallback_0300 has no read permission`); - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_get_asyncPromise_0400 - * @tc.name AccessibilityConfigReqWritePermissionTest_get_asyncPromise_0400 - * @tc.desc Test highContrastText.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_get_asyncPromise_0400', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_get_asyncPromise_0400'); - config.highContrastText.get().then((result) => { - console.error(`AccessibilityConfigReqWritePermissionTest_get_asyncPromise_0400 has no read permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_get_asyncCallback_0900 - * @tc.name AccessibilityConfigReqWritePermissionTest_get_asyncCallback_0900 - * @tc.desc Test invertColor.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_get_asyncCallback_0900', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_get_asyncCallback_0900'); - config.invertColor.get((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_get_asyncCallback_0900 has no read permission`); - expect(null).assertFail(); - } - }); - done(); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_get_asyncPromise_1000 - * @tc.name AccessibilityConfigReqWritePermissionTest_get_asyncPromise_1000 - * @tc.desc Test invertColor.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_get_asyncPromise_1000', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_get_asyncPromise_1000'); - config.invertColor.get().then((result) => { - console.error(`AccessibilityConfigReqWritePermissionTest_get_asyncPromise_1000 has no read permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_get_asyncCallback_1500 - * @tc.name AccessibilityConfigReqWritePermissionTest_get_asyncCallback_1500 - * @tc.desc Test contentTimeout.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_get_asyncCallback_1500', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_get_asyncCallback_1500'); - config.contentTimeout.get((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_get_asyncCallback_1500 has no read permission`); - expect(null).assertFail(); - } - }); - done(); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_get_asyncPromise_1600 - * @tc.name AccessibilityConfigReqWritePermissionTest_get_asyncPromise_1600 - * @tc.desc Test contentTimeout.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_get_asyncPromise_1600', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_get_asyncPromise_1600'); - config.contentTimeout.get().then((result) => { - console.error(`AccessibilityConfigReqWritePermissionTest_get_asyncPromise_1600 has no read permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_get_asyncCallback_2100 - * @tc.name AccessibilityConfigReqWritePermissionTest_get_asyncCallback_2100 - * @tc.desc Test animationOff.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_get_asyncCallback_2100', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_get_asyncCallback_2100'); - config.animationOff.get((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_get_asyncCallback_2100 has no read permission`); - expect(null).assertFail(); - } - }); - done(); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_get_asyncPromise_2200 - * @tc.name AccessibilityConfigReqWritePermissionTest_get_asyncPromise_2200 - * @tc.desc Test animationOff.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_get_asyncPromise_2200', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_get_asyncPromise_2200'); - config.animationOff.get().then((result) => { - console.error(`AccessibilityConfigReqWritePermissionTest_get_asyncPromise_2200 has no read permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_get_asyncCallback_2700 - * @tc.name AccessibilityConfigReqWritePermissionTest_get_asyncCallback_2700 - * @tc.desc Test brightnessDiscount.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_get_asyncCallback_2700', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_get_asyncCallback_2700'); - config.brightnessDiscount.get((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_get_asyncCallback_2700 has no read permission`); - expect(null).assertFail(); - } - }); - done(); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_get_asyncPromise_2800 - * @tc.name AccessibilityConfigReqWritePermissionTest_get_asyncPromise_2800 - * @tc.desc Test brightnessDiscount.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_get_asyncPromise_2800', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_get_asyncPromise_2800'); - config.brightnessDiscount.get().then((result) => { - console.error(`AccessibilityConfigReqWritePermissionTest_get_asyncPromise_2800 has no read permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_get_asyncCallback_5100 - * @tc.name AccessibilityConfigReqWritePermissionTest_get_asyncCallback_5100 - * @tc.desc Test mouseKey.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_get_asyncCallback_5100', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_get_asyncCallback_5100'); - config.mouseKey.get((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_get_asyncCallback_5100 has no read permission`); - expect(null).assertFail();} - }); - done(); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_get_asyncPromise_5200 - * @tc.name AccessibilityConfigReqWritePermissionTest_get_asyncPromise_5200 - * @tc.desc Test mouseKey.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_get_asyncPromise_5200', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_get_asyncPromise_5200'); - config.mouseKey.get().then((result) => { - console.error(`AccessibilityConfigReqWritePermissionTest_get_asyncPromise_5200 has no read permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_get_asyncCallback_5700 - * @tc.name AccessibilityConfigReqWritePermissionTest_get_asyncCallback_5700 - * @tc.desc Test mouseAutoClick.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_get_asyncCallback_5700', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_get_asyncCallback_5700'); - config.mouseAutoClick.get((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_get_asyncCallback_5700 has no read permission`); - expect(null).assertFail(); - } - }); - done(); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_get_asyncPromise_5800 - * @tc.name AccessibilityConfigReqWritePermissionTest_get_asyncPromise_5800 - * @tc.desc Test mouseAutoClick.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_get_asyncPromise_5800', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_get_asyncPromise_5800'); - config.mouseAutoClick.get().then((result) => { - console.error(`AccessibilityConfigReqWritePermissionTest_get_asyncPromise_5800 has no read permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_get_asyncCallback_6300 - * @tc.name AccessibilityConfigReqWritePermissionTest_get_asyncCallback_6300 - * @tc.desc Test shortkey.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_get_asyncCallback_6300', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_get_asyncCallback_6300'); - config.shortkey.get((err, result) => { - if (err && err.code != 0) { - eexpect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_get_asyncCallback_6300 has no read permission`); - expect(null).assertFail(); - } - }); - done(); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_get_asyncPromise_6400 - * @tc.name AccessibilityConfigReqWritePermissionTest_get_asyncPromise_6400 - * @tc.desc Test shortkey.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_get_asyncPromise_6400', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_get_asyncPromise_6400'); - config.shortkey.get().then((result) => { - console.error(`AccessibilityConfigReqWritePermissionTest_get_asyncPromise_6400 has no read permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_get_asyncCallback_6900 - * @tc.name AccessibilityConfigReqWritePermissionTest_get_asyncCallback_6900 - * @tc.desc Test shortkeyTarget.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_get_asyncCallback_6900', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_get_asyncCallback_6900'); - config.shortkeyTarget.get((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_get_asyncCallback_6900 has no read permission`); - expect(null).assertFail(); - } - }); - done(); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_get_asyncPromise_7000 - * @tc.name AccessibilityConfigReqWritePermissionTest_get_asyncPromise_7000 - * @tc.desc Test shortkeyTarget.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_get_asyncPromise_7000', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_get_asyncPromise_7000'); - config.shortkeyTarget.get().then((result) => { - console.error(`AccessibilityConfigReqWritePermissionTest_get_asyncPromise_7000 has no read permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_get_asyncCallback_8300 - * @tc.name AccessibilityConfigReqWritePermissionTest_get_asyncCallback_8300 - * @tc.desc Test daltonizationColorFilter.get() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_get_asyncCallback_8300', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_get_asyncCallback_8300'); - config.daltonizationColorFilter.get((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_get_asyncCallback_8300 has no read permission`); - expect(null).assertFail(); - } - }); - done(); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_get_asyncPromise_8400 - * @tc.name AccessibilityConfigReqWritePermissionTest_get_asyncPromise_8400 - * @tc.desc Test daltonizationColorFilter.get() function in promise mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_get_asyncPromise_8400', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_get_asyncPromise_8400'); - config.daltonizationColorFilter.get().then((result) => { - console.error(`AccessibilityConfigReqWritePermissionTest_get_asyncPromise_8400 has no read permission`); - expect(null).assertFail(); - done(); - }).catch((err) => { - expect(201).assertEqual(err.code); - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0100 - * @tc.name AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0100 - * @tc.desc Test highContrastText.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0100', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0100'); - config.highContrastText.on((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0100 has no read permission`); - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0200 - * @tc.name AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0200 - * @tc.desc Test invertColor.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0200', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0200'); - config.invertColor.on((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0200 has no read permission`); - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0300 - * @tc.name AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0300 - * @tc.desc Test daltonizationColorFilter.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0300', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0300'); - config.daltonizationColorFilter.on((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0300 has no read permission`); - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0400 - * @tc.name AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0400 - * @tc.desc Test contentTimeout.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0400', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0400'); - config.contentTimeout.on((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0400 has no read permission`); - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0500 - * @tc.name AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0500 - * @tc.desc Test animationOff.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0500', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0500'); - config.animationOff.on((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0500 has no read permission`); - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0600 - * @tc.name AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0600 - * @tc.desc Test brightnessDiscount.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0600', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0600'); - config.brightnessDiscount.on((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0600 has no read permission`); - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0700 - * @tc.name AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0700 - * @tc.desc Test screenMagnifier.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0700', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0700'); - config.screenMagnifier.on((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0700 has no read permission`); - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0800 - * @tc.name AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0800 - * @tc.desc Test audioMono.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0800', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0800'); - config.audioMono.on((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0800 has no read permission`); - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0900 - * @tc.name AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0900 - * @tc.desc Test audioBalance.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0900', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0900'); - config.audioBalance.on((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_on_asyncCallback_0900 has no read permission`); - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1000 - * @tc.name AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1000 - * @tc.desc Test mouseKey.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1000', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1000'); - config.mouseKey.on((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1000 has no read permission`); - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1100 - * @tc.name AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1100 - * @tc.desc Test mouseAutoClick.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1100', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1100'); - config.mouseAutoClick.on((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1100 has no read permission`); - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1200 - * @tc.name AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1200 - * @tc.desc Test shortkey.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1200', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1200'); - config.shortkey.on((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1200 has no read permission`); - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1300 - * @tc.name AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1300 - * @tc.desc Test shortkeyTarget.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1300', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1300'); - config.shortkeyTarget.on((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1300 has no read permission`); - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1400 - * @tc.name AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1400 - * @tc.desc Test captions.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1400', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1400'); - config.captions.on((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1400 has no read permission`); - expect(null).assertFail(); - } - done(); - }); - }) - - /* - * @tc.number AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1500 - * @tc.name AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1500 - * @tc.desc Test captionsStyle.on() function in callback mode. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1500', 0, async function(done) { - console.info('AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1500'); - config.captionsStyle.on((err, result) => { - if (err && err.code != 0) { - expect(201).assertEqual(err.code); - } else { - console.error(`AccessibilityConfigReqWritePermissionTest_on_asyncCallback_1500 has no read permission`); - expect(null).assertFail(); - } - done(); - }); - }) - }) -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/test/List.test.ets b/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 969213e45501dd65068b0b4e4231e5abc7e91b97..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 './AccessibilityConfigReqWritePermission.test.ets' - -export default function testsuite() { - abilityTest() -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/module.json b/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/module.json deleted file mode 100644 index 1262c281d7f95d00f50d1dcb89617f0a4df05ed8..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/module.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [{ - "name": "TestAbility", - "srcEntrance": "./ets/TestAbility/TestAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [{ - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - }] - }], - - "requestPermissions": [{ - "name": "ohos.permission.WRITE_ACCESSIBILITY_CONFIG", - "reason": "need use ohos.permission.WRITE_ACCESSIBILITY_CONFIG" - } - ] - } -} diff --git a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/resources/base/element/string.json b/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 2c6b10a3d2830f07880af1a74c78b2d3c4945a11..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsAccessibilityConfigReqWritePermissionTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - }, - { - "name": "Accessibility_desc", - "value": "accessibility_description" - }, - { - "name": "Accessibility_label", - "value": "accessibility_label" - } - ] -} diff --git a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/resources/base/media/icon.png b/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/resources/base/profile/main_pages.json b/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 43f5bb10ddb7e3fc4aa0b71a76818b8b48cc5bc2..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityconfigreqwritepermission/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "TestAbility/pages/index" - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityconfigreqwritepermission/signature/openharmony_sx.p7b b/barrierfree/accessibilityconfigreqwritepermission/signature/openharmony_sx.p7b deleted file mode 100644 index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityconfigreqwritepermission/signature/openharmony_sx.p7b and /dev/null differ diff --git a/barrierfree/accessibilityelement/AppScope/app.json b/barrierfree/accessibilityelement/AppScope/app.json deleted file mode 100644 index c33bd144214a92fbfc9b4730f82a770cbc7b5107..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityelement/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.accessibilityxts", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon": "$media:icon", - "label": "$string:app_name", - "description": "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityelement/AppScope/resources/base/element/string.json b/barrierfree/accessibilityelement/AppScope/resources/base/element/string.json deleted file mode 100644 index 2bce00fe92ed1792896bfc5aa9f0411e2ce5fea9..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityelement/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - }, - { - "name": "mainability_description", - "value": "ETS_Phone_Empty Stage Ability" - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityelement/AppScope/resources/base/media/app_icon.png b/barrierfree/accessibilityelement/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityelement/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/barrierfree/accessibilityelement/BUILD.gn b/barrierfree/accessibilityelement/BUILD.gn deleted file mode 100644 index b1fee5b7f4da21c08fcfbb114951cc6ae5e26cd7..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityelement/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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("ActsAccessibilityElementTest") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":accessibilityelement_js_assets", - ":accessibilityelement_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAccessibilityElementTest" - part_name = "accessibility" - subsystem_name = "barrierfree" -} - -ohos_app_scope("accessibilityelement_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("accessibilityelement_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("accessibilityelement_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":accessibilityelement_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/barrierfree/accessibilityelement/Test.json b/barrierfree/accessibilityelement/Test.json deleted file mode 100644 index d697f3a171d479dae62afa24d1fad2aef4ec9f41..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityelement/Test.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "600000", - "bundle-name": "com.example.accessibilityxts", - "module-name": "phone", - "shell-timeout": "600000", - "testcase-timeout": 70000 - }, - "kits": [ - { - "test-file-name": [ - "ActsAccessibilityElementTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "power-shell wakeup", - "power-shell setmode 602", - "param set persist.ace.testmode.enabled 1" - ] - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityelement/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts b/barrierfree/accessibilityelement/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts deleted file mode 100644 index 8a4f68d3727a8fc9f85644ed6ddb8daa2d2fe2d9..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityelement/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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 AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtensionAbility'; -import commonEvent from '@ohos.commonEvent'; -import {ElementTest} from './ElementTest'; - -class AccessibilityExtAbility extends AccessibilityExtensionAbility { - tester: any = undefined; - - onConnect() { - console.info("[Demo] AccessibilityExtAbility onConnect"); - this.tester = new ElementTest(this.context); - this.tester.init(); - - let commonEventPublishData = { - data: 'connect' - } - commonEvent.publish('onConnectState', commonEventPublishData, publishCallback); - - function publishCallback(err) { - console.info("onConnect====>onConnect publish call back result:" + JSON.stringify(err)); - } - } - - onDisconnect() { - console.info("[Demo] AccessibilityExtAbility onDisconnect"); - let commonEventPublishData = { - data: 'disconnect' - } - commonEvent.publish('onConnectState', commonEventPublishData, publishCallback); - - function publishCallback(err) { - console.info("onDisconnect====>onConnect publish call back result:" + JSON.stringify(err)); - } - - this.tester.clear(); - this.tester = undefined; - } - - onAccessibilityEvent(accessibilityEvent) { - console.info("[Demo] AccessibilityExtAbility onAccessibilityEvent: " + JSON.stringify(accessibilityEvent)); - if (this.tester) { - this.tester.pushEvent(accessibilityEvent); - } - } -} - -export default AccessibilityExtAbility; \ No newline at end of file diff --git a/barrierfree/accessibilityelement/entry/src/main/ets/AccessibilityExtAbility/ElementTest.ts b/barrierfree/accessibilityelement/entry/src/main/ets/AccessibilityExtAbility/ElementTest.ts deleted file mode 100644 index 6d7718634d95fefd48c1aa3d4c03a56d5ba31b54..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityelement/entry/src/main/ets/AccessibilityExtAbility/ElementTest.ts +++ /dev/null @@ -1,1133 +0,0 @@ -/* - * 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 commonEvent from '@ohos.commonEvent'; -import accessibility from '@ohos.accessibility'; - -const invalidString = 'xxx'; -const invalidValue = 1; - -export class ElementTest { - private context = undefined; - private subScriber = undefined; - private events: Array = []; - - constructor(context) { - this.context = context; - } - - async init() { - this.subScriber = await commonEvent.createSubscriber({events: ['caseExecute']}); - commonEvent.subscribe(this.subScriber, (err, data) => { - console.info('ElementTest subscribe callback data:' + JSON.stringify(data)); - this.processCase(data); - }); - } - - clear() { - commonEvent.unsubscribe(this.subScriber); - this.subScriber = undefined; - this.context = undefined; - this.events.length = 0; - } - - pushEvent(event) { - this.events.push(event); - } - - private publishCaseResult(caseName: string, result: boolean) { - let commonEventPublishData = { - data: (result ? 'pass' : 'fail'), - parameters: { - case: caseName - } - } - commonEvent.publish('caseResult', commonEventPublishData, (err) => { - console.info("ElementTest publishCaseResult finish: " + JSON.stringify(commonEventPublishData)); - }); - } - - private async processCase(data) { - let caseName = data.data; - console.info('ElementTest processCase: ' + caseName); - this.events.length = 0; - let result = false; - switch (caseName) { - case 'AccessibilityElementTest_attributeNames_asyncPromise_0100': - result = await this.executeAttributeNamesPromise(caseName); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_0200': - result = await this.executeAttributeValuePromise(caseName, 'componentId', 'number'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_0300': - result = await this.executeAttributeValuePromise(caseName, 'pageId', 'number'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_0500': - result = await this.executeAttributeValuePromise(caseName, 'inspectorKey', 'string'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_0600': - result = await this.executeAttributeValuePromise(caseName, 'bundleName', 'string'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_0700': - result = await this.executeAttributeValuePromise(caseName, 'componentType', 'string'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_0800': - result = await this.executeAttributeValuePromise(caseName, 'inputType', 'number'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_0900': - result = await this.executeAttributeValuePromise(caseName, 'text', 'string'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_1000': - result = await this.executeAttributeValuePromise(caseName, 'hintText', 'string'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_1100': - result = await this.executeAttributeValuePromise(caseName, 'description', 'string'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_1200': - result = await this.executeAttributeValuePromise(caseName, 'resourceName', 'string'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_1400': - result = await this.executeAttributeValuePromise(caseName, 'textLengthLimit', 'number'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_1500': - result = await this.executeAttributeValuePromiseRect(caseName, 'rect'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_1600': - result = await this.executeAttributeValuePromise(caseName, 'checkable', 'boolean'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_1700': - result = await this.executeAttributeValuePromise(caseName, 'checked', 'boolean'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_1800': - result = await this.executeAttributeValuePromise(caseName, 'focusable', 'boolean'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_1900': - result = await this.executeAttributeValuePromise(caseName, 'isVisible', 'boolean'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_2000': - result = await this.executeAttributeValuePromise(caseName, 'accessibilityFocused', 'boolean'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_2100': - result = await this.executeAttributeValuePromise(caseName, 'selected', 'boolean'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_2200': - result = await this.executeAttributeValuePromise(caseName, 'clickable', 'boolean'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_2300': - result = await this.executeAttributeValuePromise(caseName, 'longClickable', 'boolean'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_2400': - result = await this.executeAttributeValuePromise(caseName, 'isEnable', 'boolean'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_2500': - result = await this.executeAttributeValuePromise(caseName, 'isPassword', 'boolean'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_2600': - result = await this.executeAttributeValuePromise(caseName, 'scrollable', 'boolean'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_2700': - result = await this.executeAttributeValuePromise(caseName, 'editable', 'boolean'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_2900': - result = await this.executeAttributeValuePromise(caseName, 'pluralLineSupported', 'boolean'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_3100': - result = await this.executeAttributeValuePromise(caseName, 'isHint', 'boolean'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_3300': - result = await this.executeAttributeValuePromise(caseName, 'itemCount', 'number'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_3400': - result = await this.executeAttributeValuePromise(caseName, 'currentIndex', 'number'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_3500': - result = await this.executeAttributeValuePromise(caseName, 'startIndex', 'number'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_3600': - result = await this.executeAttributeValuePromise(caseName, 'endIndex', 'number'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_3700': - result = await this.executeAttributeValuePromise(caseName, 'valueMax', 'number'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_3800': - result = await this.executeAttributeValuePromise(caseName, 'valueMin', 'number'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_3900': - result = await this.executeAttributeValuePromise(caseName, 'valueNow', 'number'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_4200': - result = await this.executeAttributeValuePromise(caseName, 'error', 'string'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_4300': - await this.executeAttributeValuePromiseTriggerAction(caseName); - return; - case 'AccessibilityElementTest_attributeValue_asyncPromise_4400': - result = await this.executeAttributeValuePromise(caseName, 'textMoveUnit', 'string'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_4500': - result = await this.executeAttributeValuePromiseArray(caseName, 'contents', 'string'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_4600': - result = await this.executeAttributeValuePromise(caseName, 'lastContent', 'string'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_4700': - result = await this.executeAttributeValuePromise(caseName, 'parent', 'object'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_4800': - result = await this.executeAttributeValuePromiseArray(caseName, 'children', 'object'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_5200': - result = await this.executeAttributeValuePromise(caseName, 'isActive', 'boolean', true); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_5300': - result = await this.executeAttributeValuePromiseRect(caseName, 'screenRect', true); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_5400': - result = await this.executeAttributeValuePromise(caseName, 'layer', 'number', true); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_5500': - result = await this.executeAttributeValuePromise(caseName, 'type', 'string', true); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_5600': - result = await this.executeAttributeValuePromiseRootElement(caseName); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_5700': - result = await this.executeAttributeValuePromise(caseName, 'windowId', 'number'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_5800': - result = await this.executeAttributeValuePromise(caseName, 'isFocused', 'boolean'); - break; - case 'AccessibilityElementTest_findElement_asyncPromise_5900': - result = await this.executeFindElementPromise5900(caseName); - break; - case 'AccessibilityElementTest_actionNames_asyncPromise_6000': - result = await this.executeActionNamesPromise(caseName); - break; - case 'AccessibilityElementTest_performAction_asyncPromise_6100': - result = await this.executePerformActionPromise(caseName, 'accessibilityFocus'); - break; - case 'AccessibilityElementTest_performAction_asyncPromise_6200': - result = await this.executePerformActionPromise(caseName, 'clearAccessibilityFocus'); - break; - case 'AccessibilityElementTest_performAction_asyncPromise_6300': - result = await this.executePerformActionPromise(caseName, 'focus'); - break; - case 'AccessibilityElementTest_performAction_asyncPromise_6400': - result = await this.executePerformActionPromise(caseName, 'clearFocus'); - break; - case 'AccessibilityElementTest_performAction_asyncPromise_6500': - result = await this.executePerformActionPromise(caseName, 'clearSelection'); - break; - case 'AccessibilityElementTest_performAction_asyncPromise_6600': - result = await this.executePerformActionPromise(caseName, 'click'); - break; - case 'AccessibilityElementTest_performAction_asyncPromise_6700': - result = await this.executePerformActionPromise(caseName, 'longClick'); - break; - case 'AccessibilityElementTest_performAction_asyncPromise_6800': - result = await this.executePerformActionPromise(caseName, 'cut'); - break; - case 'AccessibilityElementTest_performAction_asyncPromise_6900': - result = await this.executePerformActionPromise(caseName, 'copy'); - break; - case 'AccessibilityElementTest_performAction_asyncPromise_7000': - result = await this.executePerformActionPromise(caseName, 'paste'); - break; - case 'AccessibilityElementTest_performAction_asyncPromise_7100': - result = await this.executePerformActionPromise(caseName, 'select'); - break; - case 'AccessibilityElementTest_performAction_asyncPromise_7200': - result = await this.executePerformActionPromise(caseName, 'setText'); - break; - case 'AccessibilityElementTest_performAction_asyncPromise_7300': - result = await this.executePerformActionPromise(caseName, 'delete'); - break; - case 'AccessibilityElementTest_performAction_asyncPromise_7400': - result = await this.executePerformActionPromise(caseName, 'scrollForward'); - break; - case 'AccessibilityElementTest_performAction_asyncPromise_7500': - result = await this.executePerformActionPromise(caseName, 'scrollBackward'); - break; - case 'AccessibilityElementTest_performAction_asyncPromise_7600': - result = await this.executePerformActionPromise(caseName, 'setSelection'); - break; - case 'AccessibilityElementTest_findElement_asyncPromise_7700': - result = await this.executeFindElementPromiseByContent(caseName, 'xxx'); - break; - case 'AccessibilityElementTest_findElement_asyncPromise_7800': - result = await this.executeFindElementPromiseByContent(caseName, 'button1'); - break; - case 'AccessibilityElementTest_findElement_asyncPromise_7900': - result = await this.executeFindElementPromiseByFocusType(caseName, 'accessibility'); - break; - case 'AccessibilityElementTest_findElement_asyncPromise_8000': - result = await this.executeFindElementPromiseByFocusType(caseName, 'normal'); - break; - case 'AccessibilityElementTest_findElement_asyncPromise_8100': - result = await this.executeFindElementPromiseByFocusDirection(caseName, 'up'); - break; - case 'AccessibilityElementTest_findElement_asyncPromise_8200': - result = await this.executeFindElementPromiseByFocusDirection(caseName, 'down'); - break; - case 'AccessibilityElementTest_findElement_asyncPromise_8300': - result = await this.executeFindElementPromiseByFocusDirection(caseName, 'left'); - break; - case 'AccessibilityElementTest_findElement_asyncPromise_8400': - result = await this.executeFindElementPromiseByFocusDirection(caseName, 'right'); - break; - case 'AccessibilityElementTest_findElement_asyncPromise_8500': - result = await this.executeFindElementPromiseByFocusDirection(caseName, 'forward'); - break; - case 'AccessibilityElementTest_findElement_asyncPromise_8600': - result = await this.executeFindElementPromiseByFocusDirection(caseName, 'backward'); - break; - case 'AccessibilityElementTest_findElement_asyncPromise_8700': - result = await this.executeFindElementPromiseByFocusType(caseName, 'xxx'); - break; - case 'AccessibilityElementTest_findElement_asyncPromise_8800': - result = await this.executeFindElementPromiseByFocusDirection(caseName, 'xxx'); - break; - case 'AccessibilityElementTest_performAction_asyncPromise_8900': - result = await this.executePerformActionPromise(caseName, 'xxx'); - break; - case 'AccessibilityElementTest_attributeValue_asyncPromise_9000': - result = await this.executeAttributeValuePromise(caseName, 'xxx', ''); - break; - case 'AccessibilityElementTest_attributeNames_asyncCallback_0100': - await this.executeAttributeNamesCallback(caseName); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_0200': - await this.executeAttributeValueCallback(caseName, 'componentId', 'number'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_0300': - await this.executeAttributeValueCallback(caseName, 'pageId', 'number'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_0500': - await this.executeAttributeValueCallback(caseName, 'inspectorKey', 'string'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_0600': - await this.executeAttributeValueCallback(caseName, 'bundleName', 'string'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_0700': - await this.executeAttributeValueCallback(caseName, 'componentType', 'string'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_0800': - await this.executeAttributeValueCallback(caseName, 'inputType', 'number'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_0900': - await this.executeAttributeValueCallback(caseName, 'text', 'string'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_1000': - await this.executeAttributeValueCallback(caseName, 'hintText', 'string'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_1100': - await this.executeAttributeValueCallback(caseName, 'description', 'string'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_1200': - await this.executeAttributeValueCallback(caseName, 'resourceName', 'string'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_1400': - await this.executeAttributeValueCallback(caseName, 'textLengthLimit', 'number'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_1500': - await this.executeAttributeValueCallbackRect(caseName, 'rect'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_1600': - await this.executeAttributeValueCallback(caseName, 'checkable', 'boolean'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_1700': - await this.executeAttributeValueCallback(caseName, 'checked', 'boolean'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_1800': - await this.executeAttributeValueCallback(caseName, 'focusable', 'boolean'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_1900': - await this.executeAttributeValueCallback(caseName, 'isVisible', 'boolean'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_2000': - await this.executeAttributeValueCallback(caseName, 'accessibilityFocused', 'boolean'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_2100': - await this.executeAttributeValueCallback(caseName, 'selected', 'boolean'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_2200': - await this.executeAttributeValueCallback(caseName, 'clickable', 'boolean'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_2300': - await this.executeAttributeValueCallback(caseName, 'longClickable', 'boolean'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_2400': - await this.executeAttributeValueCallback(caseName, 'isEnable', 'boolean'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_2500': - await this.executeAttributeValueCallback(caseName, 'isPassword', 'boolean'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_2600': - await this.executeAttributeValueCallback(caseName, 'scrollable', 'boolean'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_2700': - await this.executeAttributeValueCallback(caseName, 'editable', 'boolean'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_2900': - await this.executeAttributeValueCallback(caseName, 'pluralLineSupported', 'boolean'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_3100': - await this.executeAttributeValueCallback(caseName, 'isHint', 'boolean'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_3300': - await this.executeAttributeValueCallback(caseName, 'itemCount', 'number'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_3400': - await this.executeAttributeValueCallback(caseName, 'currentIndex', 'number'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_3500': - await this.executeAttributeValueCallback(caseName, 'startIndex', 'number'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_3600': - await this.executeAttributeValueCallback(caseName, 'endIndex', 'number'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_3700': - await this.executeAttributeValueCallback(caseName, 'valueMax', 'number'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_3800': - await this.executeAttributeValueCallback(caseName, 'valueMin', 'number'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_3900': - await this.executeAttributeValueCallback(caseName, 'valueNow', 'number'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_4200': - await this.executeAttributeValueCallback(caseName, 'error', 'string'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_4300': - await this.executeAttributeValueCallbackTriggerAction(caseName); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_4400': - await this.executeAttributeValueCallback(caseName, 'textMoveUnit', 'string'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_4500': - await this.executeAttributeValueCallbackArray(caseName, 'contents', 'string'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_4600': - await this.executeAttributeValueCallback(caseName, 'lastContent', 'string'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_4700': - await this.executeAttributeValueCallback(caseName, 'parent', 'object'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_4800': - await this.executeAttributeValueCallbackArray(caseName, 'children', 'object'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_5200': - await this.executeAttributeValueCallback(caseName, 'isActive', 'boolean', true); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_5300': - await this.executeAttributeValueCallbackRect(caseName, 'screenRect', true); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_5400': - await this.executeAttributeValueCallback(caseName, 'layer', 'number', true); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_5500': - await this.executeAttributeValueCallback(caseName, 'type', 'string', true); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_5600': - await this.executeAttributeValueCallbackRootElement(caseName); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_5700': - await this.executeAttributeValueCallback(caseName, 'windowId', 'number'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_5800': - await this.executeAttributeValueCallback(caseName, 'isFocused', 'boolean'); - return; - case 'AccessibilityElementTest_findElement_asyncCallback_5900': - await this.executeFindElementCallback5900(caseName); - return; - case 'AccessibilityElementTest_actionNames_asyncCallback_6000': - await this.executeActionNamesCallback(caseName); - return; - case 'AccessibilityElementTest_performAction_asyncCallback_6100': - await this.executePerformActionCallback(caseName, 'accessibilityFocus'); - return; - case 'AccessibilityElementTest_performAction_asyncCallback_6200': - await this.executePerformActionCallback(caseName, 'clearAccessibilityFocus'); - return; - case 'AccessibilityElementTest_performAction_asyncCallback_6300': - await this.executePerformActionCallback(caseName, 'focus'); - return; - case 'AccessibilityElementTest_performAction_asyncCallback_6400': - await this.executePerformActionCallback(caseName, 'clearFocus'); - return; - case 'AccessibilityElementTest_performAction_asyncCallback_6500': - await this.executePerformActionCallback(caseName, 'clearSelection'); - return; - case 'AccessibilityElementTest_performAction_asyncCallback_6600': - await this.executePerformActionCallback(caseName, 'click'); - return; - case 'AccessibilityElementTest_performAction_asyncCallback_6700': - await this.executePerformActionCallback(caseName, 'longClick'); - return; - case 'AccessibilityElementTest_performAction_asyncCallback_6800': - await this.executePerformActionCallback(caseName, 'cut'); - return; - case 'AccessibilityElementTest_performAction_asyncCallback_6900': - await this.executePerformActionCallback(caseName, 'copy'); - return; - case 'AccessibilityElementTest_performAction_asyncCallback_7000': - await this.executePerformActionCallback(caseName, 'paste'); - return; - case 'AccessibilityElementTest_performAction_asyncCallback_7100': - await this.executePerformActionCallback(caseName, 'select'); - return; - case 'AccessibilityElementTest_performAction_asyncCallback_7200': - await this.executePerformActionCallback(caseName, 'setText'); - return; - case 'AccessibilityElementTest_performAction_asyncCallback_7300': - await this.executePerformActionCallback(caseName, 'delete'); - return; - case 'AccessibilityElementTest_performAction_asyncCallback_7400': - await this.executePerformActionCallback(caseName, 'scrollForward'); - return; - case 'AccessibilityElementTest_performAction_asyncCallback_7500': - await this.executePerformActionCallback(caseName, 'scrollBackward'); - return; - case 'AccessibilityElementTest_performAction_asyncCallback_7600': - await this.executePerformActionCallback(caseName, 'setSelection'); - return; - case 'AccessibilityElementTest_findElement_asyncCallback_7700': - await this.executeFindElementCallbackByContent(caseName, 'xxx'); - return; - case 'AccessibilityElementTest_findElement_asyncCallback_7800': - await this.executeFindElementCallbackByContent(caseName, 'button1'); - return; - case 'AccessibilityElementTest_findElement_asyncCallback_7900': - await this.executeFindElementCallbackByFocusType(caseName, 'accessibility'); - return; - case 'AccessibilityElementTest_findElement_asyncCallback_8000': - await this.executeFindElementCallbackByFocusType(caseName, 'normal'); - return; - case 'AccessibilityElementTest_findElement_asyncCallback_8100': - await this.executeFindElementCallbackByFocusDirection(caseName, 'up'); - return; - case 'AccessibilityElementTest_findElement_asyncCallback_8200': - await this.executeFindElementCallbackByFocusDirection(caseName, 'down'); - return; - case 'AccessibilityElementTest_findElement_asyncCallback_8300': - await this.executeFindElementCallbackByFocusDirection(caseName, 'left'); - return; - case 'AccessibilityElementTest_findElement_asyncCallback_8400': - await this.executeFindElementCallbackByFocusDirection(caseName, 'right'); - return; - case 'AccessibilityElementTest_findElement_asyncCallback_8500': - await this.executeFindElementCallbackByFocusDirection(caseName, 'forward'); - return; - case 'AccessibilityElementTest_findElement_asyncCallback_8600': - await this.executeFindElementCallbackByFocusDirection(caseName, 'backward'); - return; - case 'AccessibilityElementTest_findElement_asyncCallback_8700': - await this.executeFindElementCallbackByFocusType(caseName, 'xxx'); - return; - case 'AccessibilityElementTest_findElement_asyncCallback_8800': - await this.executeFindElementCallbackByFocusDirection(caseName, 'xxx'); - return; - case 'AccessibilityElementTest_performAction_asyncCallback_8900': - await this.executePerformActionCallback(caseName, 'xxx'); - return; - case 'AccessibilityElementTest_attributeValue_asyncCallback_9000': - await this.executeAttributeValueCallback(caseName, 'xxx', ''); - return; - default: - console.warn('ElementTest processCase unknown!!!!!!!!!!'); - break; - } - this.publishCaseResult(caseName, result); - } - - private async getBaseElement() { - let element = undefined; - if (this.context) { - let root = await this.context.getWindowRootElement(); - let elements = await root.findElement('content', 'button1'); - element = elements[0]; - } - return element; - } - - private async getWindowElement() { - let element = undefined; - if (this.context) { - let elements = await this.context.getWindows(); - element = elements[0]; - } - return element; - } - - private async executeAttributeNamesPromise(caseName: string): Promise { - let result = false; - let element = await this.getBaseElement(); - if (element) { - let names = await element.attributeNames(); - console.info('ElementTest executeAttributeNamesPromise ' + caseName + ' names: ' + JSON.stringify(names)); - if (Array.isArray(names)) { - result = true; - } - } - return result; - } - - private async executeAttributeValuePromise(caseName: string, input: string, outputType: string, - isWindow: boolean = false): Promise { - let element = undefined; - if (isWindow) { - element = await this.getWindowElement(); - } else { - element = await this.getBaseElement(); - } - - let result = false; - if (element) { - try { - console.info('ElementTest executeAttributeValuePromise ' + caseName + ' input: ' + input + ', outputType: ' + outputType); - let value = await element.attributeValue(input); - console.info('ElementTest executeAttributeValuePromise ' + caseName + ' value: ' + JSON.stringify(value)); - if (typeof(value) == outputType) { - result = true; - } else { - console.warn('ElementTest executeAttributeValuePromise ' + caseName + ' valueType: ' + typeof(value)); - } - } catch (e) { - console.info('ElementTest executeAttributeValuePromise ' + caseName + ' catch(e): ' + JSON.stringify(e)); - if (input == invalidString && e && e.code != 0) { - result = true; - } - } - } - return result; - } - - private async executeAttributeValuePromiseRect(caseName: string, input: string, isWindow: boolean = false): Promise { - let element = undefined; - if (isWindow) { - element = await this.getWindowElement(); - } else { - element = await this.getBaseElement(); - } - - let result = false; - if (element) { - try { - console.info('ElementTest executeAttributeValuePromiseRect ' + caseName); - let value = await element.attributeValue(input); - console.info('ElementTest executeAttributeValuePromiseRect ' + caseName + ' value: ' + JSON.stringify(value)); - if (typeof(value) == 'object' && typeof(value.left) == 'number' && typeof(value.top) == 'number' - && typeof(value.width) == 'number' && typeof(value.height) == 'number') { - result = true; - } else { - console.warn('ElementTest executeAttributeValuePromiseRect ' + caseName + ' valueType: ' + typeof(value)); - } - } catch (e) { - console.info('ElementTest executeAttributeValuePromiseRect ' + caseName + ' catch(e): ' + JSON.stringify(e)); - } - } - return result; - } - - private async executeAttributeValuePromiseTriggerAction(caseName: string) { - console.info('ElementTest executeAttributeValuePromiseTriggerAction ' + caseName + ' start'); - let event = new accessibility.EventInfo({}); - event.type = 'click'; - event.bundleName = 'com.example.accessibilityxts'; - event.triggerAction = 'click'; - await accessibility.sendEvent(event); - console.info('ElementTest executeAttributeValuePromiseTriggerAction ' + caseName + ' sendEvent finish'); - - setTimeout(async () => { - let result = false; - console.info('ElementTest executeAttributeValuePromiseTriggerAction ' + caseName + ' events.length: ' + this.events.length); - for (let e of this.events) { - let target = e.target; - let value = await target.attributeValue('triggerAction'); - console.info('ElementTest executeAttributeValuePromiseTriggerAction ' + caseName + ' valueType: ' + typeof(value)); - if (e.eventType == 'click' && typeof(value) == 'string') { - result = true; - break; - } - } - this.publishCaseResult(caseName, result); - }, 1000); - } - - private async executeAttributeValuePromiseRootElement(caseName: string): Promise { - let element = undefined; - if (this.context) { - let base = await this.getBaseElement(); - if (base) { - let baseWindowId = await base.attributeValue('windowId'); - let windows = await this.context.getWindows(); - for (let window of windows) { - let windowId = await window.attributeValue('windowId'); - if (baseWindowId == windowId) { - element = window; - console.info('ElementTest executeAttributeValuePromiseRootElement ' + caseName + ' found window'); - break; - } - } - } - } - - let result = false; - if (element) { - console.info('ElementTest executeAttributeValuePromiseRootElement ' + caseName + ' input: rootElement, outputType: object'); - let value = await element.attributeValue('rootElement'); - console.info('ElementTest executeAttributeValuePromise ' + caseName + ' value: ' + JSON.stringify(value)); - if (typeof(value) == 'object') { - result = true; - } else { - console.warn('ElementTest executeAttributeValuePromise ' + caseName + ' valueType: ' + typeof(value)); - } - } - return result; - } - - private async executeAttributeValuePromiseArray(caseName: string, input: string, outputType: string): Promise { - let result = false; - let element = await this.getBaseElement(); - if (element) { - console.info('ElementTest executeAttributeValuePromiseArray ' + caseName + ' input: ' + input + ', outputType: ' + outputType); - let value = await element.attributeValue(input); - console.info('ElementTest executeAttributeValuePromiseArray ' + caseName + ' value: ' + JSON.stringify(value)); - if (Array.isArray(value)) { - if ((value.length == 0)|| - (value.length > 0 && typeof(value[0]) == outputType)) { - result = true; - } - } - } - return result; - } - - private async executeActionNamesPromise(caseName: string): Promise { - let result = false; - let element = await this.getBaseElement(); - if (element) { - let actions = await element.actionNames(); - console.info('ElementTest executeActionNamesPromise ' + caseName + ' actions: ' + JSON.stringify(actions)); - if (Array.isArray(actions)) { - if ((actions.length == 0) || - (actions.length > 0 && typeof(actions[0]) == 'string')) { - result = true; - } - } - } - return result; - } - - private async executePerformActionPromise(caseName: string, action: string, args?: object): Promise { - let result = false; - let element = await this.getBaseElement(); - if (element) { - try { - console.info('ElementTest executePerformActionPromise ' + caseName + ' action: ' + action + ', args: ' + JSON.stringify(args)); - let ret = await element.performAction(action, args); - console.info('ElementTest executePerformActionPromise ' + caseName + ' ret: ' + JSON.stringify(ret)); - if (typeof(ret) == 'undefined') { - result = true; - } - } catch (e) { - console.info('ElementTest executePerformActionPromise ' + caseName + ' catch(e): ' + JSON.stringify(e)); - if (e && e.code != 0) { - if (e.code == 9300005 || e.code == 9300000) { - result = true; - } - result = true; - } - } - } - return result; - } - - private async executeFindElementPromiseByContent(caseName: string, condition: string): Promise { - let result = false; - let element = await this.getBaseElement(); - if (element) { - try { - console.info('ElementTest executeFindElementPromiseByContent ' + caseName + ' condition: ' + condition); - let found = await element.findElement('content', condition); - console.info('ElementTest executeFindElementPromiseByContent ' + caseName + ' element: ' + JSON.stringify(found)); - if (Array.isArray(found)) { - if (found.length == 0 || typeof(found[0]) == 'object') { - result = true; - } - } - } catch (e) { - console.info('ElementTest executeFindElementPromiseByContent ' + caseName + ' catch(e): ' + JSON.stringify(e)); - if (condition == invalidString) { - result = true; - } - } - } - return result; - } - - private async executeFindElementPromiseByFocusType(caseName: string, condition: string): Promise { - let result = false; - let element = await this.getBaseElement(); - if (element) { - try { - console.info('ElementTest executeFindElementPromiseByFocusType ' + caseName + ' condition: ' + condition); - let action = (condition == 'accessibility') ? 'accessibilityFocus' : 'focus'; - let ret = await element.performAction(action); - console.info('ElementTest executeFindElementPromiseByFocusType ' + caseName + ' performAction[' + action + '] ret: ' + ret); - - let found = await element.findElement('focusType', condition); - console.info('ElementTest executeFindElementPromiseByFocusType ' + caseName + ' element: ' + JSON.stringify(found)); - if (typeof(found) == 'object') { - result = true; - } - - if (ret) { - let clearAction = (condition == 'accessibility') ? 'clearAccessibilityFocus' : 'clearFocus'; - await element.performAction(clearAction); - } - } catch (e) { - console.info('ElementTest executeFindElementPromiseByFocusType ' + caseName + ' catch(e): ' + JSON.stringify(e)); - if (condition == invalidString && e && e.code != 0) { - result = true; - } - } - } - return result; - } - - private async executeFindElementPromiseByFocusDirection(caseName: string, condition: string): Promise { - let result = false; - let element = await this.getBaseElement(); - if (element) { - try { - console.info('ElementTest executeFindElementPromiseByFocusDirection ' + caseName + ' condition: ' + condition); - let found = await element.findElement('focusDirection', condition); - console.info('ElementTest executeFindElementPromiseByFocusDirection ' + caseName + ' element: ' + JSON.stringify(found)); - if (typeof(found) == 'object') { - result = true; - } - } catch (e) { - console.info('ElementTest executeFindElementPromiseByFocusDirection ' + caseName + ' catch(e): ' + JSON.stringify(e)); - if (condition == invalidString) { - result = true; - } - } - } - return result; - } - - private async executeFindElementPromise5900(caseName: string): Promise { - let result = false; - let element = undefined; - if (this.context) { - let root = await this.context.getWindowRootElement(); - let elements = await root.findElement('content', 'button2'); - element = elements[0]; - } - if (element) { - console.info('ElementTest executeFindElementPromise5900 ' + caseName); - let found = await element.findElement('focusDirection', 'down'); - console.info('ElementTest executeFindElementPromise5900 ' + caseName + ' element: ' + JSON.stringify(found)); - if (typeof(found) == 'object') { - result = true; - } - } - return result; - } - - private async executeAttributeNamesCallback(caseName: string) { - let result = false; - let element = await this.getBaseElement(); - if (element) { - element.attributeNames((err, names) => { - console.info('ElementTest executeAttributeNamesCallback ' + caseName + ' err: ' + JSON.stringify(err)); - console.info('ElementTest executeAttributeNamesCallback ' + caseName + ' names: ' + JSON.stringify(names)); - if (err && err.code != 0) { - result = false; - } else if (Array.isArray(names)) { - result = true; - } - this.publishCaseResult(caseName, result); - }); - } - } - - private async executeAttributeValueCallback(caseName: string, input: string, - outputType: string, isWindow: boolean = false) { - let element = undefined; - if (isWindow) { - element = await this.getWindowElement(); - } else { - element = await this.getBaseElement(); - } - - let result = false; - if (element) { - console.info('ElementTest executeAttributeValueCallback ' + caseName + ' input: ' + input + ', outputType: ' + outputType); - element.attributeValue(input, (err, value) => { - console.info('ElementTest executeAttributeValueCallback ' + caseName + ' err: ' + JSON.stringify(err)); - console.info('ElementTest executeAttributeValueCallback ' + caseName + ' value: ' + JSON.stringify(value)); - if (err && err.code != 0) { - result = true; - } else if (typeof(value) == outputType) { - result = true; - } else { - console.warn('ElementTest executeAttributeValueCallback ' + caseName + ' valueType: ' + typeof(value)); - } - this.publishCaseResult(caseName, result); - }); - } - } - - private async executeAttributeValueCallbackRect(caseName: string, input: string, isWindow: boolean = false) { - let element = undefined; - if (isWindow) { - element = await this.getWindowElement(); - } else { - element = await this.getBaseElement(); - } - - let result = false; - if (element) { - console.info('ElementTest executeAttributeValueCallbackRect ' + caseName); - element.attributeValue(input, (err, value) => { - console.info('ElementTest executeAttributeValueCallback ' + caseName + ' err: ' + JSON.stringify(err)); - console.info('ElementTest executeAttributeValueCallback ' + caseName + ' value: ' + JSON.stringify(value)); - if (typeof(value) == 'object' && typeof(value.left) == 'number' - && typeof(value.top) == 'number' && typeof(value.width) == 'number' && typeof(value.height) == 'number') { - result = true; - } else if (err) { - console.warn('ElementTest executeAttributeValueCallbackRect ' + caseName + ' valueType: ' + typeof(value)); - } - this.publishCaseResult(caseName, result); - }); - } - } - - private async executeAttributeValueCallbackTriggerAction(caseName: string) { - console.info('ElementTest executeAttributeValueCallbackTriggerAction ' + caseName + ' start'); - let event = new accessibility.EventInfo({}); - event.type = 'click'; - event.bundleName = 'com.example.accessibilityxts'; - event.triggerAction = 'click'; - await accessibility.sendEvent(event); - console.info('ElementTest executeAttributeValueCallbackTriggerAction ' + caseName + ' sendEvent finish'); - - setTimeout(() => { - console.info('ElementTest executeAttributeValueCallbackTriggerAction ' + caseName + ' events.length: ' + this.events.length); - for (let i = 0; i < this.events.length; i++) { - let target = this.events[i].target; - let eventType = this.events[i].eventType; - console.info('ElementTest executeAttributeValueCallbackTriggerAction ' + caseName + ' target: ' + JSON.stringify(target)); - target.attributeValue('triggerAction', (err, value) => { - console.info('ElementTest executeAttributeValueCallbackTriggerAction ' + caseName + ' err: ' + JSON.stringify(err)); - console.info('ElementTest executeAttributeValueCallbackTriggerAction ' + caseName + ' valueType: ' + typeof(value)); - if (err) { - this.publishCaseResult(caseName, false); - } else if (eventType == 'click' && typeof(value) == 'string') { - this.publishCaseResult(caseName, true); - } - }); - } - }, 1000); - } - - private async executeAttributeValueCallbackRootElement(caseName: string) { - let element = undefined; - if (this.context) { - let base = await this.getBaseElement(); - if (base) { - let baseWindowId = await base.attributeValue('windowId'); - let windows = await this.context.getWindows(); - for (let window of windows) { - let windowId = await window.attributeValue('windowId'); - if (baseWindowId == windowId) { - element = window; - console.info('ElementTest executeAttributeValueCallbackRootElement ' + caseName + ' found window'); - break; - } - } - } - } - - let result = false; - if (element) { - console.info('ElementTest executeAttributeValueCallbackRootElement ' + caseName + ' input: rootElement, outputType: object'); - element.attributeValue('rootElement', (err, value) => { - console.info('ElementTest executeAttributeValueCallback ' + caseName + ' err: ' + JSON.stringify(err)); - console.info('ElementTest executeAttributeValueCallback ' + caseName + ' value: ' + JSON.stringify(value)); - if (err) { - let result = false; - } else if (typeof(value) == 'object') { - result = true; - } else { - console.warn('ElementTest executeAttributeValueCallback ' + caseName + ' valueType: ' + typeof(value)); - } - this.publishCaseResult(caseName, result); - }); - } - } - - private async executeAttributeValueCallbackArray(caseName: string, input: string, outputType: string) { - let result = false; - let element = await this.getBaseElement(); - if (element) { - console.info('ElementTest executeAttributeValueCallbackArray ' + caseName + ' input: ' + input + ', outputType: ' + outputType); - element.attributeValue(input, (err, value) => { - console.info('ElementTest executeAttributeValueCallbackArray ' + caseName + ' err: ' + JSON.stringify(err)); - console.info('ElementTest executeAttributeValueCallbackArray ' + caseName + ' value: ' + JSON.stringify(value)); - if (err) { - let result = false; - } else if (Array.isArray(value)) { - if ((value.length == 0)|| - (value.length > 0 && typeof(value[0]) == outputType)) { - result = true; - } - } - this.publishCaseResult(caseName, result); - }); - } - } - - private async executeActionNamesCallback(caseName: string) { - let result = false; - let element = await this.getBaseElement(); - if (element) { - element.actionNames((err, actions) => { - console.info('ElementTest executeActionNamesCallback ' + caseName + ' err: ' + JSON.stringify(err)); - console.info('ElementTest executeActionNamesCallback ' + caseName + ' actions: ' + JSON.stringify(actions)); - if (Array.isArray(actions)) { - if ((actions.length == 0) || - (actions.length > 0 && typeof(actions[0]) == 'string')) { - result = true; - } - } - this.publishCaseResult(caseName, result); - }); - - } - } - - private async executePerformActionCallback(caseName: string, action: string, args?: object) { - let result = false; - let element = await this.getBaseElement(); - if (element) { - console.info('ElementTest executePerformActionCallback ' + caseName + ' action: ' + action + ', args: ' + JSON.stringify(args)); - element.performAction(action, args, (err, ret) => { - console.info('ElementTest executePerformActionCallback ' + caseName + ' err: ' + JSON.stringify(err)); - console.info('ElementTest executePerformActionCallback ' + caseName + ' ret: ' + JSON.stringify(ret)); - if (err && err.code != 0) { - if (err.code == 9300005 || err.code == 9300000) { - result = true; - } - result = true; - } else if (typeof(ret) == 'undefined') { - result = true; - } - this.publishCaseResult(caseName, result); - }); - } - } - - private async executeFindElementCallbackByContent(caseName: string, condition: string) { - let result = false; - let element = await this.getBaseElement(); - if (element) { - console.info('ElementTest executeFindElementCallbackByContent ' + caseName + ' condition: ' + condition); - element.findElement('content', condition, (err, found) => { - console.info('ElementTest executeFindElementCallbackByContent ' + caseName + ' err: ' + JSON.stringify(err)); - console.info('ElementTest executeFindElementCallbackByContent ' + caseName + ' element: ' + JSON.stringify(found)); - if (condition == invalidString && err && err.code != 0) { - result = true; - } else if (Array.isArray(found)) { - if (found.length == 0 || typeof(found[0]) == 'object') { - result = true; - } - } - this.publishCaseResult(caseName, result); - }); - } - } - - private async executeFindElementCallbackByFocusType(caseName: string, condition: string) { - let result = false; - let element = await this.getBaseElement(); - if (element) { - console.info('ElementTest executeFindElementCallbackByFocusType ' + caseName + ' condition: ' + condition); - let action = (condition == 'accessibility') ? 'accessibilityFocus' : 'focus'; - let ret = await element.performAction(action); - console.info('ElementTest executeFindElementCallbackByFocusType ' + caseName + ' performAction[' + action + '] ret: ' + ret); - - element.findElement('focusType', condition, (err, found) => { - console.info('ElementTest executeFindElementCallbackByFocusType ' + caseName + ' err: ' + JSON.stringify(err)); - console.info('ElementTest executeFindElementCallbackByFocusType ' + caseName + ' element: ' + JSON.stringify(found)); - if (condition == invalidString && err && err.code != 0) { - result = true; - } else if (typeof(found) == 'object') { - result = true; - } - this.publishCaseResult(caseName, result); - }); - - setTimeout(async () => { - if (ret && element) { - let clearAction = (condition == 'accessibility') ? 'clearAccessibilityFocus' : 'clearFocus'; - await element.performAction(clearAction); - } - }, 1000); - } - } - - private async executeFindElementCallbackByFocusDirection(caseName: string, condition: string) { - let result = false; - let element = await this.getBaseElement(); - if (element) { - console.info('ElementTest executeFindElementCallbackByFocusDirection ' + caseName + ' condition: ' + condition); - element.findElement('focusDirection', condition, (err, found) => { - console.info('ElementTest executeFindElementCallbackByFocusDirection ' + err + ' element: ' + JSON.stringify(err)); - console.info('ElementTest executeFindElementCallbackByFocusDirection ' + caseName + ' element: ' + JSON.stringify(found)); - if (condition == invalidString && err.code != 0) { - result = true; - } else if (typeof(found) == 'object') { - result = true; - } - this.publishCaseResult(caseName, result); - }); - } - } - - private async executeFindElementCallback5900(caseName: string) { - let result = false; - let element = undefined; - if (this.context) { - let root = await this.context.getWindowRootElement(); - let elements = await root.findElement('content', 'button2'); - element = elements[0]; - } - if (element) { - console.info('ElementTest executeFindElementCallback5900 ' + caseName); - element.findElement('focusDirection', 'down', (err, found) => { - console.info('ElementTest executeFindElementCallback5900 ' + caseName + ' err: ' + JSON.stringify(err)); - console.info('ElementTest executeFindElementCallback5900 ' + caseName + ' element: ' + JSON.stringify(found)); - if (err && err.code != 0) { - - }if (typeof(found) == 'object') { - result = true; - } - this.publishCaseResult(caseName, result); - }); - } - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityelement/entry/src/main/ets/Application/AbilityStage.ts b/barrierfree/accessibilityelement/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 1535a6b506bcd4a361ccbf5328e933e46a7b7e38..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityelement/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,7 +0,0 @@ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} diff --git a/barrierfree/accessibilityelement/entry/src/main/ets/MainAbility/MainAbility.ts b/barrierfree/accessibilityelement/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index cd47e022551551b3c393359b8cccafb7462c600a..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityelement/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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 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() { - // Ability is destroying, release resources for this ability - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate windowStage=" + windowStage) - //globalThis.windowStage = windowStage - //globalThis.abilityStorage = this.storage - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "MainAbility/pages/index/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") - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityelement/entry/src/main/ets/MainAbility/pages/index/index.ets b/barrierfree/accessibilityelement/entry/src/main/ets/MainAbility/pages/index/index.ets deleted file mode 100644 index ed3ed7da39626bd785d22effda0174a96b639669..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityelement/entry/src/main/ets/MainAbility/pages/index/index.ets +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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 { - @State message: string = 'accessibility element'; - - aboutToAppear(){ - console.info("start run testcase!!!!"); - } - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - .margin({bottom: 10}) - - Row() { - Button('left') - Button('button1') - .margin({ - left: 10, - right: 10 - }) - Button('right') - } - .margin({bottom: 10}) - - Button('button2') - .margin({bottom: 10}) - - Button('button3') - .margin({bottom: 10}) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityelement/entry/src/main/ets/TestAbility/TestAbility.ts b/barrierfree/accessibilityelement/entry/src/main/ets/TestAbility/TestAbility.ts deleted file mode 100644 index 89a84730505783ba229175ab4b55d37f91a16266..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityelement/entry/src/main/ets/TestAbility/TestAbility.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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' - -export default class TestAbility extends Ability { - onCreate(want, launchParam) { - console.log('TestAbility onCreate') - } - - 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') - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityelement/entry/src/main/ets/TestAbility/pages/index.ets b/barrierfree/accessibilityelement/entry/src/main/ets/TestAbility/pages/index.ets deleted file mode 100644 index b93567f962921124b282f78c8ef123965d1460c9..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityelement/entry/src/main/ets/TestAbility/pages/index.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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%') - } - } \ No newline at end of file diff --git a/barrierfree/accessibilityelement/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/barrierfree/accessibilityelement/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index fde2966cd3df4d631cff5b012cbe4421d902d19c..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityelement/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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.accessibilityxts.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') - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityelement/entry/src/main/ets/test/AccessibilityElement.test.ets b/barrierfree/accessibilityelement/entry/src/main/ets/test/AccessibilityElement.test.ets deleted file mode 100644 index 6bf9b734e992826b997274d53f2f6477a5071c73..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityelement/entry/src/main/ets/test/AccessibilityElement.test.ets +++ /dev/null @@ -1,4899 +0,0 @@ -/* - * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" -import commonEvent from '@ohos.commonEvent' -import config from '@ohos.accessibility.config' - -const passStr = 'pass'; -const failStr = 'fail'; - -function publishCaseExecute(caseName: string) { - let commonEventPublishData = { - data: caseName - } - - commonEvent.publish('caseExecute', commonEventPublishData, (err) => { - console.info('caseExecute publish [' + caseName + '] callback result: ' + JSON.stringify(err)); - }); -} - -export default function abilityTest() { - describe('AccessibilityElementTest', function () { - let subScriber = undefined; - let isConnect = false; - let caseResult = undefined; - - beforeAll(async function (done) { - console.info('AccessibilityElementTest: beforeAll'); - subScriber = await commonEvent.createSubscriber({events: ['onConnectState', 'caseResult']}); - commonEvent.subscribe(subScriber, (err, data) => { - console.info('AccessibilityElementTest beforeAll data:' + JSON.stringify(data) ); - if (data.data == 'connect') { - isConnect = true; - } else if (data.data == 'disconnect') { - isConnect = false; - } else if (data.data == passStr || data.data == failStr) { - caseResult = data; - } - }); - - config.enableAbility('com.example.accessibilityxts/AccessibilityExtAbility', - ["retrieve", "touchGuide", "gesture"] - ).then(() => { - console.info(`AccessibilityElementTest enableAbility: then`); - - config.enableAbility('com.example.accessibilityxts/AccessibilityExtAbility1', - ["retrieve", "touchGuide", "gesture"] - ).then(() => { - console.info(`AccessibilityElementTest1 enableAbility: then`); - }).catch((err) => { - console.error(`AccessibilityElementTest1 enableAbility has error: ${err.code}`); - }); - }).catch((err) => { - console.error(`AccessibilityElementTest enableAbility has error: ${err.code}`); - }); - - - setTimeout(async () => { - done(); - }, 5000); - }) - - afterAll(async function (done) { - console.info('AccessibilityElementTest: afterAll'); - commonEvent.unsubscribe(subScriber); - isConnect = false; - config.disableAbility('com.example.accessibilityxts/AccessibilityExtAbility').then(() => { - console.info(`AccessibilityElementTest disableAbility: then`); - }).catch((err) => { - console.error(`AccessibilityElementTest disableAbility has error: ${err.code}`); - }); - setTimeout(async () => { - done(); - }, 5000); - }) - - beforeEach(async function (done) { - console.info('AccessibilityElementTest: beforeEach'); - caseResult = undefined; - done(); - }) - - afterEach(async function (done) { - console.info('AccessibilityElementTest: afterEach'); - done(); - }) - - /* - * @tc.number AccessibilityElementTest_attributeNames_asyncPromise_0100 - * @tc.name AccessibilityElementTest_attributeNames_asyncPromise_0100 - * @tc.desc Test attributeNames(), should return an array of names in ElementAttributeValues. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeNames_asyncPromise_0100', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeNames_asyncPromise_0100'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_0200 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_0200 - * @tc.desc Test attributeValue() when input is 'componentId', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_0200', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_0200'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_0300 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_0300 - * @tc.desc Test attributeValue() when input is 'pageId', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_0300', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_0300'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_0500 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_0500 - * @tc.desc Test attributeValue() when input is 'inspectorKey', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_0500', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_0500'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_0600 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_0600 - * @tc.desc Test attributeValue() when input is 'bundleName', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_0600', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_0600'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_0700 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_0700 - * @tc.desc Test attributeValue() when input is 'componentType', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_0700', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_0700'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_0800 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_0800 - * @tc.desc Test attributeValue() when input is 'inputType', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_0800', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_0800'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_0900 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_0900 - * @tc.desc Test attributeValue() when input is 'text', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_0900', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_0900'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_1000 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_1000 - * @tc.desc Test attributeValue() when input is 'hintText', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_1000', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_1000'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_1100 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_1100 - * @tc.desc Test attributeValue() when input is 'description', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_1100', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_1100'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_1200 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_1200 - * @tc.desc Test attributeValue() when input is 'resourceName', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_1200', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_1200'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_1400 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_1400 - * @tc.desc Test attributeValue() when input is 'textLengthLimit', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_1400', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_1400'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_1500 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_1500 - * @tc.desc Test attributeValue() when input is 'rect', should return a Rect type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_1500', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_1500'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_1600 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_1600 - * @tc.desc Test attributeValue() when input is 'checkable', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_1600', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_1600'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_1700 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_1700 - * @tc.desc Test attributeValue() when input is 'checked', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_1700', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_1700'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_1800 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_1800 - * @tc.desc Test attributeValue() when input is 'focusable', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_1800', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_1800'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_1900 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_1900 - * @tc.desc Test attributeValue() when input is 'isVisible', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_1900', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_1900'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_2000 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_2000 - * @tc.desc Test attributeValue() when input is 'accessibilityFocused', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_2000', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_2000'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_2100 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_2100 - * @tc.desc Test attributeValue() when input is 'selected', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_2100', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_2100'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_2200 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_2200 - * @tc.desc Test attributeValue() when input is 'clickable', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_2200', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_2200'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_2300 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_2300 - * @tc.desc Test attributeValue() when input is 'longClickable', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_2300', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_2300'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_2400 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_2400 - * @tc.desc Test attributeValue() when input is 'isEnable', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_2400', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_2400'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_2500 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_2500 - * @tc.desc Test attributeValue() when input is 'isPassword', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_2500', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_2500'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_2600 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_2600 - * @tc.desc Test attributeValue() when input is 'scrollable', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_2600', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_2600'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_2700 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_2700 - * @tc.desc Test attributeValue() when input is 'editable', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_2700', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_2700'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_2900 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_2900 - * @tc.desc Test attributeValue() when input is 'pluralLineSupported', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_2900', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_2900'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_3100 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_3100 - * @tc.desc Test attributeValue() when input is 'isHint', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_3100', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_3100'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_3300 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_3300 - * @tc.desc Test attributeValue() when input is 'itemCount', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_3300', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_3300'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_3400 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_3400 - * @tc.desc Test attributeValue() when input is 'currentIndex', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_3400', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_3400'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_3500 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_3500 - * @tc.desc Test attributeValue() when input is 'startIndex', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_3500', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_3500'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_3600 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_3600 - * @tc.desc Test attributeValue() when input is 'endIndex', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_3600', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_3600'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_3700 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_3700 - * @tc.desc Test attributeValue() when input is 'valueMax', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_3700', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_3700'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_3800 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_3800 - * @tc.desc Test attributeValue() when input is 'valueMin', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_3800', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_3800'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_3900 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_3900 - * @tc.desc Test attributeValue() when input is 'valueNow', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_3900', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_3900'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_4200 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_4200 - * @tc.desc Test attributeValue() when input is 'error', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_4200', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_4200'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_4300 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_4300 - * @tc.desc Test attributeValue() when input is 'triggerAction', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_4300', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_4300'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_4400 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_4400 - * @tc.desc Test attributeValue() when input is 'textMoveUnit', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_4400', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_4400'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_4500 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_4500 - * @tc.desc Test attributeValue() when input is 'contents', should return an array of string. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_4500', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_4500'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_4600 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_4600 - * @tc.desc Test attributeValue() when input is 'lastContent', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_4600', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_4600'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_4700 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_4700 - * @tc.desc Test attributeValue() when input is 'parent', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_4700', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_4700'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_4800 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_4800 - * @tc.desc Test attributeValue() when input is 'children', should return an array of AccessibilityElement. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_4800', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_4800'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_5200 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_5200 - * @tc.desc Test attributeValue() when input is 'isActive', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_5200', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_5200'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_5300 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_5300 - * @tc.desc Test attributeValue() when input is 'screenRect', should return a Rect type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_5300', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_5300'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_5400 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_5400 - * @tc.desc Test attributeValue() when input is 'layer', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_5400', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_5400'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_5500 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_5500 - * @tc.desc Test attributeValue() when input is 'type', should return a WindowType(string) type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_5500', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_5500'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_5600 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_5600 - * @tc.desc Test attributeValue() when input is 'rootElement', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_5600', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_5600'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_5700 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_5700 - * @tc.desc Test attributeValue() when input is 'windowId', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_5700', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_5700'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_5800 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_5800 - * @tc.desc Test attributeValue() when input is 'isFocused', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_5800', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_5800'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncPromise_5900 - * @tc.name AccessibilityElementTest_findElement_asyncPromise_5900 - * @tc.desc Test findElement() when input is 'focusDirection' and 'down' in same layout, should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncPromise_5900', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncPromise_5900'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_actionNames_asyncPromise_6000 - * @tc.name AccessibilityElementTest_actionNames_asyncPromise_6000 - * @tc.desc Test actionNames(), should return an array of action names in CommonAction. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_actionNames_asyncPromise_6000', 0, async function (done) { - let caseName = 'AccessibilityElementTest_actionNames_asyncPromise_6000'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncPromise_6100 - * @tc.name AccessibilityElementTest_performAction_asyncPromise_6100 - * @tc.desc Test performAction() when input is 'accessibilityFocus'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncPromise_6100', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncPromise_6100'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncPromise_6200 - * @tc.name AccessibilityElementTest_performAction_asyncPromise_6200 - * @tc.desc Test performAction() when input is 'clearAccessibilityFocus'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncPromise_6200', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncPromise_6200'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncPromise_6300 - * @tc.name AccessibilityElementTest_performAction_asyncPromise_6300 - * @tc.desc Test performAction() when input is 'focus'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncPromise_6300', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncPromise_6300'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncPromise_6400 - * @tc.name AccessibilityElementTest_performAction_asyncPromise_6400 - * @tc.desc Test performAction() when input is 'clearFocus'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncPromise_6400', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncPromise_6400'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncPromise_6500 - * @tc.name AccessibilityElementTest_performAction_asyncPromise_6500 - * @tc.desc Test performAction() when input is 'clearSelection'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncPromise_6500', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncPromise_6500'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncPromise_6600 - * @tc.name AccessibilityElementTest_performAction_asyncPromise_6600 - * @tc.desc Test performAction() when input is 'click'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncPromise_6600', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncPromise_6600'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncPromise_6700 - * @tc.name AccessibilityElementTest_performAction_asyncPromise_6700 - * @tc.desc Test performAction() when input is 'longClick'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncPromise_6700', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncPromise_6700'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncPromise_6800 - * @tc.name AccessibilityElementTest_performAction_asyncPromise_6800 - * @tc.desc Test performAction() when input is 'cut'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncPromise_6800', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncPromise_6800'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncPromise_6900 - * @tc.name AccessibilityElementTest_performAction_asyncPromise_6900 - * @tc.desc Test performAction() when input is 'copy'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncPromise_6900', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncPromise_6900'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncPromise_7000 - * @tc.name AccessibilityElementTest_performAction_asyncPromise_7000 - * @tc.desc Test performAction() when input is 'paste'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncPromise_7000', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncPromise_7000'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncPromise_7100 - * @tc.name AccessibilityElementTest_performAction_asyncPromise_7100 - * @tc.desc Test performAction() when input is 'select'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncPromise_7100', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncPromise_7100'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncPromise_7200 - * @tc.name AccessibilityElementTest_performAction_asyncPromise_7200 - * @tc.desc Test performAction() when input is 'setText'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncPromise_7200', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncPromise_7200'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncPromise_7300 - * @tc.name AccessibilityElementTest_performAction_asyncPromise_7300 - * @tc.desc Test performAction() when input is 'delete'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncPromise_7300', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncPromise_7300'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncPromise_7400 - * @tc.name AccessibilityElementTest_performAction_asyncPromise_7400 - * @tc.desc Test performAction() when input is 'scrollForward'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncPromise_7400', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncPromise_7400'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncPromise_7500 - * @tc.name AccessibilityElementTest_performAction_asyncPromise_7500 - * @tc.desc Test performAction() when input is 'scrollBackward'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncPromise_7500', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncPromise_7500'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncPromise_7600 - * @tc.name AccessibilityElementTest_performAction_asyncPromise_7600 - * @tc.desc Test performAction() when input is 'setSelection'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncPromise_7600', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncPromise_7600'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncPromise_7700 - * @tc.name AccessibilityElementTest_findElement_asyncPromise_7700 - * @tc.desc Test findElement() when input is 'content' and 'xxx', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncPromise_7700', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncPromise_7700'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncPromise_7800 - * @tc.name AccessibilityElementTest_findElement_asyncPromise_7800 - * @tc.desc Test findElement() when input is 'content' and 'button1', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncPromise_7800', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncPromise_7800'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncPromise_7900 - * @tc.name AccessibilityElementTest_findElement_asyncPromise_7900 - * @tc.desc Test findElement() when input is 'focusType' and 'accessibility', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncPromise_7900', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncPromise_7900'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncPromise_8000 - * @tc.name AccessibilityElementTest_findElement_asyncPromise_8000 - * @tc.desc Test findElement() when input is 'focusType' and 'normal', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncPromise_8000', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncPromise_8000'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncPromise_8100 - * @tc.name AccessibilityElementTest_findElement_asyncPromise_8100 - * @tc.desc Test findElement() when input is 'focusDirection' and 'up', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncPromise_8100', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncPromise_8100'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncPromise_8200 - * @tc.name AccessibilityElementTest_findElement_asyncPromise_8200 - * @tc.desc Test findElement() when input is 'focusDirection' and 'down', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncPromise_8200', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncPromise_8200'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncPromise_8300 - * @tc.name AccessibilityElementTest_findElement_asyncPromise_8300 - * @tc.desc Test findElement() when input is 'focusDirection' and 'left', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncPromise_8300', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncPromise_8300'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncPromise_8400 - * @tc.name AccessibilityElementTest_findElement_asyncPromise_8400 - * @tc.desc Test findElement() when input is 'focusDirection' and 'right', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncPromise_8400', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncPromise_8400'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncPromise_8500 - * @tc.name AccessibilityElementTest_findElement_asyncPromise_8500 - * @tc.desc Test findElement() when input is 'focusDirection' and 'forward', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncPromise_8500', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncPromise_8500'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncPromise_8600 - * @tc.name AccessibilityElementTest_findElement_asyncPromise_8600 - * @tc.desc Test findElement() when input is 'focusDirection' and 'backward', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncPromise_8600', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncPromise_8600'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncPromise_8700 - * @tc.name AccessibilityElementTest_findElement_asyncPromise_8700 - * @tc.desc Test findElement() when input is 'focusType' and 'xxx', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncPromise_8700', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncPromise_8700'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncPromise_8800 - * @tc.name AccessibilityElementTest_findElement_asyncPromise_8800 - * @tc.desc Test findElement() when input is 'focusDirection' and 'xxx', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncPromise_8800', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncPromise_8800'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncPromise_8900 - * @tc.name AccessibilityElementTest_performAction_asyncPromise_8900 - * @tc.desc Test performAction() when input is 'xxx'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncPromise_8900', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncPromise_8900'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncPromise_9000 - * @tc.name AccessibilityElementTest_attributeValue_asyncPromise_9000 - * @tc.desc Test attributeValue() when input is 'xxx', should catch error. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncPromise_9000', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncPromise_9000'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeNames_asyncCallback_0100 - * @tc.name AccessibilityElementTest_attributeNames_asyncCallback_0100 - * @tc.desc Test attributeNames(), should return an array of names in ElementAttributeValues. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeNames_asyncCallback_0100', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeNames_asyncCallback_0100'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_0200 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_0200 - * @tc.desc Test attributeValue() when input is 'componentId', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_0200', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_0200'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_0300 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_0300 - * @tc.desc Test attributeValue() when input is 'pageId', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_0300', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_0300'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_0500 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_0500 - * @tc.desc Test attributeValue() when input is 'inspectorKey', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_0500', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_0500'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_0600 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_0600 - * @tc.desc Test attributeValue() when input is 'bundleName', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_0600', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_0600'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_0700 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_0700 - * @tc.desc Test attributeValue() when input is 'componentType', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_0700', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_0700'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_0800 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_0800 - * @tc.desc Test attributeValue() when input is 'inputType', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_0800', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_0800'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_0900 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_0900 - * @tc.desc Test attributeValue() when input is 'text', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_0900', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_0900'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_1000 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_1000 - * @tc.desc Test attributeValue() when input is 'hintText', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_1000', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_1000'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_1100 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_1100 - * @tc.desc Test attributeValue() when input is 'description', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_1100', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_1100'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_1200 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_1200 - * @tc.desc Test attributeValue() when input is 'resourceName', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_1200', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_1200'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_1400 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_1400 - * @tc.desc Test attributeValue() when input is 'textLengthLimit', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_1400', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_1400'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_1500 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_1500 - * @tc.desc Test attributeValue() when input is 'rect', should return a Rect type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_1500', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_1500'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_1600 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_1600 - * @tc.desc Test attributeValue() when input is 'checkable', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_1600', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_1600'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_1700 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_1700 - * @tc.desc Test attributeValue() when input is 'checked', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_1700', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_1700'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_1800 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_1800 - * @tc.desc Test attributeValue() when input is 'focusable', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_1800', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_1800'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_1900 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_1900 - * @tc.desc Test attributeValue() when input is 'isVisible', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_1900', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_1900'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_2000 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_2000 - * @tc.desc Test attributeValue() when input is 'accessibilityFocused', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_2000', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_2000'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_2100 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_2100 - * @tc.desc Test attributeValue() when input is 'selected', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_2100', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_2100'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_2200 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_2200 - * @tc.desc Test attributeValue() when input is 'clickable', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_2200', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_2200'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_2300 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_2300 - * @tc.desc Test attributeValue() when input is 'longClickable', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_2300', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_2300'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_2400 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_2400 - * @tc.desc Test attributeValue() when input is 'isEnable', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_2400', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_2400'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_2500 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_2500 - * @tc.desc Test attributeValue() when input is 'isPassword', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_2500', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_2500'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_2600 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_2600 - * @tc.desc Test attributeValue() when input is 'scrollable', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_2600', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_2600'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_2700 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_2700 - * @tc.desc Test attributeValue() when input is 'editable', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_2700', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_2700'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_2900 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_2900 - * @tc.desc Test attributeValue() when input is 'pluralLineSupported', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_2900', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_2900'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_3100 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_3100 - * @tc.desc Test attributeValue() when input is 'isHint', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_3100', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_3100'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_3300 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_3300 - * @tc.desc Test attributeValue() when input is 'itemCount', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_3300', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_3300'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_3400 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_3400 - * @tc.desc Test attributeValue() when input is 'currentIndex', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_3400', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_3400'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_3500 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_3500 - * @tc.desc Test attributeValue() when input is 'startIndex', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_3500', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_3500'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_3600 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_3600 - * @tc.desc Test attributeValue() when input is 'endIndex', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_3600', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_3600'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_3700 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_3700 - * @tc.desc Test attributeValue() when input is 'valueMax', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_3700', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_3700'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_3800 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_3800 - * @tc.desc Test attributeValue() when input is 'valueMin', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_3800', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_3800'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_3900 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_3900 - * @tc.desc Test attributeValue() when input is 'valueNow', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_3900', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_3900'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_4200 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_4200 - * @tc.desc Test attributeValue() when input is 'error', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_4200', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_4200'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_4300 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_4300 - * @tc.desc Test attributeValue() when input is 'triggerAction', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_4300', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_4300'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_4400 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_4400 - * @tc.desc Test attributeValue() when input is 'textMoveUnit', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_4400', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_4400'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_4500 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_4500 - * @tc.desc Test attributeValue() when input is 'contents', should return an array of string. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_4500', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_4500'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_4600 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_4600 - * @tc.desc Test attributeValue() when input is 'lastContent', should return a string type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_4600', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_4600'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_4700 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_4700 - * @tc.desc Test attributeValue() when input is 'parent', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_4700', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_4700'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_4800 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_4800 - * @tc.desc Test attributeValue() when input is 'children', should return an array of AccessibilityElement. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_4800', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_4800'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_5200 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_5200 - * @tc.desc Test attributeValue() when input is 'isActive', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_5200', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_5200'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_5300 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_5300 - * @tc.desc Test attributeValue() when input is 'screenRect', should return a Rect type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_5300', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_5300'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_5400 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_5400 - * @tc.desc Test attributeValue() when input is 'layer', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_5400', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_5400'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_5500 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_5500 - * @tc.desc Test attributeValue() when input is 'type', should return a WindowType(string) type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_5500', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_5500'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_5600 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_5600 - * @tc.desc Test attributeValue() when input is 'rootElement', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_5600', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_5600'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_5700 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_5700 - * @tc.desc Test attributeValue() when input is 'windowId', should return a number type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_5700', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_5700'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_5800 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_5800 - * @tc.desc Test attributeValue() when input is 'isFocused', should return a boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_5800', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_5800'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncCallback_5900 - * @tc.name AccessibilityElementTest_findElement_asyncCallback_5900 - * @tc.desc Test findElement() when input is 'focusDirection' and 'down' in same layout, should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncCallback_5900', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncCallback_5900'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_actionNames_asyncCallback_6000 - * @tc.name AccessibilityElementTest_actionNames_asyncCallback_6000 - * @tc.desc Test actionNames(), should return an array of action names in CommonAction. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_actionNames_asyncCallback_6000', 0, async function (done) { - let caseName = 'AccessibilityElementTest_actionNames_asyncCallback_6000'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncCallback_6100 - * @tc.name AccessibilityElementTest_performAction_asyncCallback_6100 - * @tc.desc Test performAction() when input is 'accessibilityFocus'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncCallback_6100', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncCallback_6100'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncCallback_6200 - * @tc.name AccessibilityElementTest_performAction_asyncCallback_6200 - * @tc.desc Test performAction() when input is 'clearAccessibilityFocus'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncCallback_6200', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncCallback_6200'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncCallback_6300 - * @tc.name AccessibilityElementTest_performAction_asyncCallback_6300 - * @tc.desc Test performAction() when input is 'focus'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncCallback_6300', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncCallback_6300'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncCallback_6400 - * @tc.name AccessibilityElementTest_performAction_asyncCallback_6400 - * @tc.desc Test performAction() when input is 'clearFocus'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncCallback_6400', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncCallback_6400'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncCallback_6500 - * @tc.name AccessibilityElementTest_performAction_asyncCallback_6500 - * @tc.desc Test performAction() when input is 'clearSelection'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncCallback_6500', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncCallback_6500'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncCallback_6600 - * @tc.name AccessibilityElementTest_performAction_asyncCallback_6600 - * @tc.desc Test performAction() when input is 'click'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncCallback_6600', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncCallback_6600'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncCallback_6700 - * @tc.name AccessibilityElementTest_performAction_asyncCallback_6700 - * @tc.desc Test performAction() when input is 'longClick'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncCallback_6700', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncCallback_6700'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncCallback_6800 - * @tc.name AccessibilityElementTest_performAction_asyncCallback_6800 - * @tc.desc Test performAction() when input is 'cut'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncCallback_6800', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncCallback_6800'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncCallback_6900 - * @tc.name AccessibilityElementTest_performAction_asyncCallback_6900 - * @tc.desc Test performAction() when input is 'copy'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncCallback_6900', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncCallback_6900'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncCallback_7000 - * @tc.name AccessibilityElementTest_performAction_asyncCallback_7000 - * @tc.desc Test performAction() when input is 'paste'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncCallback_7000', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncCallback_7000'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncCallback_7100 - * @tc.name AccessibilityElementTest_performAction_asyncCallback_7100 - * @tc.desc Test performAction() when input is 'select'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncCallback_7100', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncCallback_7100'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncCallback_7200 - * @tc.name AccessibilityElementTest_performAction_asyncCallback_7200 - * @tc.desc Test performAction() when input is 'setText'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncCallback_7200', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncCallback_7200'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncCallback_7300 - * @tc.name AccessibilityElementTest_performAction_asyncCallback_7300 - * @tc.desc Test performAction() when input is 'delete'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncCallback_7300', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncCallback_7300'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncCallback_7400 - * @tc.name AccessibilityElementTest_performAction_asyncCallback_7400 - * @tc.desc Test performAction() when input is 'scrollForward'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncCallback_7400', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncCallback_7400'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncCallback_7500 - * @tc.name AccessibilityElementTest_performAction_asyncCallback_7500 - * @tc.desc Test performAction() when input is 'scrollBackward'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncCallback_7500', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncCallback_7500'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncCallback_7600 - * @tc.name AccessibilityElementTest_performAction_asyncCallback_7600 - * @tc.desc Test performAction() when input is 'setSelection'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncCallback_7600', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncCallback_7600'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncCallback_7700 - * @tc.name AccessibilityElementTest_findElement_asyncCallback_7700 - * @tc.desc Test findElement() when input is 'content' and 'xxx', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncCallback_7700', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncCallback_7700'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncCallback_7800 - * @tc.name AccessibilityElementTest_findElement_asyncCallback_7800 - * @tc.desc Test findElement() when input is 'content' and 'button1', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncCallback_7800', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncCallback_7800'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncCallback_7900 - * @tc.name AccessibilityElementTest_findElement_asyncCallback_7900 - * @tc.desc Test findElement() when input is 'focusType' and 'accessibility', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncCallback_7900', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncCallback_7900'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncCallback_8000 - * @tc.name AccessibilityElementTest_findElement_asyncCallback_8000 - * @tc.desc Test findElement() when input is 'focusType' and 'normal', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncCallback_8000', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncCallback_8000'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncCallback_8100 - * @tc.name AccessibilityElementTest_findElement_asyncCallback_8100 - * @tc.desc Test findElement() when input is 'focusDirection' and 'up', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncCallback_8100', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncCallback_8100'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncCallback_8200 - * @tc.name AccessibilityElementTest_findElement_asyncCallback_8200 - * @tc.desc Test findElement() when input is 'focusDirection' and 'down', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncCallback_8200', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncCallback_8200'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncCallback_8300 - * @tc.name AccessibilityElementTest_findElement_asyncCallback_8300 - * @tc.desc Test findElement() when input is 'focusDirection' and 'left', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncCallback_8300', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncCallback_8300'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncCallback_8400 - * @tc.name AccessibilityElementTest_findElement_asyncCallback_8400 - * @tc.desc Test findElement() when input is 'focusDirection' and 'right', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncCallback_8400', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncCallback_8400'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncCallback_8500 - * @tc.name AccessibilityElementTest_findElement_asyncCallback_8500 - * @tc.desc Test findElement() when input is 'focusDirection' and 'forward', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncCallback_8500', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncCallback_8500'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncCallback_8600 - * @tc.name AccessibilityElementTest_findElement_asyncCallback_8600 - * @tc.desc Test findElement() when input is 'focusDirection' and 'backward', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncCallback_8600', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncCallback_8600'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncCallback_8700 - * @tc.name AccessibilityElementTest_findElement_asyncCallback_8700 - * @tc.desc Test findElement() when input is 'focusType' and 'xxx', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncCallback_8700', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncCallback_8700'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_findElement_asyncCallback_8800 - * @tc.name AccessibilityElementTest_findElement_asyncCallback_8800 - * @tc.desc Test findElement() when input is 'focusDirection' and 'xxx', should return an AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_findElement_asyncCallback_8800', 0, async function (done) { - let caseName = 'AccessibilityElementTest_findElement_asyncCallback_8800'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_performAction_asyncCallback_8900 - * @tc.name AccessibilityElementTest_performAction_asyncCallback_8900 - * @tc.desc Test performAction() when input is 'xxx'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_performAction_asyncCallback_8900', 0, async function (done) { - let caseName = 'AccessibilityElementTest_performAction_asyncCallback_8900'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityElementTest_attributeValue_asyncCallback_9000 - * @tc.name AccessibilityElementTest_attributeValue_asyncCallback_9000 - * @tc.desc Test attributeValue() when input is 'xxx', should catch error. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityElementTest_attributeValue_asyncCallback_9000', 0, async function (done) { - let caseName = 'AccessibilityElementTest_attributeValue_asyncCallback_9000'; - console.info(caseName + ' start'); - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': fail, for no caseResult'); - expect(null).assertFail(); - } - done(); - }, 2000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - }) -} \ No newline at end of file diff --git a/barrierfree/accessibilityelement/entry/src/main/ets/test/List.test.ets b/barrierfree/accessibilityelement/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 5df9eb69fd9800d8d37490cc04264d1ef975ea66..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityelement/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 './AccessibilityElement.test.ets' - -export default function testsuite() { - abilityTest() -} \ No newline at end of file diff --git a/barrierfree/accessibilityelement/entry/src/main/module.json b/barrierfree/accessibilityelement/entry/src/main/module.json deleted file mode 100644 index 2b835817b88e995c752fb096ff09da61a0b90633..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityelement/entry/src/main/module.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default", - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [{ - "name": "com.example.accessibilityxts.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [{ - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - }] - }], - "extensionAbilities": [ - { - "name": "AccessibilityExtAbility", - "srcEntrance": "./ets/AccessibilityExtAbility/AccessibilityExtAbility.ts", - "label": "$string:Accessibility_label", - "description": "$string:Accessibility_desc", - "type": "accessibility", - "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" - } - ] - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityelement/entry/src/main/resources/base/element/string.json b/barrierfree/accessibilityelement/entry/src/main/resources/base/element/string.json deleted file mode 100644 index c41658408560320cd93303ad40568a8676301d00..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityelement/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsAccessibilityElementTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - }, - { - "name": "Accessibility_desc", - "value": "accessibility_description" - }, - { - "name": "Accessibility_label", - "value": "accessibility_label" - } - ] -} diff --git a/barrierfree/accessibilityelement/entry/src/main/resources/base/media/icon.png b/barrierfree/accessibilityelement/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityelement/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/barrierfree/accessibilityelement/entry/src/main/resources/base/profile/accessibility_config.json b/barrierfree/accessibilityelement/entry/src/main/resources/base/profile/accessibility_config.json deleted file mode 100644 index 3d3227275e598a68ee5f405daacd72f36df7b674..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityelement/entry/src/main/resources/base/profile/accessibility_config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "accessibilityCapabilities": [ - "retrieve" - ], - "accessibilityCapabilityRationale": "a11y_rationale", - "settingsAbility": "com.accessibility.voiceaid.voiceAidSetting" -} \ No newline at end of file diff --git a/barrierfree/accessibilityelement/entry/src/main/resources/base/profile/main_pages.json b/barrierfree/accessibilityelement/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index ceb075cd80946aade673d707aac904fb8998bce9..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityelement/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index/index" - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityelement/signature/openharmony_sx.p7b b/barrierfree/accessibilityelement/signature/openharmony_sx.p7b deleted file mode 100644 index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityelement/signature/openharmony_sx.p7b and /dev/null differ diff --git a/barrierfree/accessibilityerrcode/entry/src/main/ets/Application/AbilityStage.ts b/barrierfree/accessibilityerrcode/entry/src/main/ets/Application/AbilityStage.ts index 071c0d862407f266470cd7488a13b6bd745ee8fa..d617b713d9c8220dab387c3d844ed68b83b927a8 100644 --- a/barrierfree/accessibilityerrcode/entry/src/main/ets/Application/AbilityStage.ts +++ b/barrierfree/accessibilityerrcode/entry/src/main/ets/Application/AbilityStage.ts @@ -1,4 +1,4 @@ -import AbilityStage from "@ohos.application.AbilityStage" +import AbilityStage from "@ohos.app.ability.AbilityStage" export default class MyAbilityStage extends AbilityStage { onCreate() { diff --git a/barrierfree/accessibilityerrcode/entry/src/main/ets/MainAbility/MainAbility.ts b/barrierfree/accessibilityerrcode/entry/src/main/ets/MainAbility/MainAbility.ts index f9014b87a17cf7c30fb45d2f0455ac8e783a64f7..7e6de36c2c28a9145f54cba7fda122d3955bde1c 100644 --- a/barrierfree/accessibilityerrcode/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/barrierfree/accessibilityerrcode/entry/src/main/ets/MainAbility/MainAbility.ts @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Ability from '@ohos.application.Ability' +import Ability from '@ohos.app.ability.UIAbility' export default class MainAbility extends Ability { onCreate(want,launchParam){ diff --git a/barrierfree/accessibilityerrcode/entry/src/main/ets/TestAbility/TestAbility.ts b/barrierfree/accessibilityerrcode/entry/src/main/ets/TestAbility/TestAbility.ts index 78935adb89211ab492fb41a13635b475f5224b0b..cf3c10e0562d75ae6b2379838f2cd382cd18558a 100644 --- a/barrierfree/accessibilityerrcode/entry/src/main/ets/TestAbility/TestAbility.ts +++ b/barrierfree/accessibilityerrcode/entry/src/main/ets/TestAbility/TestAbility.ts @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Ability from '@ohos.application.Ability' +import Ability from '@ohos.app.ability.UIAbility' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import { Hypium } from '@ohos/hypium' import testsuite from '../test/List.test' diff --git a/barrierfree/accessibilityerrcode/entry/src/main/ets/test/AccessibilityErrCode.test.ets b/barrierfree/accessibilityerrcode/entry/src/main/ets/test/AccessibilityErrCode.test.ets index 0e61e35684228b73eea99b36db35f3996e063db9..95ed5286679ad419eedecaad5375a160cca6d0f2 100644 --- a/barrierfree/accessibilityerrcode/entry/src/main/ets/test/AccessibilityErrCode.test.ets +++ b/barrierfree/accessibilityerrcode/entry/src/main/ets/test/AccessibilityErrCode.test.ets @@ -12,412 +12,999 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" -import accessibility from '@ohos.accessibility' +import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it } from '@ohos/hypium'; +import accessibility from '@ohos.accessibility'; +import GesturePath from '@ohos.accessibility.GesturePath'; +import GesturePoint from '@ohos.accessibility.GesturePoint'; +import AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtensionAbility'; const bundleName = 'com.sample.testfora11y'; const triggerAction = 'accessibilityFocus'; const eventType = 'accessibilityFocus'; export default function abilityTest() { - describe('AccessibilityErrCode', function () { + describe('AccessibilityErrCode', function () { + let axContext = null; + let object = null; + beforeEach(async function (done) { + console.info(`AccessibilityErrCode: beforeEach starts`); + done(); + }) + + afterEach(async function (done) { + console.info(`AccessibilityErrCode: afterEach starts`); + setTimeout(done, 1000); + }) + + /* Cases for namespace accessibility */ + /* + * @tc.number AbilityExtensionList_0100 + * @tc.name AbilityExtensionList_0100 + * @tc.desc The parameters input are 'audible' and 'install', test the getAccessibilityExtensionList() + * function, and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityExtensionList_0100', 0, async function (done) { + console.info('AbilityExtensionList_0100'); + accessibility.getAccessibilityExtensionList('audible', 'install', (err, data) => { + if (err && err.code != 0) { + console.error(`AccessibilityErrCodeTest: AbilityExtensionList_0100 has error: ${err.code}`); + expect(null).assertFail(); + done(); + } + console.info(`AccessibilityErrCodeTest: AbilityExtensionList_0100 result ${data.length}`); + expect(Array.isArray(data)).assertEqual(true); + done(); + }); + }) + + /* + * @tc.number AbilityExtensionList_0200 + * @tc.name AbilityExtensionList_0200 + * @tc.desc The parameters input are 'audible' and 'install', test the getAccessibilityExtensionList() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityExtensionList_0200', 0, async function (done) { + console.info('AbilityExtensionList_0200'); + accessibility.getAccessibilityExtensionList('audible', 'install').then((result) => { + console.info(`AccessibilityErrCodeTest: AbilityExtensionList_0200 result ${result.length}`); + expect(Array.isArray(result)).assertEqual(true); + done(); + }).catch((err) => { + console.error(`AccessibilityErrCodeTest: AbilityExtensionList_0200 has error: ${err}`); + expect(null).assertFail(); + done(); + }); + }) + + /* + * @tc.number AbilityExtensionList_0300 + * @tc.name AbilityExtensionList_0300 + * @tc.desc The parameters input are 'generic' and 'install', test the getAccessibilityExtensionList() + * function, and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityExtensionList_0300', 0, async function (done) { + console.info('AbilityExtensionList_0300'); + accessibility.getAccessibilityExtensionList('generic', 'install', (err, data) => { + if (err && err.code != 0) { + console.error(`AccessibilityErrCodeTest: AbilityExtensionList_0300 has error: ${err.code}`); + expect(null).assertFail(); + done(); + } + console.info(`AccessibilityErrCodeTest: AbilityExtensionList_0300 result ${data.length}`); + expect(Array.isArray(data)).assertEqual(true); + done(); + }); + }) + + /* + * @tc.number AbilityExtensionList_0400 + * @tc.name AbilityExtensionList_0400 + * @tc.desc The parameters input are 'generic' and 'install', test the getAccessibilityExtensionList() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityExtensionList_0400', 0, async function (done) { + console.info('AbilityExtensionList_0400'); + accessibility.getAccessibilityExtensionList('generic', 'install').then((result) => { + console.info(`AccessibilityErrCodeTest: AbilityExtensionList_0400 result ${result.length}`); + expect(Array.isArray(result)).assertEqual(true); + done(); + }).catch((err) => { + console.error(`AccessibilityErrCodeTest: AbilityExtensionList_0400 has error: ${err}`); + expect(null).assertFail(); + done(); + }); + }) + + /* + * @tc.number AbilityExtensionList_0500 + * @tc.name AbilityExtensionList_0500 + * @tc.desc The parameters input are 'generic' and 'install', test the getAccessibilityExtensionList() + * function, and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityExtensionList_0500', 0, async function (done) { + console.info('AbilityExtensionList_0500'); + accessibility.getAccessibilityExtensionList('generic', 'install', (err, data) => { + if (err && err.code != 0) { + console.error(`AccessibilityErrCodeTest: AbilityExtensionList_0500 has error: ${err.code}`); + expect(null).assertFail(); + done(); + } + console.info(`AccessibilityErrCodeTest: AbilityExtensionList_0500 result ${data.length}`); + expect(Array.isArray(data)).assertEqual(true); + done(); + }); + }) + + /* + * @tc.number AbilityExtensionList_0600 + * @tc.name AbilityExtensionList_0600 + * @tc.desc The parameters input are 'generic' and 'install', test the getAccessibilityExtensionList() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityExtensionList_0600', 0, async function (done) { + console.info('AbilityExtensionList_0600'); + accessibility.getAccessibilityExtensionList('generic', 'install').then((result) => { + console.info(`AccessibilityErrCodeTest: AbilityExtensionList_0600 result ${result.length}`); + expect(Array.isArray(result)).assertEqual(true); + done(); + }).catch((err) => { + console.error(`AccessibilityErrCodeTest: AbilityExtensionList_0600 has error: ${err}`); + expect(null).assertFail(); + done(); + }); + }) + + /* + * @tc.number AbilityExtensionList_0700 + * @tc.name AbilityExtensionList_0700 + * @tc.desc The parameters input are 'haptic' and 'install', test the getAccessibilityExtensionList() + * function, and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityExtensionList_0700', 0, async function (done) { + console.info('AbilityExtensionList_0700'); + accessibility.getAccessibilityExtensionList('haptic', 'install', (err, data) => { + if (err && err.code != 0) { + console.error(`AccessibilityErrCodeTest: AbilityExtensionList_0700 has error: ${err.code}`); + expect(null).assertFail(); + done(); + } + console.info(`AccessibilityErrCodeTest: AbilityExtensionList_0700 result ${data.length}`); + expect(Array.isArray(data)).assertEqual(true); + done(); + }); + }) + + /* + * @tc.number AbilityExtensionList_0800 + * @tc.name AbilityExtensionList_0800 + * @tc.desc The parameters input are 'haptic' and 'install', test the getAccessibilityExtensionList() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityExtensionList_0800', 0, async function (done) { + console.info('AbilityExtensionList_0800'); + accessibility.getAccessibilityExtensionList('haptic', 'install').then((result) => { + console.info(`AccessibilityErrCodeTest: AbilityExtensionList_0800 result ${result.length}`); + expect(Array.isArray(result)).assertEqual(true); + done(); + }).catch((err) => { + console.error(`AccessibilityErrCodeTest: AbilityExtensionList_0800 has error: ${err}`); + expect(null).assertFail(); + done(); + }); + }) + + /* + * @tc.number AbilityExtensionList_0900 + * @tc.name AbilityExtensionList_0900 + * @tc.desc The parameters input are 'spoken' and 'install', test the getAccessibilityExtensionList() + * function, and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityExtensionList_0900', 0, async function (done) { + console.info('AbilityExtensionList_0900'); + accessibility.getAccessibilityExtensionList('spoken', 'install', (err, data) => { + if (err && err.code != 0) { + console.error(`AccessibilityErrCodeTest: AbilityExtensionList_0900 has error: ${err.code}`); + expect(null).assertFail(); + done(); + } + console.info(`AccessibilityErrCodeTest: AbilityExtensionList_0900 result ${data.length}`); + expect(Array.isArray(data)).assertEqual(true); + done(); + }); + }) + + /* + * @tc.number AbilityExtensionList_1000 + * @tc.name AbilityExtensionList_1000 + * @tc.desc The parameters input are 'spoken' and 'install', test the getAccessibilityExtensionList() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityExtensionList_1000', 0, async function (done) { + console.info('AbilityExtensionList_1000'); + accessibility.getAccessibilityExtensionList('spoken', 'install').then((result) => { + console.info(`AccessibilityErrCodeTest: AbilityExtensionList_1000 result ${result.length}`); + expect(Array.isArray(result)).assertEqual(true); + done(); + }).catch((err) => { + console.error(`AccessibilityErrCodeTest: AbilityExtensionList_1000 has error: ${err}`); + expect(null).assertFail(); + done(); + }); + }) + + /* + * @tc.number AbilityExtensionList_1100 + * @tc.name AbilityExtensionList_1100 + * @tc.desc The parameters input are 'visual' and 'install', test the getAccessibilityExtensionList() + * function, and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityExtensionList_1100', 0, async function (done) { + console.info('AbilityExtensionList_1100'); + accessibility.getAccessibilityExtensionList('visual', 'install', (err, data) => { + if (err && err.code != 0) { + console.error(`AccessibilityErrCodeTest: AbilityExtensionList_1100 has error: ${err.code}`); + expect(null).assertFail(); + done(); + } + console.info(`AccessibilityErrCodeTest: AbilityExtensionList_1100 result ${data.length}`); + expect(Array.isArray(data)).assertEqual(true); + done(); + }); + }) + + /* + * @tc.number AbilityExtensionList_1200 + * @tc.name AbilityExtensionList_1200 + * @tc.desc The parameters input are 'visual' and 'install', test the getAccessibilityExtensionList() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityExtensionList_1200', 0, async function (done) { + console.info('AbilityExtensionList_1200'); + accessibility.getAccessibilityExtensionList('visual', 'install').then((result) => { + console.info(`AccessibilityErrCodeTest: AbilityExtensionList_1200 result ${result.length}`); + expect(Array.isArray(result)).assertEqual(true); + done(); + }).catch((err) => { + console.error(`AccessibilityErrCodeTest: AbilityExtensionList_1200 has error: ${err}`); + expect(null).assertFail(); + done(); + }); + }) + + /* + * @tc.number AbilityExtensionList_1300 + * @tc.name AbilityExtensionList_1300 + * @tc.desc The parameters input are 'all' and 'enable', test the getAccessibilityExtensionList() + * function, and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityExtensionList_1300', 0, async function (done) { + console.info('AbilityExtensionList_1300'); + accessibility.getAccessibilityExtensionList('all', 'enable', (err, data) => { + if (err && err.code != 0) { + console.error(`AccessibilityErrCodeTest: AbilityExtensionList_1300 has error: ${err.code}`); + expect(null).assertFail(); + done(); + } + console.info(`AccessibilityErrCodeTest: AbilityExtensionList_1300 result ${data.length}`); + expect(Array.isArray(data)).assertEqual(true); + done(); + }); + }) + + /* + * @tc.number AbilityExtensionList_1400 + * @tc.name AbilityExtensionList_1400 + * @tc.desc The parameters input are 'all' and 'enable', test the getAccessibilityExtensionList() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityExtensionList_1400', 0, async function (done) { + console.info('AbilityExtensionList_1400'); + accessibility.getAccessibilityExtensionList('all', 'enable').then((result) => { + console.info(`AccessibilityErrCodeTest: AbilityExtensionList_1400 result ${result.length}`); + expect(Array.isArray(result)).assertEqual(true); + done(); + }).catch((err) => { + console.error(`AccessibilityErrCodeTest: AbilityExtensionList_1400 has error: ${err}`); + expect(null).assertFail(); + done(); + }); + }) + + /* + * @tc.number AbilityExtensionList_1500 + * @tc.name AbilityExtensionList_1500 + * @tc.desc The parameters input are 'all' and 'disable', test the getAccessibilityExtensionList() + * function, and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityExtensionList_1500', 0, async function (done) { + console.info('AbilityExtensionList_1500'); + accessibility.getAccessibilityExtensionList('all', 'disable', (err, data) => { + if (err && err.code != 0) { + console.error(`AccessibilityErrCodeTest: AbilityExtensionList_1500 has error: ${err.code}`); + expect(null).assertFail(); + done(); + } + console.info(`AccessibilityErrCodeTest: AbilityExtensionList_1500 result ${data.length}`); + expect(Array.isArray(data)).assertEqual(true); + done(); + }); + }) + + /* + * @tc.number AbilityExtensionList_1600 + * @tc.name AbilityExtensionList_1600 + * @tc.desc The parameters input are 'all' and 'disable', test the getAccessibilityExtensionList() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityExtensionList_1600', 0, async function (done) { + console.info('AbilityExtensionList_1600'); + accessibility.getAccessibilityExtensionList('all', 'disable').then((result) => { + console.info(`AccessibilityErrCodeTest: AbilityExtensionList_1600 result ${result.length}`); + expect(Array.isArray(result)).assertEqual(true); + done(); + }).catch((err) => { + console.error(`AccessibilityErrCodeTest: AbilityExtensionList_1600 has error: ${err}`); + expect(null).assertFail(); + done(); + }); + }) + + /* + * @tc.number AbilityExtensionList_1700 + * @tc.name AbilityExtensionList_1700 + * @tc.desc The parameters input are 'all' and 'install', test the getAccessibilityExtensionList() + * function, and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityExtensionList_1700', 0, async function (done) { + console.info('AbilityExtensionList_1700'); + accessibility.getAccessibilityExtensionList('all', 'install', (err, data) => { + if (err && err.code != 0) { + console.error(`AccessibilityErrCodeTest: AbilityExtensionList_1700 has error: ${err.code}`); + expect(null).assertFail(); + done(); + } + console.info(`AccessibilityErrCodeTest: AbilityExtensionList_1700 result ${data.length}`); + expect(Array.isArray(data)).assertEqual(true); + done(); + }); + }) + + /* + * @tc.number AbilityExtensionList_1800 + * @tc.name AbilityExtensionList_1800 + * @tc.desc The parameters input are 'all' and 'install', test the getAccessibilityExtensionList() function, + * and the output is the list of AccessibilityAbilityInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityExtensionList_1800', 0, async function (done) { + console.info('AbilityExtensionList_1800'); + accessibility.getAccessibilityExtensionList('all', 'install').then((result) => { + console.info(`AccessibilityErrCodeTest: AbilityExtensionList_1800 result ${result.length}`); + expect(Array.isArray(result)).assertEqual(true); + done(); + }).catch((err) => { + console.error(`AccessibilityErrCodeTest: AbilityExtensionList_1800 has error: ${err}`); + expect(null).assertFail(); + done(); + }); + }) + + /* + * @tc.number AccessibilityEventInfo_0100 + * @tc.name AccessibilityEventInfo_0100 + * @tc.desc test Accessibility EventInfo + * @tc.size SmallTest + * @tc.type User + */ + it('AccessibilityEventInfo_0100', 0, async function (done) { + let eventInfo = new accessibility.EventInfo({ + 'type': 'click', + 'bundleName': 'com.example.MyApplication', + 'triggerAction': 'click' + }); + expect(eventInfo != null).assertTrue(); + done(); + }) + + + /* + * @tc.number AccessibilitySendEventCallBack_0100 + * @tc.name AccessibilitySendEventCallBack_0100 + * @tc.desc test Accessibility SendEvent CallBack + * @tc.size SmallTest + * @tc.type User + */ + it('AccessibilitySendEventCallBack_0100', 0, async function (done) { + let event = null; + accessibility.sendEvent(event, (err, data) => { + if (err) { + console.error('failed to sendEvent because ' + JSON.stringify(err)); + done(); + return; + } + console.info('success data:sendEvent : ' + JSON.stringify(data)) + expect(null).assertFail(); + done(); + }) + }) + /* + * @tc.number AbilityCapability_0100 + * @tc.name AbilityCapability_0100 + * @tc.desc test Ability Capability + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityCapability_0100', 0, async function (done) { + accessibility.getAbilityLists('audible', 'enable', (err, data) => { + if (err) { + console.error('failed to get accessibility extension list because ' + JSON.stringify(err)); + done(); + return; + } + for (let accessibilityAbilityInfo of data) { + expect(accessibilityAbilityInfo.capabilities.length >= 0).assertTrue(); + expect(accessibilityAbilityInfo.abilityTypes.length >= 0).assertTrue(); + expect(accessibilityAbilityInfo.eventTypes.length >= 0).assertTrue(); + expect(accessibilityAbilityInfo.targetBundleNames.length >= 0).assertTrue(); + expect(accessibilityAbilityInfo.bundleName != null).assertTrue(); + expect(accessibilityAbilityInfo.description != null).assertTrue(); + expect(accessibilityAbilityInfo.id != null).assertTrue(); + expect(accessibilityAbilityInfo.name != null).assertTrue(); + for (let capability of accessibilityAbilityInfo.capabilities) { + let cap = capability.toString(); + expect(cap == 'retrieve' || + cap == 'touchGuide' || + cap == 'keyEventObserver' || + cap == 'zoom' || + cap == 'gesture') + .assertTrue(); + } + } + console.info('get accessibility extension list success'); + done(); + }) + }) + + /* + * @tc.number AbilityCaptionsManager_0100 + * @tc.name AbilityCaptionsManager_0100 + * @tc.desc test Ability Captions Manager + * @tc.size SmallTest + * @tc.type User + */ + it('AbilityCaptionsManager_0100', 0, async function (done) { + let captionsManager = accessibility.getCaptionsManager(); + expect(captionsManager.enabled == true || captionsManager.enabled == false).assertTrue(); + expect(captionsManager.style != null).assertTrue(); + expect(captionsManager.style.backgroundColor != null).assertTrue(); + expect(captionsManager.style.fontColor != null).assertTrue(); + expect(captionsManager.style.fontEdgeType != null).assertTrue(); + expect(captionsManager.style.fontFamily != null).assertTrue(); + expect(captionsManager.style.fontScale != null).assertTrue(); + expect(captionsManager.style.windowColor != null).assertTrue(); + done(); + }) + + /* + * @tc.number GesturePathAndPoint_0100 + * @tc.name GesturePathAndPoint_0100 + * @tc.desc test GesturePath And GesturePoint + * @tc.size SmallTest + * @tc.type User + */ + it('GesturePathAndPoint_0100', 0, async function (done) { + let gesturePath = new GesturePath.GesturePath(20); + let gesturePoint = new GesturePoint.GesturePoint(1, 2); + gesturePath.points.push(gesturePoint); + expect(gesturePath.points.length != 0).assertTrue(); + expect(gesturePath.durationTime == 20).assertTrue(); + expect(gesturePoint.positionX == 1).assertTrue(); + expect(gesturePoint.positionY == 2).assertTrue(); + done(); + }) + + function init() { + class MainAbility extends AccessibilityExtensionAbility { + onConnect(): void { + console.log('AxExtensionAbility onConnect'); + axContext = this.context; + } + + onDisconnect() { + console.log('AxExtensionAbility onDisconnect'); + } + + onAccessibilityEvent(event) { + console.log('AxExtensionAbility onAccessibilityEvent'); + expect(event.eventType != null).assertTrue(); + expect(event.target != null).assertTrue(); + expect(event.timeStamp != null).assertTrue(); + } + + onKeyEvent(keyEvent) { + console.log('AxExtensionAbility onKeyEvent'); + if (keyEvent.keyCode == 22) { + console.log('AxExtensionAbility onKeyEvent: intercept 22'); + return true; + } + return false; + } + } + + object = new MainAbility(); + object.onConnect(); + setTimeout("", 3000); + } - beforeEach(async function (done) { - console.info(`AccessibilityErrCode: beforeEach starts`); + /* + * @tc.number AccessibilitySetTargetBundleName_0100 + * @tc.name AccessibilitySetTargetBundleName_0100 + * @tc.desc test AccessibilitySetTargetBundleName + * @tc.size SmallTest + * @tc.type User + */ + it('AccessibilitySetTargetBundleName_0100', 0, async function (done) { + init(); + if (axContext != null) { + let targetNames = ['com.ohos.xyz']; + try { + axContext.setTargetBundleName(targetNames).then(() => { done(); - }) - - afterEach(async function (done) { - console.info(`AccessibilityErrCode: afterEach starts`); - setTimeout(done, 1000); - }) - - /* Cases for namespace accessibility */ - /* - * @tc.number AbilityExtensionList_0100 - * @tc.name AbilityExtensionList_0100 - * @tc.desc The parameters input are 'audible' and 'install', test the getAccessibilityExtensionList() - * function, and the output is the list of AccessibilityAbilityInfo - * @tc.size SmallTest - * @tc.type User - */ - it('AbilityExtensionList_0100', 0, async function (done) { - console.info('AbilityExtensionList_0100'); - accessibility.getAccessibilityExtensionList('audible', 'install', (err, data) => { - if (err && err.code != 0) { - console.error(`AccessibilityErrCodeTest: AbilityExtensionList_0100 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - console.info(`AccessibilityErrCodeTest: AbilityExtensionList_0100 result ${data.length}`); - expect(Array.isArray(data)).assertEqual(true); - done(); - }); - }) - - /* - * @tc.number AbilityExtensionList_0200 - * @tc.name AbilityExtensionList_0200 - * @tc.desc The parameters input are 'audible' and 'install', test the getAccessibilityExtensionList() function, - * and the output is the list of AccessibilityAbilityInfo - * @tc.size SmallTest - * @tc.type User - */ - it('AbilityExtensionList_0200', 0, async function (done) { - console.info('AbilityExtensionList_0200'); - accessibility.getAccessibilityExtensionList('audible', 'install').then((result) => { - console.info(`AccessibilityErrCodeTest: AbilityExtensionList_0200 result ${result.length}`); - expect(Array.isArray(result)).assertEqual(true); - done(); + }).catch((err) => { + console.info('AccessibilitySetTargetBundleName_0100 err:' + JSON.stringify(err)); + done(); + }); + } catch (exception) { + console.error('failed to set target bundle names, because ' + JSON.stringify(exception)); + expect(false).assertTrue(); + done(); + } + } else { + console.log('axContext null'); + done(); + } + }) + + /* + * @tc.number AccessibilitySetTargetBundleName_0200 + * @tc.name AccessibilitySetTargetBundleName_0200 + * @tc.desc test AccessibilitySetTargetBundleName + * @tc.size SmallTest + * @tc.type User + */ + it('AccessibilitySetTargetBundleName_0200', 0, async function (done) { + if (axContext != null) { + let targetNames = ['com.ohos.xyz']; + try { + axContext.setTargetBundleName(targetNames, (err, data) => { + console.info('AccessibilitySetTargetBundleName_0200 err' + JSON.stringify(err) + ' data:' + JSON.stringify(data)); + done(); + }); + } catch (exception) { + console.error('failed to set target bundle names, because ' + JSON.stringify(exception)); + expect(false).assertTrue(); + done(); + } + } else { + console.log('axContext null'); + done(); + } + }) + + /* + * @tc.number AccessibilityGetFocusElement_0100 + * @tc.name AccessibilityGetFocusElement_0100 + * @tc.desc test AccessibilityGetFocusElement + * @tc.size SmallTest + * @tc.type User + */ + it('AccessibilityGetFocusElement_0100', 0, async function (done) { + if (axContext != null) { + try { + axContext.getFocusElement().then((rootElement) => { + console.info('AccessibilityGetFocusElement_0100 rootElement:' + JSON.stringify(rootElement)); + rootElement.attributeNames().then((data) => { + console.log('get attribute names success'); + if (data != null) { + expect(data.rect.left != -1).assertTrue(); + expect(data.rect.top != -1).assertTrue(); + expect(data.rect.width != -1).assertTrue(); + expect(data.rect.height != -1).assertTrue(); + } }).catch((err) => { - console.error(`AccessibilityErrCodeTest: AbilityExtensionList_0200 has error: ${err}`); - expect(null).assertFail(); - done(); + console.log('failed to get attribute names, because ' + JSON.stringify(err)); }); - }) - - /* - * @tc.number AbilityExtensionList_0300 - * @tc.name AbilityExtensionList_0300 - * @tc.desc The parameters input are 'generic' and 'install', test the getAccessibilityExtensionList() - * function, and the output is the list of AccessibilityAbilityInfo - * @tc.size SmallTest - * @tc.type User - */ - it('AbilityExtensionList_0300', 0, async function (done) { - console.info('AbilityExtensionList_0300'); - accessibility.getAccessibilityExtensionList('generic', 'install', (err, data) => { - if (err && err.code != 0) { - console.error(`AccessibilityErrCodeTest: AbilityExtensionList_0300 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - console.info(`AccessibilityErrCodeTest: AbilityExtensionList_0300 result ${data.length}`); - expect(Array.isArray(data)).assertEqual(true); - done(); - }); - }) - - /* - * @tc.number AbilityExtensionList_0400 - * @tc.name AbilityExtensionList_0400 - * @tc.desc The parameters input are 'generic' and 'install', test the getAccessibilityExtensionList() function, - * and the output is the list of AccessibilityAbilityInfo - * @tc.size SmallTest - * @tc.type User - */ - it('AbilityExtensionList_0400', 0, async function (done) { - console.info('AbilityExtensionList_0400'); - accessibility.getAccessibilityExtensionList('generic', 'install').then((result) => { - console.info(`AccessibilityErrCodeTest: AbilityExtensionList_0400 result ${result.length}`); - expect(Array.isArray(result)).assertEqual(true); - done(); + rootElement.attributeValue('name').then((data) => { + console.log('get attribute value by name success'); }).catch((err) => { - console.error(`AccessibilityErrCodeTest: AbilityExtensionList_0400 has error: ${err}`); - expect(null).assertFail(); - done(); - }); - }) - - /* - * @tc.number AbilityExtensionList_0500 - * @tc.name AbilityExtensionList_0500 - * @tc.desc The parameters input are 'generic' and 'install', test the getAccessibilityExtensionList() - * function, and the output is the list of AccessibilityAbilityInfo - * @tc.size SmallTest - * @tc.type User - */ - it('AbilityExtensionList_0500', 0, async function (done) { - console.info('AbilityExtensionList_0500'); - accessibility.getAccessibilityExtensionList('generic', 'install', (err, data) => { - if (err && err.code != 0) { - console.error(`AccessibilityErrCodeTest: AbilityExtensionList_0500 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - console.info(`AccessibilityErrCodeTest: AbilityExtensionList_0500 result ${data.length}`); - expect(Array.isArray(data)).assertEqual(true); - done(); + console.log('failed to get attribute value, because ' + JSON.stringify(err)); }); - }) - - /* - * @tc.number AbilityExtensionList_0600 - * @tc.name AbilityExtensionList_0600 - * @tc.desc The parameters input are 'generic' and 'install', test the getAccessibilityExtensionList() function, - * and the output is the list of AccessibilityAbilityInfo - * @tc.size SmallTest - * @tc.type User - */ - it('AbilityExtensionList_0600', 0, async function (done) { - console.info('AbilityExtensionList_0600'); - accessibility.getAccessibilityExtensionList('generic', 'install').then((result) => { - console.info(`AccessibilityErrCodeTest: AbilityExtensionList_0600 result ${result.length}`); - expect(Array.isArray(result)).assertEqual(true); - done(); + rootElement.actionNames().then((data) => { + console.log('get action names success'); }).catch((err) => { - console.error(`AccessibilityErrCodeTest: AbilityExtensionList_0600 has error: ${err}`); - expect(null).assertFail(); - done(); + console.log('failed to get action names because ' + JSON.stringify(err)); }); - }) - - /* - * @tc.number AbilityExtensionList_0700 - * @tc.name AbilityExtensionList_0700 - * @tc.desc The parameters input are 'haptic' and 'install', test the getAccessibilityExtensionList() - * function, and the output is the list of AccessibilityAbilityInfo - * @tc.size SmallTest - * @tc.type User - */ - it('AbilityExtensionList_0700', 0, async function (done) { - console.info('AbilityExtensionList_0700'); - accessibility.getAccessibilityExtensionList('haptic', 'install', (err, data) => { - if (err && err.code != 0) { - console.error(`AccessibilityErrCodeTest: AbilityExtensionList_0700 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - console.info(`AccessibilityErrCodeTest: AbilityExtensionList_0700 result ${data.length}`); - expect(Array.isArray(data)).assertEqual(true); - done(); - }); - }) - - /* - * @tc.number AbilityExtensionList_0800 - * @tc.name AbilityExtensionList_0800 - * @tc.desc The parameters input are 'haptic' and 'install', test the getAccessibilityExtensionList() function, - * and the output is the list of AccessibilityAbilityInfo - * @tc.size SmallTest - * @tc.type User - */ - it('AbilityExtensionList_0800', 0, async function (done) { - console.info('AbilityExtensionList_0800'); - accessibility.getAccessibilityExtensionList('haptic', 'install').then((result) => { - console.info(`AccessibilityErrCodeTest: AbilityExtensionList_0800 result ${result.length}`); - expect(Array.isArray(result)).assertEqual(true); - done(); + rootElement.performAction('action').then((data) => { + console.info('perform action success'); }).catch((err) => { - console.error(`AccessibilityErrCodeTest: AbilityExtensionList_0800 has error: ${err}`); - expect(null).assertFail(); - done(); + console.log('failed to perform action, because ' + JSON.stringify(err)); }); - }) - - /* - * @tc.number AbilityExtensionList_0900 - * @tc.name AbilityExtensionList_0900 - * @tc.desc The parameters input are 'spoken' and 'install', test the getAccessibilityExtensionList() - * function, and the output is the list of AccessibilityAbilityInfo - * @tc.size SmallTest - * @tc.type User - */ - it('AbilityExtensionList_0900', 0, async function (done) { - console.info('AbilityExtensionList_0900'); - accessibility.getAccessibilityExtensionList('spoken', 'install', (err, data) => { - if (err && err.code != 0) { - console.error(`AccessibilityErrCodeTest: AbilityExtensionList_0900 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - console.info(`AccessibilityErrCodeTest: AbilityExtensionList_0900 result ${data.length}`); - expect(Array.isArray(data)).assertEqual(true); - done(); + done(); + }).catch((err) => { + console.info('AccessibilityGetFocusElement_0100 err:' + JSON.stringify(err)); + done(); + }); + } catch (exception) { + console.error('failed to get focus element, because ' + JSON.stringify(exception)); + expect(false).assertTrue(); + done(); + } + } else { + console.log('axContext null'); + done(); + } + }) + /* + * @tc.number AccessibilityGetFocusElement_0200 + * @tc.name AccessibilityGetFocusElement_0200 + * @tc.desc test AccessibilityGetFocusElement + * @tc.size SmallTest + * @tc.type User + */ + it('AccessibilityGetFocusElement_0200', 0, async function (done) { + if (axContext != null) { + try { + axContext.getFocusElement((err, rootElement) => { + if (err) { + console.error('failed to get focus element, because ' + JSON.stringify(err)); + done(); + return; + } + rootElement.attributeNames((err, data) => { + console.info('AccessibilityGetFocusElement_0200 err' + JSON.stringify(err) + ' data:' + JSON.stringify(data)); }); - }) - - /* - * @tc.number AbilityExtensionList_1000 - * @tc.name AbilityExtensionList_1000 - * @tc.desc The parameters input are 'spoken' and 'install', test the getAccessibilityExtensionList() function, - * and the output is the list of AccessibilityAbilityInfo - * @tc.size SmallTest - * @tc.type User - */ - it('AbilityExtensionList_1000', 0, async function (done) { - console.info('AbilityExtensionList_1000'); - accessibility.getAccessibilityExtensionList('spoken', 'install').then((result) => { - console.info(`AccessibilityErrCodeTest: AbilityExtensionList_1000 result ${result.length}`); - expect(Array.isArray(result)).assertEqual(true); - done(); - }).catch((err) => { - console.error(`AccessibilityErrCodeTest: AbilityExtensionList_1000 has error: ${err}`); - expect(null).assertFail(); - done(); + rootElement.attributeValue('name', (err, data) => { + console.info('AccessibilityGetFocusElement_0200 err' + JSON.stringify(err) + ' data:' + JSON.stringify(data)); }); - }) - - /* - * @tc.number AbilityExtensionList_1100 - * @tc.name AbilityExtensionList_1100 - * @tc.desc The parameters input are 'visual' and 'install', test the getAccessibilityExtensionList() - * function, and the output is the list of AccessibilityAbilityInfo - * @tc.size SmallTest - * @tc.type User - */ - it('AbilityExtensionList_1100', 0, async function (done) { - console.info('AbilityExtensionList_1100'); - accessibility.getAccessibilityExtensionList('visual', 'install', (err, data) => { - if (err && err.code != 0) { - console.error(`AccessibilityErrCodeTest: AbilityExtensionList_1100 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - console.info(`AccessibilityErrCodeTest: AbilityExtensionList_1100 result ${data.length}`); - expect(Array.isArray(data)).assertEqual(true); - done(); + rootElement.actionNames((err, data) => { + console.info('AccessibilityGetFocusElement_0200 err' + JSON.stringify(err) + ' data:' + JSON.stringify(data)); }); - }) - - /* - * @tc.number AbilityExtensionList_1200 - * @tc.name AbilityExtensionList_1200 - * @tc.desc The parameters input are 'visual' and 'install', test the getAccessibilityExtensionList() function, - * and the output is the list of AccessibilityAbilityInfo - * @tc.size SmallTest - * @tc.type User - */ - it('AbilityExtensionList_1200', 0, async function (done) { - console.info('AbilityExtensionList_1200'); - accessibility.getAccessibilityExtensionList('visual', 'install').then((result) => { - console.info(`AccessibilityErrCodeTest: AbilityExtensionList_1200 result ${result.length}`); - expect(Array.isArray(result)).assertEqual(true); - done(); - }).catch((err) => { - console.error(`AccessibilityErrCodeTest: AbilityExtensionList_1200 has error: ${err}`); - expect(null).assertFail(); - done(); + rootElement.performAction('action', (err, data) => { + console.info('AccessibilityGetFocusElement_0200 err' + JSON.stringify(err) + ' data:' + JSON.stringify(data)); }); - }) - - /* - * @tc.number AbilityExtensionList_1300 - * @tc.name AbilityExtensionList_1300 - * @tc.desc The parameters input are 'all' and 'enable', test the getAccessibilityExtensionList() - * function, and the output is the list of AccessibilityAbilityInfo - * @tc.size SmallTest - * @tc.type User - */ - it('AbilityExtensionList_1300', 0, async function (done) { - console.info('AbilityExtensionList_1300'); - accessibility.getAccessibilityExtensionList('all', 'enable', (err, data) => { - if (err && err.code != 0) { - console.error(`AccessibilityErrCodeTest: AbilityExtensionList_1300 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - console.info(`AccessibilityErrCodeTest: AbilityExtensionList_1300 result ${data.length}`); - expect(Array.isArray(data)).assertEqual(true); - done(); + let actionName = 'action'; + let parameters = { + 'setText': 'test text' + }; + rootElement.performAction(actionName, parameters, (err, data) => { + console.info('AccessibilityGetFocusElement_0200 err' + JSON.stringify(err) + ' data:' + JSON.stringify(data)); }); - }) - - /* - * @tc.number AbilityExtensionList_1400 - * @tc.name AbilityExtensionList_1400 - * @tc.desc The parameters input are 'all' and 'enable', test the getAccessibilityExtensionList() function, - * and the output is the list of AccessibilityAbilityInfo - * @tc.size SmallTest - * @tc.type User - */ - it('AbilityExtensionList_1400', 0, async function (done) { - console.info('AbilityExtensionList_1400'); - accessibility.getAccessibilityExtensionList('all', 'enable').then((result) => { - console.info(`AccessibilityErrCodeTest: AbilityExtensionList_1400 result ${result.length}`); - expect(Array.isArray(result)).assertEqual(true); - done(); + done(); + }); + } catch (exception) { + console.error('failed to get focus element, because ' + JSON.stringify(exception)); + expect(false).assertTrue(); + done(); + } + } else { + console.log('axContext null'); + done(); + } + }) + /* + * @tc.number AccessibilityGetFocusElement_0300 + * @tc.name AccessibilityGetFocusElement_0300 + * @tc.desc test AccessibilityGetFocusElement + * @tc.size SmallTest + * @tc.type User + */ + it('AccessibilityGetFocusElement_0300', 0, async function (done) { + if (axContext != null) { + let isAccessibilityFocus = true; + try { + axContext.getFocusElement(isAccessibilityFocus, (err, rootElement) => { + if (err) { + console.error('failed to get focus element, because ' + JSON.stringify(err)); + done(); + return; + } + rootElement.findElement('content', 'keyword').then((data) => { + console.log('data' + JSON.stringify(data)); }).catch((err) => { - console.error(`AccessibilityErrCodeTest: AbilityExtensionList_1400 has error: ${err}`); - expect(null).assertFail(); - done(); + console.log('failed to find element, because ' + JSON.stringify(err)); }); - }) - - /* - * @tc.number AbilityExtensionList_1500 - * @tc.name AbilityExtensionList_1500 - * @tc.desc The parameters input are 'all' and 'disable', test the getAccessibilityExtensionList() - * function, and the output is the list of AccessibilityAbilityInfo - * @tc.size SmallTest - * @tc.type User - */ - it('AbilityExtensionList_1500', 0, async function (done) { - console.info('AbilityExtensionList_1500'); - accessibility.getAccessibilityExtensionList('all', 'disable', (err, data) => { - if (err && err.code != 0) { - console.error(`AccessibilityErrCodeTest: AbilityExtensionList_1500 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - console.info(`AccessibilityErrCodeTest: AbilityExtensionList_1500 result ${data.length}`); - expect(Array.isArray(data)).assertEqual(true); - done(); + rootElement.findElement('content', 'keyword', (err, data) => { + console.info('AccessibilityGetFocusElement_0300 err' + JSON.stringify(err) + ' data:' + JSON.stringify(data)); }); - }) - - /* - * @tc.number AbilityExtensionList_1600 - * @tc.name AbilityExtensionList_1600 - * @tc.desc The parameters input are 'all' and 'disable', test the getAccessibilityExtensionList() function, - * and the output is the list of AccessibilityAbilityInfo - * @tc.size SmallTest - * @tc.type User - */ - it('AbilityExtensionList_1600', 0, async function (done) { - console.info('AbilityExtensionList_1600'); - accessibility.getAccessibilityExtensionList('all', 'disable').then((result) => { - console.info(`AccessibilityErrCodeTest: AbilityExtensionList_1600 result ${result.length}`); - expect(Array.isArray(result)).assertEqual(true); - done(); + rootElement.findElement('focusType', 'normal').then((data) => { + console.log('data' + JSON.stringify(data)); }).catch((err) => { - console.error(`AccessibilityErrCodeTest: AbilityExtensionList_1600 has error: ${err}`); - expect(null).assertFail(); - done(); + console.log('failed to find element, because ' + JSON.stringify(err)); }); - }) - - /* - * @tc.number AbilityExtensionList_1700 - * @tc.name AbilityExtensionList_1700 - * @tc.desc The parameters input are 'all' and 'install', test the getAccessibilityExtensionList() - * function, and the output is the list of AccessibilityAbilityInfo - * @tc.size SmallTest - * @tc.type User - */ - it('AbilityExtensionList_1700', 0, async function (done) { - console.info('AbilityExtensionList_1700'); - accessibility.getAccessibilityExtensionList('all', 'install', (err, data) => { - if (err && err.code != 0) { - console.error(`AccessibilityErrCodeTest: AbilityExtensionList_1700 has error: ${err.code}`); - expect(null).assertFail(); - done(); - } - console.info(`AccessibilityErrCodeTest: AbilityExtensionList_1700 result ${data.length}`); - expect(Array.isArray(data)).assertEqual(true); - done(); + rootElement.findElement('focusType', 'normal', (err, data) => { + console.info('AccessibilityGetFocusElement_0300 err' + JSON.stringify(err) + ' data:' + JSON.stringify(data)); }); - }) - - /* - * @tc.number AbilityExtensionList_1800 - * @tc.name AbilityExtensionList_1800 - * @tc.desc The parameters input are 'all' and 'install', test the getAccessibilityExtensionList() function, - * and the output is the list of AccessibilityAbilityInfo - * @tc.size SmallTest - * @tc.type User - */ - it('AbilityExtensionList_1800', 0, async function (done) { - console.info('AbilityExtensionList_1800'); - accessibility.getAccessibilityExtensionList('all', 'install').then((result) => { - console.info(`AccessibilityErrCodeTest: AbilityExtensionList_1800 result ${result.length}`); - expect(Array.isArray(result)).assertEqual(true); - done(); + rootElement.findElement('focusDirection', 'up').then((data) => { + console.log('data' + JSON.stringify(data)); }).catch((err) => { - console.error(`AccessibilityErrCodeTest: AbilityExtensionList_1800 has error: ${err}`); - expect(null).assertFail(); - done(); + console.log('failed to find element, because ' + JSON.stringify(err)); + }); + rootElement.findElement('focusDirection', 'up', (err, data) => { + console.info('AccessibilityGetFocusElement_0300 err' + JSON.stringify(err) + ' data:' + JSON.stringify(data)); }); - }) + done(); + }); + } catch (exception) { + console.error('failed to get focus element, because ' + JSON.stringify(exception)); + expect(false).assertTrue(); + done(); + } + } else { + console.log('axContext null'); + done(); + } + }) + + /* + * @tc.number AccessibilityGetWindowRootElement_0100 + * @tc.name AccessibilityGetWindowRootElement_0100 + * @tc.desc test AccessibilityGetWindowRootElement + * @tc.size SmallTest + * @tc.type User + */ + it('AccessibilityGetWindowRootElement_0100', 0, async function (done) { + if (axContext != null) { + try { + axContext.getWindowRootElement().then((data) => { + console.info('AccessibilityGetWindowRootElement_0100 data:' + JSON.stringify(data)); + done(); + }).catch((err) => { + console.info('AccessibilityGetWindowRootElement_0100 err:' + JSON.stringify(err)); + done(); + }); + } catch (exception) { + console.error('failed to get root element of the window, ' + JSON.stringify(exception)); + expect(false).assertTrue(); + done(); + } + } else { + console.log('axContext null'); + done(); + } + }) + + + /* + * @tc.number AccessibilityGetWindowRootElement_0200 + * @tc.name AccessibilityGetWindowRootElement_0200 + * @tc.desc test AccessibilityGetWindowRootElement + * @tc.size SmallTest + * @tc.type User + */ + it('AccessibilityGetWindowRootElement_0200', 0, async function (done) { + if (axContext != null) { + try { + axContext.getWindowRootElement((err, data) => { + console.info('AccessibilityGetWindowRootElement_0200 err' + JSON.stringify(err) + ' data:' + JSON.stringify(data)); + done(); + }); + } catch (exception) { + console.error('failed to get root element of the window, because ' + JSON.stringify(exception)); + expect(false).assertTrue(); + done(); + } + } else { + console.log('axContext null'); + done(); + } + }) + + + /* + * @tc.number AccessibilityGetWindowRootElement_0300 + * @tc.name AccessibilityGetWindowRootElement_0300 + * @tc.desc test AccessibilityGetWindowRootElement + * @tc.size SmallTest + * @tc.type User + */ + it('AccessibilityGetWindowRootElement_0300', 0, async function (done) { + if (axContext != null) { + let windowId = 10; + try { + axContext.getWindowRootElement(windowId, (err, data) => { + console.info('AccessibilityGetWindowRootElement_0300 err' + JSON.stringify(err) + ' data:' + JSON.stringify(data)); + done(); + }); + } catch (exception) { + console.error('failed to get root element of the window, because ' + JSON.stringify(exception)); + expect(false).assertTrue(); + done(); + } + } else { + console.log('axContext null'); + done(); + } + }) + + + /* + * @tc.number AccessibilityGetWindows_0100 + * @tc.name AccessibilityGetWindows_0100 + * @tc.desc test AccessibilityGetWindows + * @tc.size SmallTest + * @tc.type User + */ + it('AccessibilityGetWindows_0100', 0, async function (done) { + if (axContext != null) { + try { + axContext.getWindows().then((data) => { + console.info('AccessibilityGetWindows_0100 data:' + JSON.stringify(data)); + done(); + }).catch((err) => { + console.info('AccessibilityGetWindows_0100 err' + JSON.stringify(err)); + done(); + }); + } catch (exception) { + console.error('failed to get windows, because ' + JSON.stringify(exception)); + expect(false).assertTrue(); + done(); + } + } else { + console.log('axContext null'); + done(); + } + }) + + + /* + * @tc.number AccessibilityGetWindows_0200 + * @tc.name AccessibilityGetWindows_0200 + * @tc.desc test AccessibilityGetWindows + * @tc.size SmallTest + * @tc.type User + */ + it('AccessibilityGetWindows_0200', 0, async function (done) { + if (axContext != null) { + try { + axContext.getWindows((err, data) => { + console.info('AccessibilityGetWindows_0200 err' + JSON.stringify(err) + ' data:' + JSON.stringify(data)); + done(); + }); + } catch (exception) { + console.error('failed to get windows, because ' + JSON.stringify(exception)); + expect(false).assertTrue(); + done(); + } + } else { + console.log('axContext null'); + done(); + } + }) + + + /* + * @tc.number AccessibilityGetWindows_0300 + * @tc.name AccessibilityGetWindows_0300 + * @tc.desc test AccessibilityGetWindows + * @tc.size SmallTest + * @tc.type User + */ + it('AccessibilityGetWindows_0300', 0, async function (done) { + if (axContext != null) { + let displayId = 10; + try { + axContext.getWindows(displayId, (err, data) => { + console.info('AccessibilityGetWindows_0300 err' + JSON.stringify(err) + ' data:' + JSON.stringify(data)); + done(); + }); + } catch (exception) { + console.error('failed to get windows, because ' + JSON.stringify(exception)); + expect(false).assertTrue(); + done(); + } + } else { + console.log('axContext null'); + done(); + } + }) + + + /* + * @tc.number AccessibilityInjectGesture_0100 + * @tc.name AccessibilityInjectGesture_0100 + * @tc.desc test AccessibilityInjectGesture + * @tc.size SmallTest + * @tc.type User + */ + it('AccessibilityInjectGesture_0100', 0, async function (done) { + if (axContext != null) { + let gesturePath = new GesturePath.GesturePath(100); + try { + for (let i = 0; i < 10; i++) { + let gesturePoint = new GesturePoint.GesturePoint(100, i * 200); + gesturePath.points.push(gesturePoint); + } + axContext.injectGesture(gesturePath).then(() => { + done(); + }).catch((err) => { + console.info('AccessibilityInjectGesture_0100 err' + JSON.stringify(err)); + done(); + }); + } catch (exception) { + console.error('failed to inject gesture, because ' + JSON.stringify(exception)); + expect(false).assertTrue(); + done(); + } + } else { + console.log('axContext null'); + done(); + } + }) + + + /* + * @tc.number AccessibilityInjectGesture_0200 + * @tc.name AccessibilityInjectGesture_0200 + * @tc.desc test AccessibilityInjectGesture + * @tc.size SmallTest + * @tc.type User + */ + it('AccessibilityInjectGesture_0200', 0, async function (done) { + if (axContext != null) { + let gesturePath = new GesturePath.GesturePath(100); + try { + for (let i = 0; i < 10; i++) { + let gesturePoint = new GesturePoint.GesturePoint(100, i * 200); + gesturePath.points.push(gesturePoint); + } + axContext.injectGesture(gesturePath, (err, data) => { + console.info('AccessibilityInjectGesture_0200 err' + JSON.stringify(err) + ' data:' + JSON.stringify(data)); + done(); + }); + } catch (exception) { + console.error('failed to inject gesture, because ' + JSON.stringify(exception)); + expect(false).assertTrue(); + done(); + } + } else { + console.log('axContext null'); + done(); + } }) + }) } \ No newline at end of file diff --git a/barrierfree/accessibilityerrcode/entry/src/main/module.json b/barrierfree/accessibilityerrcode/entry/src/main/module.json index e05c7b28f63a8bf9a0640243aedfc8a8e6ac3d3c..1ef4f93d3740502407b8b4d6151aabda44878e12 100644 --- a/barrierfree/accessibilityerrcode/entry/src/main/module.json +++ b/barrierfree/accessibilityerrcode/entry/src/main/module.json @@ -32,14 +32,6 @@ }] }], - "requestPermissions": [{ - "name": "ohos.permission.READ_ACCESSIBILITY_CONFIG", - "reason": "need use ohos.permission.READ_ACCESSIBILITY_CONFIG" - }, - { - "name": "ohos.permission.WRITE_ACCESSIBILITY_CONFIG", - "reason": "need use ohos.permission.WRITE_ACCESSIBILITY_CONFIG" - } - ] + "requestPermissions": [] } } \ No newline at end of file diff --git a/barrierfree/accessibilityerrcode/signature/openharmony_sx.p7b b/barrierfree/accessibilityerrcode/signature/openharmony_sx.p7b index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..826d7fb733cf533685c953036913d71e7c08db95 100644 Binary files a/barrierfree/accessibilityerrcode/signature/openharmony_sx.p7b and b/barrierfree/accessibilityerrcode/signature/openharmony_sx.p7b differ diff --git a/barrierfree/accessibilityevent/AppScope/app.json b/barrierfree/accessibilityevent/AppScope/app.json deleted file mode 100644 index c33bd144214a92fbfc9b4730f82a770cbc7b5107..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityevent/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.accessibilityxts", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon": "$media:icon", - "label": "$string:app_name", - "description": "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityevent/AppScope/resources/base/element/string.json b/barrierfree/accessibilityevent/AppScope/resources/base/element/string.json deleted file mode 100644 index ee69f9a861d9dc269ed6638735d52674583498e1..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityevent/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string":[ - { - "name":"app_name", - "value":"ohosProject" - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityevent/AppScope/resources/base/media/app_icon.png b/barrierfree/accessibilityevent/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index 474a55588fd7216113dd42073aadf254d4dba023..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityevent/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/barrierfree/accessibilityevent/BUILD.gn b/barrierfree/accessibilityevent/BUILD.gn deleted file mode 100644 index 5050d1636ea965a928dcabc22a9f4c3dd7f4b852..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityevent/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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("ActsAccessibilityEventTest") { - hap_profile = "./entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":accessibilityevent_js_assets", - ":accessibilityevent_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAccessibilityEventTest" - part_name = "accessibility" - subsystem_name = "barrierfree" -} - -ohos_app_scope("accessibilityevent_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("accessibilityevent_js_assets") { - source_dir = "./entry/src/main/ets" -} - -ohos_resources("accessibilityevent_resources") { - sources = [ "./entry/src/main/resources" ] - deps = [ ":accessibilityevent_app_profile" ] - hap_profile = "./entry/src/main/module.json" -} diff --git a/barrierfree/accessibilityevent/Test.json b/barrierfree/accessibilityevent/Test.json deleted file mode 100644 index e1bf8e892f859c693f34180668740177a3a99c43..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityevent/Test.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "bundle-name": "com.example.accessibilityxts", - "module-name": "phone", - "shell-timeout": "600000", - "testcase-timeout": 70000 - }, - "kits": [ - { - "test-file-name": [ - "ActsAccessibilityEventTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - },{ - "type": "ShellKit", - "run-command": [ - "power-shell wakeup", - "power-shell setmode 602" - ] - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityevent/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts b/barrierfree/accessibilityevent/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts deleted file mode 100644 index b7d54610ab6eff55bf19fe5f87ab8f606231b1f0..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityevent/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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 AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtensionAbility'; -import commonEvent from '@ohos.commonEvent'; - -class AccessibilityExtAbility extends AccessibilityExtensionAbility { - onConnect() { - console.info("[Demo] AccessibilityExtAbility onConnect"); - let commonEventPublishData = { - data: 'connect' - } - commonEvent.publish('onConnectState', commonEventPublishData, publishCallback); - - function publishCallback(err) { - console.info("[Demo] onConnect====>onConnect publish call back result:" + JSON.stringify(err)); - } - } - - onDisconnect() { - console.info("[Demo] AccessibilityExtAbility onDisconnect"); - let commonEventPublishData = { - data: 'disconnect' - } - commonEvent.publish('onConnectState', commonEventPublishData, publishCallback); - - function publishCallback(err) { - console.info("[Demo] onDisconnect====>onConnect publish call back result:" + JSON.stringify(err)); - } - } - - onAccessibilityEvent(accessibilityEvent) { - console.info("[Demo] AccessibilityExtAbility onAccessibilityEvent: " + accessibilityEvent.eventType); - let commonEventPublishData = { - data: 'accessibilityEvent', - parameters: { - eventType: accessibilityEvent.eventType, - haveTarget: (typeof(accessibilityEvent.target) == 'object'), - timeStamp: accessibilityEvent.timeStamp - } - } - commonEvent.publish('accessibilityEvent', commonEventPublishData, publishCallback); - - function publishCallback(err) { - console.info("[Demo] onAccessibilityEvent====>accessibilityEvent publish call back result:" + JSON.stringify(err)); - } - } -} -export default AccessibilityExtAbility; \ No newline at end of file diff --git a/barrierfree/accessibilityevent/entry/src/main/ets/Application/AbilityStage.ts b/barrierfree/accessibilityevent/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 1535a6b506bcd4a361ccbf5328e933e46a7b7e38..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityevent/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,7 +0,0 @@ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} diff --git a/barrierfree/accessibilityevent/entry/src/main/ets/MainAbility/MainAbility.ts b/barrierfree/accessibilityevent/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 83c05cfb5703f06d913d4bcc1ce45482f883f6d9..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityevent/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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 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() { - // Ability is destroying, release resources for this ability - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate windowStage="+ windowStage) - //globalThis.windowStage = windowStage - //globalThis.abilityStorage = this.storage - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "MainAbility/pages/index/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") - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityevent/entry/src/main/ets/MainAbility/pages/index/index.ets b/barrierfree/accessibilityevent/entry/src/main/ets/MainAbility/pages/index/index.ets deleted file mode 100644 index ff6d68394f7ae767fc2a0f10e5205b8c2c0bc931..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityevent/entry/src/main/ets/MainAbility/pages/index/index.ets +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 { - @State message: string = 'accessibility event'; - - aboutToAppear(){ - console.info("start run testcase!!!!"); - } - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityevent/entry/src/main/ets/TestAbility/TestAbility.ts b/barrierfree/accessibilityevent/entry/src/main/ets/TestAbility/TestAbility.ts deleted file mode 100644 index 89a84730505783ba229175ab4b55d37f91a16266..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityevent/entry/src/main/ets/TestAbility/TestAbility.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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' - -export default class TestAbility extends Ability { - onCreate(want, launchParam) { - console.log('TestAbility onCreate') - } - - 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') - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityevent/entry/src/main/ets/TestAbility/pages/index.ets b/barrierfree/accessibilityevent/entry/src/main/ets/TestAbility/pages/index.ets deleted file mode 100644 index b93567f962921124b282f78c8ef123965d1460c9..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityevent/entry/src/main/ets/TestAbility/pages/index.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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%') - } - } \ No newline at end of file diff --git a/barrierfree/accessibilityevent/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/barrierfree/accessibilityevent/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index fde2966cd3df4d631cff5b012cbe4421d902d19c..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityevent/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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.accessibilityxts.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') - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityevent/entry/src/main/ets/test/AccessibilityEventTest.test.ets b/barrierfree/accessibilityevent/entry/src/main/ets/test/AccessibilityEventTest.test.ets deleted file mode 100644 index a0eeca7febe30f46dd1a7b194797c4053e5e5803..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityevent/entry/src/main/ets/test/AccessibilityEventTest.test.ets +++ /dev/null @@ -1,455 +0,0 @@ -/* - * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" -import accessibility from '@ohos.accessibility' -import commonEvent from '@ohos.commonEvent' -import config from '@ohos.accessibility.config' - -export default function abilityTest() { - let targetBundleName = 'com.example.accessibilityxts'; - let subScriber = undefined; - let isConnected: boolean = false; - let events: Array = []; - - describe('AccessibilityEventTest', function () { - beforeAll(async function (done) { - console.info('AccessibilityEventTest beforeAll'); - subScriber = await commonEvent.createSubscriber({events: ['onConnectState', 'accessibilityEvent']}); - commonEvent.subscribe(subScriber, (err, data) => { - console.info('AccessibilityEventTest beforeAll data:' + JSON.stringify(data) ); - if (data.data == 'connect') { - isConnected = true; - } else if (data.data == 'disconnect') { - isConnected = false; - } else if (data.data == 'accessibilityEvent') { - events.push(data.parameters); - } - }); - - config.enableAbility('com.example.accessibilityxts/AccessibilityExtAbility', - ["retrieve", "touchGuide", "gesture"] - ).then(() => { - console.info(`AccessibilityEventTest enableAbility: then`); - }).catch((err) => { - console.error(`AccessibilityEventTest enableAbility has error: ${err.code}`); - }); - - setTimeout(done, 5000); - }) - - afterAll(async function (done) { - console.info('AccessibilityEventTest: afterAll'); - commonEvent.unsubscribe(subScriber); - isConnected = false; - config.disableAbility('com.example.accessibilityxts/AccessibilityExtAbility').then(() => { - console.info(`AccessibilityEventTest disableAbility: then`); - }).catch((err) => { - console.error(`AccessibilityEventTest disableAbility has error: ${err.code}`); - }); - setTimeout(done, 5000); - }) - - beforeEach(async function (done) { - console.info(`AccessibilityEventTest: beforeEach`); - events.length = 0; - setTimeout(done, 2000); - }) - - afterEach(async function (done) { - console.info(`AccessibilityEventTest: afterEach`); - done(); - }) - - - /* - * @tc.number AccessibilityEventTest_0100 - * @tc.name AccessibilityEventTest_0100 - * @tc.desc The parameter input is 'accessibilityFocus', test the Ability event function, - * and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityEventTest_0100', 0, async function (done) { - console.info(`AccessibilityEventTest_0100`); - let event = new accessibility.EventInfo({}); - event.type = 'accessibilityFocus'; - event.bundleName = targetBundleName; - event.triggerAction = 'accessibilityFocus'; - await accessibility.sendEvent(event); - - setTimeout(() => { - let findResult = false; - for (let item of events) { - if (item.eventType == 'accessibilityFocus') { - findResult = true; - } - } - console.info('AccessibilityEventTest_0100 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - }) - - /* - * @tc.number AccessibilityEventTest_0200 - * @tc.name AccessibilityEventTest_0200 - * @tc.desc The parameter input is 'accessibilityFocusClear', test the Ability event function, - * and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityEventTest_0200', 0, async function (done) { - console.info(`AccessibilityEventTest_0200`); - let event = new accessibility.EventInfo({}); - event.type = 'accessibilityFocusClear'; - event.bundleName = targetBundleName; - event.triggerAction = 'clearAccessibilityFocus'; - await accessibility.sendEvent(event); - - setTimeout(() => { - let findResult = false; - for (let item of events) { - if (item.eventType == 'accessibilityFocusClear') { - findResult = true; - } - } - console.info('AccessibilityEventTest_0200 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - }) - - /* - * @tc.number AccessibilityEventTest_0300 - * @tc.name AccessibilityEventTest_0300 - * @tc.desc The parameter input is 'click', test the Ability event function, - * and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityEventTest_0300', 0, async function (done) { - console.info(`AccessibilityEventTest_0300`); - let event = new accessibility.EventInfo({}); - event.type = 'click'; - event.bundleName = targetBundleName; - event.triggerAction = 'click'; - await accessibility.sendEvent(event); - - setTimeout(() => { - let findResult = false; - for (let item of events) { - if (item.eventType == 'click') { - findResult = true; - } - } - console.info('AccessibilityEventTest_0300 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - }) - - /* - * @tc.number AccessibilityEventTest_0400 - * @tc.name AccessibilityEventTest_0400 - * @tc.desc The parameter input is 'longClick', test the Ability event function, - * and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityEventTest_0400', 0, async function (done) { - console.info(`AccessibilityEventTest_0400`); - let event = new accessibility.EventInfo({}); - event.type = 'longClick'; - event.bundleName = targetBundleName; - event.triggerAction = 'longClick'; - await accessibility.sendEvent(event); - - setTimeout(() => { - let findResult = false; - for (let item of events) { - if (item.eventType == 'longClick') { - findResult = true; - } - } - console.info('AccessibilityEventTest_0400 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - }) - - /* - * @tc.number AccessibilityEventTest_0500 - * @tc.name AccessibilityEventTest_0500 - * @tc.desc The parameter input is 'focus', test the Ability event function, - * and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityEventTest_0500', 0, async function (done) { - console.info(`AccessibilityEventTest_0500`); - let event = new accessibility.EventInfo({}); - event.type = 'focus'; - event.bundleName = targetBundleName; - event.triggerAction = 'focus'; - await accessibility.sendEvent(event); - - setTimeout(() => { - let findResult = false; - for (let item of events) { - if (item.eventType == 'focus') { - findResult = true; - } - } - console.info('AccessibilityEventTest_0500 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - }) - - /* - * @tc.number AccessibilityEventTest_0600 - * @tc.name AccessibilityEventTest_0600 - * @tc.desc The parameter input is 'select', test the Ability event function, - * and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityEventTest_0600', 0, async function (done) { - console.info(`AccessibilityEventTest_0600`); - let event = new accessibility.EventInfo({}); - event.type = 'select'; - event.bundleName = targetBundleName; - event.triggerAction = 'select'; - await accessibility.sendEvent(event); - - setTimeout(() => { - let findResult = false; - for (let item of events) { - if (item.eventType == 'select') { - findResult = true; - } - } - console.info('AccessibilityEventTest_0600 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - }) - - /* - * @tc.number AccessibilityEventTest_0700 - * @tc.name AccessibilityEventTest_0700 - * @tc.desc The parameter input is 'hoverEnter', test the Ability event function, - * and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityEventTest_0700', 0, async function (done) { - console.info(`AccessibilityEventTest_0700`); - let event = new accessibility.EventInfo({}); - event.type = 'hoverEnter'; - event.bundleName = targetBundleName; - event.triggerAction = 'focus'; - await accessibility.sendEvent(event); - - setTimeout(() => { - let findResult = false; - for (let item of events) { - if (item.eventType == 'hoverEnter') { - findResult = true; - } - } - console.info('AccessibilityEventTest_0700 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - }) - - /* - * @tc.number AccessibilityEventTest_0800 - * @tc.name AccessibilityEventTest_0800 - * @tc.desc The parameter input is 'hoverExit', test the Ability event function, - * and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityEventTest_0800', 0, async function (done) { - console.info(`AccessibilityEventTest_0800`); - let event = new accessibility.EventInfo({}); - event.type = 'hoverExit'; - event.bundleName = targetBundleName; - event.triggerAction = 'focus'; - await accessibility.sendEvent(event); - - setTimeout(() => { - let findResult = false; - for (let item of events) { - if (item.eventType == 'hoverExit') { - findResult = true; - } - } - console.info('AccessibilityEventTest_0800 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - }) - - /* - * @tc.number AccessibilityEventTest_0900 - * @tc.name AccessibilityEventTest_0900 - * @tc.desc The parameter input is 'textUpdate', test the Ability event function, - * and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityEventTest_0900', 0, async function (done) { - console.info(`AccessibilityEventTest_0900`); - let event = new accessibility.EventInfo({}); - event.type = 'textUpdate'; - event.bundleName = targetBundleName; - event.triggerAction = 'cut'; - await accessibility.sendEvent(event); - - setTimeout(() => { - let findResult = false; - for (let item of events) { - if (item.eventType == 'textUpdate') { - findResult = true; - } - } - console.info('AccessibilityEventTest_0900 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - }) - - /* - * @tc.number AccessibilityEventTest_1000 - * @tc.name AccessibilityEventTest_1000 - * @tc.desc The parameter input is 'textSelectionUpdate', test the Ability event function, - * and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityEventTest_1000', 0, async function (done) { - console.info(`AccessibilityEventTest_1000`); - let event = new accessibility.EventInfo({}); - event.type = 'textSelectionUpdate'; - event.bundleName = targetBundleName; - event.triggerAction = 'setSelection'; - await accessibility.sendEvent(event); - - setTimeout(() => { - let findResult = false; - for (let item of events) { - if (item.eventType == 'textSelectionUpdate') { - findResult = true; - } - } - console.info('AccessibilityEventTest_1000 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - }) - - /* - * @tc.number AccessibilityEventTest_1100 - * @tc.name AccessibilityEventTest_1100 - * @tc.desc The parameter input is 'scroll', test the Ability event function, - * and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityEventTest_1100', 0, async function (done) { - console.info(`AccessibilityEventTest_1100`); - let event = new accessibility.EventInfo({}); - event.type = 'scroll'; - event.bundleName = targetBundleName; - event.triggerAction = 'scrollForward'; - await accessibility.sendEvent(event); - - setTimeout(() => { - let findResult = false; - for (let item of events) { - if (item.eventType == 'scroll') { - findResult = true; - } - } - console.info('AccessibilityEventTest_1100 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - }) - - /* - * @tc.number AccessibilityEventTest_1200 - * @tc.name AccessibilityEventTest_1200 - * @tc.desc The parameter input is 'scroll', test the Ability event function, - * and return void, verify existence of 'target'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityEventTest_1200', 0, async function (done) { - console.info(`AccessibilityEventTest_1200`); - let event = new accessibility.EventInfo({}); - event.type = 'scroll'; - event.bundleName = targetBundleName; - event.triggerAction = 'scrollForward'; - await accessibility.sendEvent(event); - - setTimeout(() => { - let findResult = false; - for (let item of events) { - console.info(`AccessibilityEventTest_1200 haveTarget: ${item.haveTarget}`); - if (item.eventType == 'scroll' && item.haveTarget) { - findResult = true; - } - } - console.info('AccessibilityEventTest_1200 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - }) - - /* - * @tc.number AccessibilityEventTest_1300 - * @tc.name AccessibilityEventTest_1300 - * @tc.desc The parameter input is 'scroll', test the Ability event function, - * and return void, verify existence of 'timeStamp'. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityEventTest_1300', 0, async function (done) { - console.info(`AccessibilityEventTest_1300`); - let event = new accessibility.EventInfo({}); - event.type = 'scroll'; - event.bundleName = targetBundleName; - event.triggerAction = 'scrollForward'; - await accessibility.sendEvent(event); - - setTimeout(() => { - let findResult = false; - for (let item of events) { - console.info(`AccessibilityEventTest_1300 timeStamp: ${item.timeStamp}`); - if (item.eventType == 'scroll' && typeof(item.timeStamp) == 'number') { - findResult = true; - } - } - console.info('AccessibilityEventTest_1300 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - }) - }) -} \ No newline at end of file diff --git a/barrierfree/accessibilityevent/entry/src/main/ets/test/List.test.ets b/barrierfree/accessibilityevent/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 07a0ae9eb00964cdd8036589ba0e2d40ffeeba99..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityevent/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 './AccessibilityEventTest.test.ets' - -export default function testsuite() { - abilityTest() -} \ No newline at end of file diff --git a/barrierfree/accessibilityevent/entry/src/main/module.json b/barrierfree/accessibilityevent/entry/src/main/module.json deleted file mode 100644 index 2b835817b88e995c752fb096ff09da61a0b90633..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityevent/entry/src/main/module.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default", - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [{ - "name": "com.example.accessibilityxts.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [{ - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - }] - }], - "extensionAbilities": [ - { - "name": "AccessibilityExtAbility", - "srcEntrance": "./ets/AccessibilityExtAbility/AccessibilityExtAbility.ts", - "label": "$string:Accessibility_label", - "description": "$string:Accessibility_desc", - "type": "accessibility", - "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" - } - ] - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityevent/entry/src/main/resources/base/element/string.json b/barrierfree/accessibilityevent/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 7188213d4fb3500f27e244635d26f3415b7e7013..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityevent/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsAccessibilityEventTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - }, - { - "name": "Accessibility_desc", - "value": "accessibility_description" - }, - { - "name": "Accessibility_label", - "value": "accessibility_label" - } - ] -} diff --git a/barrierfree/accessibilityevent/entry/src/main/resources/base/media/icon.png b/barrierfree/accessibilityevent/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index 474a55588fd7216113dd42073aadf254d4dba023..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityevent/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/barrierfree/accessibilityevent/entry/src/main/resources/base/profile/accessibility_config.json b/barrierfree/accessibilityevent/entry/src/main/resources/base/profile/accessibility_config.json deleted file mode 100644 index 3d3227275e598a68ee5f405daacd72f36df7b674..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityevent/entry/src/main/resources/base/profile/accessibility_config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "accessibilityCapabilities": [ - "retrieve" - ], - "accessibilityCapabilityRationale": "a11y_rationale", - "settingsAbility": "com.accessibility.voiceaid.voiceAidSetting" -} \ No newline at end of file diff --git a/barrierfree/accessibilityevent/entry/src/main/resources/base/profile/main_pages.json b/barrierfree/accessibilityevent/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index ceb075cd80946aade673d707aac904fb8998bce9..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityevent/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index/index" - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityevent/signature/openharmony_sx.p7b b/barrierfree/accessibilityevent/signature/openharmony_sx.p7b deleted file mode 100644 index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityevent/signature/openharmony_sx.p7b and /dev/null differ diff --git a/barrierfree/accessibilityextension/AppScope/app.json b/barrierfree/accessibilityextension/AppScope/app.json deleted file mode 100644 index c33bd144214a92fbfc9b4730f82a770cbc7b5107..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextension/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.accessibilityxts", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon": "$media:icon", - "label": "$string:app_name", - "description": "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityextension/AppScope/resources/base/element/string.json b/barrierfree/accessibilityextension/AppScope/resources/base/element/string.json deleted file mode 100644 index ee69f9a861d9dc269ed6638735d52674583498e1..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextension/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string":[ - { - "name":"app_name", - "value":"ohosProject" - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityextension/AppScope/resources/base/media/app_icon.png b/barrierfree/accessibilityextension/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index 474a55588fd7216113dd42073aadf254d4dba023..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityextension/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/barrierfree/accessibilityextension/BUILD.gn b/barrierfree/accessibilityextension/BUILD.gn deleted file mode 100644 index 0ff26fdf890350d50d77a6fe5857f1a65c38d936..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextension/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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("ActsAccessibilityExtensionTest") { - hap_profile = "./entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":accessibilityextension_js_assets", - ":accessibilityextension_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAccessibilityExtensionTest" - part_name = "accessibility" - subsystem_name = "barrierfree" -} - -ohos_app_scope("accessibilityextension_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("accessibilityextension_js_assets") { - source_dir = "./entry/src/main/ets" -} - -ohos_resources("accessibilityextension_resources") { - sources = [ "./entry/src/main/resources" ] - deps = [ ":accessibilityextension_app_profile" ] - hap_profile = "./entry/src/main/module.json" -} diff --git a/barrierfree/accessibilityextension/Test.json b/barrierfree/accessibilityextension/Test.json deleted file mode 100644 index 9ee6f63acb4f7e764715253b8d1e62bf07e4e5b3..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextension/Test.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "bundle-name": "com.example.accessibilityxts", - "module-name": "phone", - "shell-timeout": "600000", - "testcase-timeout": 70000 - }, - "kits": [ - { - "test-file-name": [ - "ActsAccessibilityExtensionTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - },{ - "type": "ShellKit", - "run-command": [ - "power-shell wakeup", - "power-shell setmode 602" - ] - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityextension/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts b/barrierfree/accessibilityextension/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts deleted file mode 100644 index 2c691a44573998f3cd2543e409216870674bfd0b..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextension/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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 AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtensionAbility'; -import commonEvent from '@ohos.commonEvent'; - -class AccessibilityExtAbility extends AccessibilityExtensionAbility { - onConnect() { - console.info("[Demo] AccessibilityExtAbility onConnect"); - let commonEventPublishData = { - data: 'connect' - } - commonEvent.publish('onConnectState', commonEventPublishData, publishCallback); - - function publishCallback(err) { - console.info("onConnect====>onConnect publish call back result:" + JSON.stringify(err)); - } - } - - onDisconnect() { - console.info("[Demo] AccessibilityExtAbility onDisconnect"); - let commonEventPublishData = { - data: 'disconnect' - } - commonEvent.publish('onConnectState', commonEventPublishData, publishCallback); - - function publishCallback(err) { - console.info("onDisconnect====>onConnect publish call back result:" + JSON.stringify(err)); - } - } - - onAccessibilityEvent(accessibilityEvent) { - console.info("[Demo] AccessibilityExtAbility onAccessibilityEvent"); - } -} -export default AccessibilityExtAbility; \ No newline at end of file diff --git a/barrierfree/accessibilityextension/entry/src/main/ets/Application/AbilityStage.ts b/barrierfree/accessibilityextension/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 1535a6b506bcd4a361ccbf5328e933e46a7b7e38..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextension/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,7 +0,0 @@ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} diff --git a/barrierfree/accessibilityextension/entry/src/main/ets/MainAbility/MainAbility.ts b/barrierfree/accessibilityextension/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 905eef2544ca4ebaeebf5ff059a0d4d32d1a6b73..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextension/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,47 +0,0 @@ -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 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() { - // Ability is destroying, release resources for this ability - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate windowStage="+ windowStage) - //globalThis.windowStage = windowStage - //globalThis.abilityStorage = this.storage - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "MainAbility/pages/index/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") - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityextension/entry/src/main/ets/MainAbility/pages/index/index.ets b/barrierfree/accessibilityextension/entry/src/main/ets/MainAbility/pages/index/index.ets deleted file mode 100644 index 1e4619d1153fb4eeb85a087cf6f0fb7f3f61ecfb..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextension/entry/src/main/ets/MainAbility/pages/index/index.ets +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 { - @State message: string = 'accessibilityExtension'; - - aboutToAppear(){ - console.info("start run testcase!!!!"); - } - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityextension/entry/src/main/ets/TestAbility/TestAbility.ts b/barrierfree/accessibilityextension/entry/src/main/ets/TestAbility/TestAbility.ts deleted file mode 100644 index 89a84730505783ba229175ab4b55d37f91a16266..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextension/entry/src/main/ets/TestAbility/TestAbility.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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' - -export default class TestAbility extends Ability { - onCreate(want, launchParam) { - console.log('TestAbility onCreate') - } - - 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') - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityextension/entry/src/main/ets/TestAbility/pages/index.ets b/barrierfree/accessibilityextension/entry/src/main/ets/TestAbility/pages/index.ets deleted file mode 100644 index b93567f962921124b282f78c8ef123965d1460c9..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextension/entry/src/main/ets/TestAbility/pages/index.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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%') - } - } \ No newline at end of file diff --git a/barrierfree/accessibilityextension/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/barrierfree/accessibilityextension/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index fde2966cd3df4d631cff5b012cbe4421d902d19c..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextension/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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.accessibilityxts.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') - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityextension/entry/src/main/ets/test/AccessibilityExtension.test.ets b/barrierfree/accessibilityextension/entry/src/main/ets/test/AccessibilityExtension.test.ets deleted file mode 100644 index 0cf73d0079db1dcdd32315785da80ca2b9f3c609..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextension/entry/src/main/ets/test/AccessibilityExtension.test.ets +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" -import commonEvent from '@ohos.commonEvent' -import config from '@ohos.accessibility.config' - -export default function abilityTest() { - let isCalled: boolean = false; - let subScriber = undefined; - - describe('AccessibilityExtensionTest', function () { - beforeAll(async function (done) { - console.info('AccessibilityExtensionTest: beforeAll'); - subScriber = await commonEvent.createSubscriber({events: ['onConnectState']}); - commonEvent.subscribe(subScriber, (err, data) => { - console.info('AccessibilityExtensionTest beforeAll subscribe data:' + JSON.stringify(data) ); - isCalled = (data.data == 'connect'); - }); - setTimeout(done, 5000); - }) - - afterAll(async function (done) { - console.info('AccessibilityExtensionTest: afterAll'); - commonEvent.unsubscribe(subScriber); - done(); - }) - - beforeEach(async function (done) { - console.info(`AccessibilityExtensionTest: beforeEach`); - done(); - }) - - afterEach(async function (done) { - console.info(`AccessibilityExtensionTest: afterEach`); - done(); - }) - - - /* - * @tc.number AccessibilityExtensionTest_Connect_0100 - * @tc.name AccessibilityExtensionTest_Connect_0100 - * @tc.desc The parameter input is null, test the ExtensionAbility onConnect function, - * and return undefined - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionTest_Connect_0100', 0, async function (done) { - console.info('AccessibilityExtensionTest_Connect_0100: start'); - config.enableAbility('com.example.accessibilityxts/AccessibilityExtAbility', - ["retrieve", "touchGuide", "gesture"] - ).then(() => { - console.info(`AccessibilityExtensionTest enableAbility: then`); - }).catch((err) => { - console.error(`AccessibilityExtensionTest enableAbility has error: ${err.code}`); - }); - - setTimeout(() => { - console.info('AccessibilityExtensionTest_Connect_0100 isCalled : ' + isCalled); - expect(isCalled).assertEqual(true); - done(); - }, 5000); - }) - - /* - * @tc.number AccessibilityExtensionTest_Disconnect_0200 - * @tc.name AccessibilityExtensionTest_Disconnect_0200 - * @tc.desc The parameter input is null, test the ExtensionAbility onDisconnect function, - * and return undefined - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionTest_Disconnect_0200', 0, async function (done) { - console.info('AccessibilityExtensionTest_Disconnect_0200 start'); - config.disableAbility('com.example.accessibilityxts/AccessibilityExtAbility').then(() => { - console.info(`AccessibilityExtensionTest disableAbility: then`); - }).catch((err) => { - console.error(`AccessibilityExtensionTest disableAbility has error: ${err.code}`); - }); - - setTimeout(() => { - console.info('AccessibilityExtensionTest_Disconnect_0200 isCalled : ' + isCalled); - expect(isCalled).assertEqual(false); - done(); - }, 5000); - }) - }) -} \ No newline at end of file diff --git a/barrierfree/accessibilityextension/entry/src/main/ets/test/List.test.ets b/barrierfree/accessibilityextension/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 2049c22d7a90c8622e4b007f1d7e5256181881ff..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextension/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 './AccessibilityExtension.test.ets' - -export default function testsuite() { - abilityTest() -} \ No newline at end of file diff --git a/barrierfree/accessibilityextension/entry/src/main/module.json b/barrierfree/accessibilityextension/entry/src/main/module.json deleted file mode 100644 index 2b835817b88e995c752fb096ff09da61a0b90633..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextension/entry/src/main/module.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default", - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [{ - "name": "com.example.accessibilityxts.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [{ - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - }] - }], - "extensionAbilities": [ - { - "name": "AccessibilityExtAbility", - "srcEntrance": "./ets/AccessibilityExtAbility/AccessibilityExtAbility.ts", - "label": "$string:Accessibility_label", - "description": "$string:Accessibility_desc", - "type": "accessibility", - "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" - } - ] - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityextension/entry/src/main/resources/base/element/string.json b/barrierfree/accessibilityextension/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 4e9211ae1a3e24bf8c04a9df212fd3020d222577..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextension/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsAccessibilityExtensionTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - }, - { - "name": "Accessibility_desc", - "value": "accessibility_description" - }, - { - "name": "Accessibility_label", - "value": "accessibility_label" - } - ] -} diff --git a/barrierfree/accessibilityextension/entry/src/main/resources/base/media/icon.png b/barrierfree/accessibilityextension/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index 474a55588fd7216113dd42073aadf254d4dba023..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityextension/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/barrierfree/accessibilityextension/entry/src/main/resources/base/profile/accessibility_config.json b/barrierfree/accessibilityextension/entry/src/main/resources/base/profile/accessibility_config.json deleted file mode 100644 index 3d3227275e598a68ee5f405daacd72f36df7b674..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextension/entry/src/main/resources/base/profile/accessibility_config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "accessibilityCapabilities": [ - "retrieve" - ], - "accessibilityCapabilityRationale": "a11y_rationale", - "settingsAbility": "com.accessibility.voiceaid.voiceAidSetting" -} \ No newline at end of file diff --git a/barrierfree/accessibilityextension/entry/src/main/resources/base/profile/main_pages.json b/barrierfree/accessibilityextension/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index ceb075cd80946aade673d707aac904fb8998bce9..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextension/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index/index" - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityextension/signature/openharmony_sx.p7b b/barrierfree/accessibilityextension/signature/openharmony_sx.p7b deleted file mode 100644 index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityextension/signature/openharmony_sx.p7b and /dev/null differ diff --git a/barrierfree/accessibilityextensioncontext/AppScope/app.json b/barrierfree/accessibilityextensioncontext/AppScope/app.json deleted file mode 100644 index 5a401487806987d4e1e1824c70088b5f67184501..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontext/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.accessibilityxts", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon": "$media:icon", - "label": "$string:app_name", - "description": "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} diff --git a/barrierfree/accessibilityextensioncontext/AppScope/resources/base/element/string.json b/barrierfree/accessibilityextensioncontext/AppScope/resources/base/element/string.json deleted file mode 100644 index 633100a6d90763bfac9d20aaae683119d7320e9c..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontext/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string":[ - { - "name":"app_name", - "value":"ohosProject" - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontext/AppScope/resources/base/media/app_icon.png b/barrierfree/accessibilityextensioncontext/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index 474a55588fd7216113dd42073aadf254d4dba023..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityextensioncontext/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/barrierfree/accessibilityextensioncontext/BUILD.gn b/barrierfree/accessibilityextensioncontext/BUILD.gn deleted file mode 100644 index bae7262f7b9b89f1de7c782ca6ad628506c8645e..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontext/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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("ActsAccessibilityExtensionContextTest") { - hap_profile = "./entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":accessibilityextensioncontext_js_assets", - ":accessibilityextensioncontext_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAccessibilityExtensionContextTest" - part_name = "accessibility" - subsystem_name = "barrierfree" -} - -ohos_app_scope("accessibilityextensioncontext_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("accessibilityextensioncontext_js_assets") { - source_dir = "./entry/src/main/ets" -} - -ohos_resources("accessibilityextensioncontext_resources") { - sources = [ "./entry/src/main/resources" ] - deps = [ ":accessibilityextensioncontext_app_profile" ] - hap_profile = "./entry/src/main/module.json" -} diff --git a/barrierfree/accessibilityextensioncontext/Test.json b/barrierfree/accessibilityextensioncontext/Test.json deleted file mode 100644 index 4440e620a03dca499d7c3a8ae9b5619c58f51455..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontext/Test.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "360000", - "bundle-name": "com.example.accessibilityxts", - "module-name": "phone", - "shell-timeout": "600000", - "testcase-timeout": 70000 - }, - "kits": [ - { - "test-file-name": [ - "ActsAccessibilityExtensionContextTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "power-shell wakeup", - "power-shell setmode 602", - "param set persist.ace.testmode.enabled 1" - ] - } - ] -} diff --git a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts b/barrierfree/accessibilityextensioncontext/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts deleted file mode 100644 index bffdd1ade132d3b9abf541f585bb612f2833f72e..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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 AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtensionAbility'; -import commonEvent from '@ohos.commonEvent'; -import {ExtensionContextTest} from './ExtensionContextTest'; - -class AccessibilityExtAbility extends AccessibilityExtensionAbility { - tester: ExtensionContextTest = undefined; - - onConnect() { - console.info("[Demo] AccessibilityExtAbility onConnect"); - this.tester = new ExtensionContextTest(this.context); - this.tester.init(); - - let commonEventPublishData = { - data: 'connect' - } - commonEvent.publish('onConnectState', commonEventPublishData, publishCallback); - - function publishCallback(err) { - console.info("onConnect====>onConnect publish call back result:" + JSON.stringify(err)); - } - } - - onDisconnect() { - console.info("[Demo] AccessibilityExtAbility onDisconnect"); - let commonEventPublishData = { - data: 'disconnect' - } - commonEvent.publish('onConnectState', commonEventPublishData, publishCallback); - - function publishCallback(err) { - console.info("onDisconnect====>onConnect publish call back result:" + JSON.stringify(err)); - } - - this.tester.clear(); - this.tester = undefined; - } - - onAccessibilityEvent(accessibilityEvent) { - console.info("[Demo] AccessibilityExtAbility onAccessibilityEvent: " + accessibilityEvent.eventType); - } -} - -export default AccessibilityExtAbility; \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/AccessibilityExtAbility/ExtensionContextTest.ts b/barrierfree/accessibilityextensioncontext/entry/src/main/ets/AccessibilityExtAbility/ExtensionContextTest.ts deleted file mode 100644 index 75ca9c5ebfcd12f8647ceab4cdc1ebeacb6407bd..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/AccessibilityExtAbility/ExtensionContextTest.ts +++ /dev/null @@ -1,600 +0,0 @@ -/* - * 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 commonEvent from '@ohos.commonEvent'; -import display from '@ohos.display' -import { GesturePath } from '@ohos.accessibility.GesturePath'; -import { GesturePoint } from '@ohos.accessibility.GesturePoint'; - -export class ExtensionContextTest { - private context = undefined; - private subScriber = undefined; - - constructor(context) { - this.context = context; - } - - async init() { - this.subScriber = await commonEvent.createSubscriber({events: ['caseExecute']}); - commonEvent.subscribe(this.subScriber, (err, data) => { - console.info('ExtensionContextTest subscribe callback data:' + JSON.stringify(data)); - this.processCase(data.data); - }); - } - - clear() { - commonEvent.unsubscribe(this.subScriber); - this.subScriber = undefined; - this.context = undefined; - } - - private publishCaseResult(caseName: string, result: boolean) { - let commonEventPublishData = { - data: (result ? 'pass' : 'fail'), - parameters: { - case: caseName - } - } - commonEvent.publish('caseResult', commonEventPublishData, (err) => { - console.info("ExtensionContextTest publishCaseResult finish: " + JSON.stringify(commonEventPublishData)); - }); - } - - private async processCase(caseName) { - console.info('ExtensionContextTest processCase: ' + caseName); - let bundleName: Array = []; - let windowId = -1; - let displayId = -1; - let gesturePath; - - switch (caseName) { - case 'AccessibilityExtensionContextTest_setTargetBundleName_asyncCallback_1500': - bundleName = ['com.example.accessibilityxts']; - this.setTargetBundleNameCallback(caseName, bundleName); - break; - case 'AccessibilityExtensionContextTest_setTargetBundleName_asyncCallback_1600': - bundleName = ['aaa']; - this.setTargetBundleNameCallback(caseName, bundleName); - break; - case 'AccessibilityExtensionContextTest_setTargetBundleName_asyncCallback_1700': - this.setTargetBundleNameCallback(caseName, bundleName); - break; - case 'AccessibilityExtensionContextTest_setTargetBundleName_asyncPromise_1800': - bundleName = ['com.example.accessibilityxts']; - this.setTargetBundleNamePromise(caseName, bundleName); - break; - case 'AccessibilityExtensionContextTest_setTargetBundleName_asyncPromise_1900': - bundleName = ['aaa']; - this.setTargetBundleNamePromise(caseName, bundleName); - break; - case 'AccessibilityExtensionContextTest_setTargetBundleName_asyncPromise_2000': - this.setTargetBundleNamePromise(caseName, bundleName); - break; - case 'AccessibilityExtensionContextTest_getWindowRootElement_asyncCallback_2100': - this.getWindowRootElementCallback(caseName); - break; - case 'AccessibilityExtensionContextTest_getWindowRootElement_asyncCallback_2200': - windowId = await this.getWindowIdByText('button1'); - this.getWindowRootElementByIdCallback(caseName, windowId); - break; - case 'AccessibilityExtensionContextTest_getWindowRootElement_asyncCallback_2300': - windowId = 1000; - this.getWindowRootElementByIdCallback(caseName, windowId); - break; - case 'AccessibilityExtensionContextTest_getWindowRootElement_asyncCallback_2400': - windowId = -1; - this.getWindowRootElementByIdCallback(caseName, windowId); - break; - case 'AccessibilityExtensionContextTest_getWindowRootElement_Promise_2500': - windowId = await this.getWindowId(); - this.getWindowRootElementByIdPromise(caseName, windowId); - break; - case 'AccessibilityExtensionContextTest_getWindowRootElement_Promise_2600': - windowId = 1000; - this.getWindowRootElementByIdPromise(caseName, windowId); - break; - case 'AccessibilityExtensionContextTest_getWindowRootElement_Promise_2700': - windowId = -1; - this.getWindowRootElementByIdPromise(caseName, windowId); - break; - case 'AccessibilityExtensionContextTest_getWindows_asyncCallback_2800': - this.getWindowsCallback(caseName); - break; - case 'AccessibilityExtensionContextTest_getWindows_asyncCallback_2900': - displayId = await this.getDisPlayId(); - this.getWindowsByIdCallback(caseName, displayId); - break; - case 'AccessibilityExtensionContextTest_getWindows_asyncCallback_3000': - displayId = 100; - this.getWindowsByIdCallback(caseName, displayId); - break; - case 'AccessibilityExtensionContextTest_getWindows_asyncCallback_3100': - displayId = -1; - this.getWindowsByIdCallback(caseName, displayId); - break; - case 'AccessibilityExtensionContextTest_getWindows_Promise_3200': - displayId = await this.getDisPlayId(); - this.getWindowsByIdPromise(caseName, displayId); - break; - case 'AccessibilityExtensionContextTest_getWindows_Promise_3300': - displayId = 100; - this.getWindowsByIdPromise(caseName, displayId); - break; - case 'AccessibilityExtensionContextTest_getWindows_Promise_3400': - displayId = -1; - this.getWindowsByIdPromise(caseName, displayId); - break; - case 'AccessibilityExtensionContextTest_getFocusElement_asyncCallback_3700': - await this.setAccessibilityFocus(); - setTimeout(async () => { - this.getFocusElementByTypeCallback(caseName, true, true); - }, 1000); - break; - case 'AccessibilityExtensionContextTest_getFocusElement_asyncCallback_3900': - await this.clearAccessibilityFocus(); - this.getFocusElementByTypeCallback(caseName, false, true); - break; - case 'AccessibilityExtensionContextTest_getFocusElement_asyncPromise_4100': - await this.setAccessibilityFocus(); - setTimeout(async () => { - this.getFocusElementByTypePromise(caseName, true, true); - }, 1000); - break; - case 'AccessibilityExtensionContextTest_getFocusElement_asyncPromise_4300': - await this.clearAccessibilityFocus(); - this.getFocusElementByTypePromise(caseName, false, true); - break; - case 'AccessibilityExtensionContextTest_gestureInject_asyncCallback_4500': - gesturePath = new GesturePath(100); - gesturePath.points.push(new GesturePoint(10, 10)); - this.gestureInjectCallback(caseName, gesturePath); - break; - case 'AccessibilityExtensionContextTest_gestureInject_asyncCallback_4600': - gesturePath = new GesturePath(60000); - gesturePath.points.push(new GesturePoint(50, 50)); - this.gestureInjectCallback(caseName, gesturePath); - break; - case 'AccessibilityExtensionContextTest_gestureInject_asyncCallback_4700': - gesturePath = new GesturePath(1000); - gesturePath.points.push(new GesturePoint(200, 200), - new GesturePoint(100, 100)); - this.gestureInjectCallback(caseName, gesturePath); - break; - case 'AccessibilityExtensionContextTest_gestureInject_asyncCallback_4800': - gesturePath = new GesturePath(60000); - gesturePath.points.push(new GesturePoint(50, 50), - new GesturePoint(100, 100), - new GesturePoint(1000, 1000)); - this.gestureInjectCallback(caseName, gesturePath); - break; - case 'AccessibilityExtensionContextTest_gestureInject_asyncPromise_5000': - gesturePath = new GesturePath(100); - gesturePath.points.push(new GesturePoint(10, 10)); - this.gestureInjectPromise(caseName, gesturePath); - break; - case 'AccessibilityExtensionContextTest_gestureInject_asyncPromise_5100': - gesturePath = new GesturePath(60000); - gesturePath.points.push(new GesturePoint(50, 50)); - this.gestureInjectPromise(caseName, gesturePath); - break; - case 'AccessibilityExtensionContextTest_gestureInject_asyncPromise_5200': - gesturePath = new GesturePath(1000); - gesturePath.points.push(new GesturePoint(200, 200), - new GesturePoint(100, 100)); - this.gestureInjectPromise(caseName, gesturePath); - break; - case 'AccessibilityExtensionContextTest_gestureInject_asyncPromise_5300': - gesturePath = new GesturePath(60000); - gesturePath.points.push(new GesturePoint(50, 50), - new GesturePoint(100, 100), - new GesturePoint(1000, 1000)); - this.gestureInjectPromise(caseName, gesturePath); - break; - default: - console.warn('ExtensionContextTest processCase unknown!!!!!!!!!!'); - break; - } - } - - private async getWindowId() { - let windowId = -1; - let rootNode = await this.context.getWindowRootElement(); - console.info("getWindowId rootNode: " + JSON.stringify(rootNode)); - if (rootNode) { - windowId = await rootNode.attributeValue('windowId'); - console.info("getWindowId windowId: " + JSON.stringify(windowId)); - } - return windowId; - } - - private async getWindowIdByText(text: string) { - let windowId = -1; - let rootNode = await this.context.getWindowRootElement(); - console.info("getWindowId rootNode: " + JSON.stringify(rootNode)); - if (rootNode) { - let tartgetNode = await rootNode.findElement('content', text); - console.info("getWindowId tartgetNode: " + JSON.stringify(tartgetNode)); - if (tartgetNode) { - windowId = await tartgetNode[0].attributeValue('windowId'); - console.info("getWindowId windowId: " + JSON.stringify(windowId)); - } - } - return windowId; - } - - private async getDisPlayId() { - let displayId = -1; - display.getDefaultDisplay((err, data) => { - if (err && err.code != 0) { - console.error("getDisPlayId getDefaultDisplay error"); - } else { - console.info("getDisPlayId getDefaultDisplay data.id: " + JSON.stringify(data.id)); - displayId = data.id; - } - }); - return displayId; - } - - private async getRoot() { - let rootNode = undefined; - if (this.context) { - let rootNode = await this.context.getWindowRootElement(); - console.info("getRoot rootNode: " + JSON.stringify(rootNode)); - } - return rootNode; - } - - private async setAccessibilityFocus() { - let isFocus = false; - if (this.context) { - let rootNode = await this.context.getWindowRootElement(); - console.info("setAccessibilityFocus rootNode: " + JSON.stringify(rootNode)); - if (rootNode) { - let tartgetNode = await rootNode.findElement('content', 'button1'); - console.info("setAccessibilityFocus tartgetNode: " + JSON.stringify(tartgetNode)); - if (tartgetNode) { - await tartgetNode[0].performAction("accessibilityFocus"); - } - } - } - } - - private async clearAccessibilityFocus() { - let isFocus = false; - if (this.context) { - let rootNode = await this.context.getWindowRootElement(); - console.info("setAccessibilityFocus rootNode: " + JSON.stringify(rootNode)); - if (rootNode) { - let tartgetNode = await rootNode.findElement('content', 'button1'); - console.info("setAccessibilityFocus tartgetNode: " + JSON.stringify(tartgetNode)); - if (tartgetNode) { - await tartgetNode[0].performAction("clearAccessibilityFocus"); - } - } - } - } - - private async setTargetBundleNameCallback(caseName: string, bundleName: Array) { - let result = true; - this.context.setTargetBundleName(bundleName, (err, res) => { - console.info(caseName + " res: " + JSON.stringify(res)); - if (err && err.code != 0) { - console.error(caseName + " err: " + JSON.stringify(err.code)); - if ((bundleName.length == 0 || bundleName[0] == 'aaa') && err && err.code != 0) { - result = true; - } else { - result = false; - } - } - this.publishCaseResult(caseName, result); - }); - } - - private async setTargetBundleNamePromise(caseName: string, bundleName: Array) { - let result = true; - this.context.setTargetBundleName(bundleName).then((res) => { - console.info(caseName + " res: " + JSON.stringify(res)); - this.publishCaseResult(caseName, result); - }).catch((error) => { - console.error(caseName + " error: " + JSON.stringify(error)); - if ((bundleName.length == 0 || bundleName[0] == 'aaa') && error && error.code != 0) { - result = true; - } else { - result = false; - } - this.publishCaseResult(caseName, result); - }); - } - - private async getWindowRootElementCallback(caseName: string) { - let result = false; - this.context.getWindowRootElement(async (err, res) => { - console.info(caseName + " res: " + JSON.stringify(res)); - if (err && err.code != 0) { - console.error(caseName + " err: " + JSON.stringify(err.code)); - } - if (res == undefined) { - console.error(caseName + " res is undefined"); - } - if (res) { - let value = await res.attributeValue('componentId'); - if (typeof(value) == 'number') { - result = true; - } - } - this.publishCaseResult(caseName, result); - }); - } - - private async getWindowRootElementByIdCallback(caseName: string, windowId: number) { - let result = false; - if ((windowId == -1) || (windowId == 1000)){ - this.context.getWindowRootElement(-1, async (err, res) => { - if (err && err.code != 0) { - console.error(caseName + " err: " + JSON.stringify(err.code)); - result = true; - } - this.publishCaseResult(caseName, result); - }); - } else { - this.context.getWindowRootElement(windowId, async (err, res) => { - console.info(caseName + " res: " + JSON.stringify(res)); - if (err && err.code != 0) { - console.error(caseName + " err: " + JSON.stringify(err.code)); - } - if (res == undefined) { - console.error(caseName + " res is undefined"); - } - if (res) { - let value = await res.attributeValue('componentId'); - if (typeof(value) == 'number') { - result = true; - } - } - this.publishCaseResult(caseName, result); - }); - } - } - - private async getWindowRootElementByIdPromise(caseName: string, windowId: number) { - let result = false; - if ((windowId == -1) || (windowId == 1000)){ - this.context.getWindowRootElement(-1).then(async (res) => { - this.publishCaseResult(caseName, result); - }).catch((error) => { - console.error(caseName + " error: " + JSON.stringify(error)); - result = true; - this.publishCaseResult(caseName, result); - }); - } else { - this.context.getWindowRootElement(windowId).then(async (res) => { - console.info(caseName + " res: " + JSON.stringify(res)); - if (res == undefined) { - console.error(caseName + " res is undefined"); - } - if (res) { - let value = await res.attributeValue('componentId'); - if (typeof(value) == 'number') { - result = true; - } - } - this.publishCaseResult(caseName, result); - }).catch((error) => { - console.error(caseName + " error: " + JSON.stringify(error)); - this.publishCaseResult(caseName, result); - }); - } - } - - - private async getWindowsCallback(caseName: string) { - let result = false; - this.context.getWindows((err, res) => { - console.info(caseName + " res: " + JSON.stringify(res)); - if (err && err.code != 0) { - console.error(caseName + " err: " + JSON.stringify(err.code)); - } - if (res == undefined) { - console.error(caseName + " res is undefined"); - } - if (res) { - if (Array.isArray(res)) { - result = true; - } - } - this.publishCaseResult(caseName, result); - }); - } - - private async getWindowsByIdCallback(caseName: string, displayId: number) { - let result = false; - console.info(caseName + " displayId: " + JSON.stringify(displayId)); - if (displayId == -1 || displayId == 100) { - this.context.getWindows(-1, (err, res) => { - console.info(caseName + " res: " + JSON.stringify(res)); - if (err.code != 0) { - console.error(caseName + " err: " + JSON.stringify(err.code)); - result = true; - } - this.publishCaseResult(caseName, result); - }); - } else { - this.context.getWindows(displayId, (err, res) => { - console.info(caseName + " res: " + JSON.stringify(res)); - if (err && err.code != 0) { - console.error(caseName + " err: " + JSON.stringify(err.code)); - } - if (res) { - if (Array.isArray(res)) { - result = true; - } - } - this.publishCaseResult(caseName, result); - }); - } - } - - private async getWindowsByIdPromise(caseName: string, displayId: number) { - let result = false; - console.info(caseName + " displayId: " + JSON.stringify(displayId)); - if (displayId == -1) { - this.context.getWindows(displayId).then(async (res) => { - result = false; - this.publishCaseResult(caseName, result); - }).catch((err) => { - console.error(caseName + 'err:' + JSON.stringify(err)); - if (err && err.code != 0) { - result = true; - } - this.publishCaseResult(caseName, result); - }); - - } else { - this.context.getWindows(displayId, (err, res) => { - console.info(caseName + " res: " + JSON.stringify(res)); - if (err && err.code != 0) { - console.error(caseName + " err: " + JSON.stringify(err.code)); - } - if (res) { - if (Array.isArray(res)) { - result = true; - } - } - this.publishCaseResult(caseName, result); - }); - } - } - - private async getFocusElementCallback(caseName: string, hasFocus: boolean) { - let result = false; - this.context.getFocusElement((err, res) => { - console.info(caseName + "res: " + JSON.stringify(res)); - if (err && err.code != 0) { - console.error(caseName + "err: " + JSON.stringify(err.code)); - result = true; - } - if (res == undefined) { - result = true; - } - this.publishCaseResult(caseName, result); - }); - } - - private async getFocusElementByTypeCallback(caseName: string, hasFocus: boolean, isAccessibilityFocus: boolean) { - let result = false; - if (isAccessibilityFocus) { - this.context.getFocusElement(true, async (err, res) => { - console.info(caseName + "res: " + JSON.stringify(res)); - if (hasFocus) { - let value = await res.attributeValue('componentId'); - console.info(caseName + "value: " + JSON.stringify(value)); - if (typeof(value) == 'number') { - result = true; - } - this.publishCaseResult(caseName, result); - } else { - if (err && err.code != 0) { - console.error(caseName + "err: " + JSON.stringify(err.code)); - result = true; - } - if (res == undefined) { - result = true; - } - this.publishCaseResult(caseName, result); - } - }); - } else { - this.context.getFocusElement(false, (err, res) => { - console.info(caseName + "res: " + JSON.stringify(res)); - if (err && err.code != 0) { - console.error(caseName + "err: " + JSON.stringify(err.code)); - result = true; - } - if (res == undefined) { - result = true; - } - this.publishCaseResult(caseName, result); - }); - } - } - - private async getFocusElementByTypePromise(caseName: string, hasFocus: boolean, isAccessibilityFocus: boolean) { - let result = false; - if (isAccessibilityFocus) { - this.context.getFocusElement(true).then(async (res) => { - console.info(caseName + " res: " + JSON.stringify(res)); - if (hasFocus) { - let value = await res.attributeValue('componentId'); - console.info(caseName + "value: " + JSON.stringify(value)); - if (typeof(value) == 'number') { - result = true; - } - this.publishCaseResult(caseName, result); - } else { - if (res == undefined) { - result = true; - } - this.publishCaseResult(caseName, result); - } - }).catch((err) => { - console.error(caseName + 'error:' + JSON.stringify(err)); - if (!hasFocus) { - result = true; - } - this.publishCaseResult(caseName, result); - }); - } else { - this.context.getFocusElement(false).then(async (res) => { - console.info(caseName + " res: " + JSON.stringify(res)); - if (res == undefined) { - result = true; - } - this.publishCaseResult(caseName, result); - }).catch((err) => { - result = true; - console.error(caseName + 'error:' + JSON.stringify(err)); - this.publishCaseResult(caseName, result); - }); - } - } - - private async gestureInjectCallback(caseName: string, gesturePath: object) { - let result = false; - this.context.injectGesture(gesturePath, (err, res) => { - console.info(caseName + " res: " + JSON.stringify(res)); - result = true; - if (err && err.code != 0) { - console.error(caseName + " err: " + JSON.stringify(err.code)); - result = false; - } - this.publishCaseResult(caseName, result); - }); - } - - - private async gestureInjectPromise(caseName: string, gesturePath: object) { - let result = false; - this.context.injectGesture(gesturePath).then((res) => { - console.info(caseName + " res: " + JSON.stringify(res)); - result = true; - this.publishCaseResult(caseName, result); - }).catch ((err) => { - if (err && err.code != 0) { - console.error(caseName + 'error:' + JSON.stringify(err)); - result = true; - } - this.publishCaseResult(caseName, result); - }); - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/Application/AbilityStage.ts b/barrierfree/accessibilityextensioncontext/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 32dfe93ccff0375201857794de902cec4d239442..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,7 +0,0 @@ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/MainAbility/MainAbility.ts b/barrierfree/accessibilityextensioncontext/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 40427aad12dce08c70cf7f161e73b7d81c3f5377..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,47 +0,0 @@ -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 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() { - // Ability is destroying, release resources for this ability - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate windowStage="+ windowStage) - //globalThis.windowStage = windowStage - //globalThis.abilityStorage = this.storage - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "MainAbility/pages/index/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") - } -}; diff --git a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/MainAbility/pages/index/index.ets b/barrierfree/accessibilityextensioncontext/entry/src/main/ets/MainAbility/pages/index/index.ets deleted file mode 100644 index 93f4b2ac33caf457736cbe195a58a6d84d145358..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/MainAbility/pages/index/index.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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'; - -@Entry -@Component -struct Index { - @State message: string = 'accessibility ExtensionContext'; - - aboutToAppear(){ - console.info("start run testcase!!!!"); - } - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - .margin({bottom: 10}) - - Row() { - Button('left') - Button('button1') - .margin({ - left: 10, - right: 10 - }) - Button('right') - } - .margin({bottom: 10}) - - Button('button2') - .margin({bottom: 10}) - - Button('button3') - .margin({bottom: 10}) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/TestAbility/TestAbility.ts b/barrierfree/accessibilityextensioncontext/entry/src/main/ets/TestAbility/TestAbility.ts deleted file mode 100644 index 89a84730505783ba229175ab4b55d37f91a16266..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/TestAbility/TestAbility.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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' - -export default class TestAbility extends Ability { - onCreate(want, launchParam) { - console.log('TestAbility onCreate') - } - - 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') - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/TestAbility/pages/index.ets b/barrierfree/accessibilityextensioncontext/entry/src/main/ets/TestAbility/pages/index.ets deleted file mode 100644 index b93567f962921124b282f78c8ef123965d1460c9..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/TestAbility/pages/index.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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%') - } - } \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/barrierfree/accessibilityextensioncontext/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index fde2966cd3df4d631cff5b012cbe4421d902d19c..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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.accessibilityxts.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') - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/test/AccessibilityExtensionContext.test.ets b/barrierfree/accessibilityextensioncontext/entry/src/main/ets/test/AccessibilityExtensionContext.test.ets deleted file mode 100644 index eac739203223eb84df8c0ce1b7c16684a6275675..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/test/AccessibilityExtensionContext.test.ets +++ /dev/null @@ -1,1150 +0,0 @@ -/* - * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" -import commonEvent from '@ohos.commonEvent' -import config from '@ohos.accessibility.config' - -const passStr = 'pass'; -const failStr = 'fail'; - -function publishCaseExecute(caseName: string) { - let commonEventPublishData = { - data: caseName - } - - commonEvent.publish('caseExecute', commonEventPublishData, (err) => { - console.info('caseExecute publish [' + caseName + '] callback result: ' + JSON.stringify(err)); - }); -} - -export default function abilityTest() { - describe('AccessibilityExtensionContextTest', function () { - let subScriber = undefined; - let isConnect = false; - let caseResult = undefined; - - beforeAll(async function (done) { - console.info('AccessibilityExtensionContextTest: beforeAll'); - subScriber = await commonEvent.createSubscriber({events: ['onConnectState', 'caseResult']}); - commonEvent.subscribe(subScriber, (err, data) => { - console.info('AccessibilityExtensionContextTest beforeAll data:' + JSON.stringify(data) ); - if (data.data == 'connect') { - isConnect = true; - } else if (data.data == 'disconnect') { - isConnect = false; - } else if (data.data == passStr || data.data == failStr) { - caseResult = data; - } - }); - - config.enableAbility('com.example.accessibilityxts/AccessibilityExtAbility', - ["retrieve", "touchGuide", "gesture"] - ).then(() => { - console.info(`AccessibilityExtensionContextTest enableAbility: then`); - }).catch((err) => { - console.error(`AccessibilityExtensionContextTest enableAbility has error: ${err.code}`); - }); - - setTimeout(done, 5000); - }) - - afterAll(async function (done) { - console.info('AccessibilityElementTest: afterAll'); - commonEvent.unsubscribe(subScriber); - isConnect = false; - config.disableAbility('com.example.accessibilityxts/AccessibilityExtAbility').then(() => { - console.info(`AccessibilityExtensionContextTest disableAbility: then`); - }).catch((err) => { - console.error(`AccessibilityExtensionContextTest disableAbility has error: ${err.code}`); - }); - setTimeout(done, 5000); - }) - - beforeEach(async function (done) { - console.info('AccessibilityElementTest: beforeEach'); - caseResult = undefined; - done(); - }) - - afterEach(async function (done) { - console.info('AccessibilityElementTest: afterEach'); - done(); - }) - - /* - * @tc.number AccessibilityExtensionContextTest_setTargetBundleName_asyncCallback_1500 - * @tc.name AccessibilityExtensionContextTest_setTargetBundleName_asyncCallback_1500 - * @tc.desc The parameter input is 'com.example.accessibilityxts', - * test the setTargetBundleName() function, - * The result of setTargetBundleName() should be boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_setTargetBundleName_asyncCallback_1500', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_setTargetBundleName_asyncCallback_1500'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_setTargetBundleName_asyncCallback_1600 - * @tc.name AccessibilityExtensionContextTest_setTargetBundleName_asyncCallback_1600 - * @tc.desc The parameter input is 'com.example.accessibilityxts', - * test the setTargetBundleName() function, - * The result of setTargetBundleName() should be boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_setTargetBundleName_asyncCallback_1600', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_setTargetBundleName_asyncCallback_1600'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_setTargetBundleName_asyncCallback_1700 - * @tc.name AccessibilityExtensionContextTest_setTargetBundleName_asyncCallback_1700 - * @tc.desc The parameter input is 'com.example.accessibilityxts', - * test the setTargetBundleName() function, - * The result of setTargetBundleName() should be boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_setTargetBundleName_asyncCallback_1700', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_setTargetBundleName_asyncCallback_1700'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_setTargetBundleName_asyncPromise_1800 - * @tc.name AccessibilityExtensionContextTest_setTargetBundleName_asyncPromise_1800 - * @tc.desc The parameter input is 'com.example.accessibilityxts', - * test the setTargetBundleName() function, - * The result of setTargetBundleName() should be boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_setTargetBundleName_asyncPromise_1800', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_setTargetBundleName_asyncPromise_1800'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_setTargetBundleName_asyncPromise_1900 - * @tc.name AccessibilityExtensionContextTest_setTargetBundleName_asyncPromise_1900 - * @tc.desc The parameter input is 'com.example.accessibilityxts', - * test the setTargetBundleName() function, - * The result of setTargetBundleName() should be boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_setTargetBundleName_asyncPromise_1900', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_setTargetBundleName_asyncPromise_1900'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_setTargetBundleName_asyncPromise_2000 - * @tc.name AccessibilityExtensionContextTest_setTargetBundleName_asyncPromise_2000 - * @tc.desc The parameter input is 'com.example.accessibilityxts', - * test the setTargetBundleName() function, - * The result of setTargetBundleName() should be boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_setTargetBundleName_asyncPromise_2000', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_setTargetBundleName_asyncPromise_2000'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_getWindowRootElement_asyncCallback_2100 - * @tc.name AccessibilityExtensionContextTest_getWindowRootElement_asyncCallback_2100 - * @tc.desc The parameter input is null, - * The result of getWindowRootElement() should be AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_getWindowRootElement_asyncCallback_2100', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_getWindowRootElement_asyncCallback_2100'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - - /* - * @tc.number AccessibilityExtensionContextTest_getWindowRootElement_asyncCallback_2200 - * @tc.name AccessibilityExtensionContextTest_getWindowRootElement_asyncCallback_2200 - * @tc.desc The parameter input is null, - * The result of getWindowRootElement() should be AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_getWindowRootElement_asyncCallback_2200', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_getWindowRootElement_asyncCallback_2200'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_getWindowRootElement_asyncCallback_2300 - * @tc.name AccessibilityExtensionContextTest_getWindowRootElement_asyncCallback_2300 - * @tc.desc The parameter input is windowId, test the getWindowRootElement() function. - * The result of getWindowRootElement() should be AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_getWindowRootElement_asyncCallback_2300', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_getWindowRootElement_asyncCallback_2300'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_getWindowRootElement_asyncCallback_2400 - * @tc.name AccessibilityExtensionContextTest_getWindowRootElement_asyncCallback_2400 - * @tc.desc The parameter input is windowId, test the getWindowRootElement() function. - * The result of getWindowRootElement() should be AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_getWindowRootElement_asyncCallback_2400', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_getWindowRootElement_asyncCallback_2400'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_getWindowRootElement_Promise_2500 - * @tc.name AccessibilityExtensionContextTest_getWindowRootElement_Promise_2500 - * @tc.desc The parameter input is windowId, test the getWindowRootElement() function. - * The result of getWindowRootElement() should be AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_getWindowRootElement_Promise_2500', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_getWindowRootElement_Promise_2500'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - - /* - * @tc.number AccessibilityExtensionContextTest_getWindowRootElement_Promise_2600 - * @tc.name AccessibilityExtensionContextTest_getWindowRootElement_Promise_2600 - * @tc.desc The parameter input is windowId, test the getWindowRootElement() function. - * The result of getWindowRootElement() should be AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_getWindowRootElement_Promise_2600', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_getWindowRootElement_Promise_2600'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_getWindowRootElement_Promise_2700 - * @tc.name AccessibilityExtensionContextTest_getWindowRootElement_Promise_2700 - * @tc.desc The parameter input is windowId, test the getWindowRootElement() function. - * The result of getWindowRootElement() should be AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_getWindowRootElement_Promise_2700', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_getWindowRootElement_Promise_2700'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_getWindows_asyncCallback_2800 - * @tc.name AccessibilityExtensionContextTest_getWindows_asyncCallback_2800 - * @tc.desc The parameter input is null, test the getWindows() function, - * The result of getWindows() should be Array type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_getWindows_asyncCallback_2800', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_getWindows_asyncCallback_2800'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_getWindows_asyncCallback_2900 - * @tc.name AccessibilityExtensionContextTest_getWindows_asyncCallback_2900 - * @tc.desc The parameter input is dispalyId, test the getWindows() function, - * The result of getWindows() should be Array type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_getWindows_asyncCallback_2900', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_getWindows_asyncCallback_2900'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_getWindows_asyncCallback_3000 - * @tc.name AccessibilityExtensionContextTest_getWindows_asyncCallback_3000 - * @tc.desc The parameter input is dispalyId, test the getWindows() function, - * The result of getWindows() should be Array type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_getWindows_asyncCallback_3000', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_getWindows_asyncCallback_3000'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_getWindows_asyncCallback_3100 - * @tc.name AccessibilityExtensionContextTest_getWindows_asyncCallback_3100 - * @tc.desc The parameter input is dispalyId, test the getWindows() function, - * The result of getWindows() should be Array type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_getWindows_asyncCallback_3100', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_getWindows_asyncCallback_3100'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_getWindows_Promise_3200 - * @tc.name AccessibilityExtensionContextTest_getWindows_Promise_3200 - * @tc.desc The parameter input is dispalyId, test the getWindows() function, - * The result of getWindows() should be Array type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_getWindows_Promise_3200', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_getWindows_Promise_3200'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_getWindows_Promise_3300 - * @tc.name AccessibilityExtensionContextTest_getWindows_Promise_3300 - * @tc.desc The parameter input is dispalyId, test the getWindows() function, - * The result of getWindows() should be Array type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_getWindows_Promise_3300', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_getWindows_Promise_3300'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_getWindows_Promise_3400 - * @tc.name AccessibilityExtensionContextTest_getWindows_Promise_3400 - * @tc.desc The parameter input is dispalyId, test the getWindows() function, - * The result of getWindows() should be Array type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_getWindows_Promise_3400', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_getWindows_Promise_3400'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_getFocusElement_asyncCallback_3700 - * @tc.name AccessibilityExtensionContextTest_getFocusElement_asyncCallback_3700 - * @tc.desc The parameter input is true, test the getFocusElement() function, - * The result of getFocusElement() should be AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_getFocusElement_asyncCallback_3700', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_getFocusElement_asyncCallback_3700'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_getFocusElement_asyncCallback_3900 - * @tc.name AccessibilityExtensionContextTest_getFocusElement_asyncCallback_3900 - * @tc.desc The parameter input is true, test the getFocusElement() function, - * The result of getFocusElement() should be AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_getFocusElement_asyncCallback_3900', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_getFocusElement_asyncCallback_3900'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_getFocusElement_asyncPromise_4100 - * @tc.name AccessibilityExtensionContextTest_getFocusElement_asyncPromise_4100 - * @tc.desc The parameter input is true, test the getFocusElement() function, - * The result of getFocusElement() should be AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_getFocusElement_asyncPromise_4100', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_getFocusElement_asyncPromise_4100'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_getFocusElement_asyncPromise_4300 - * @tc.name AccessibilityExtensionContextTest_getFocusElement_asyncPromise_4300 - * @tc.desc The parameter input is true, test the getFocusElement() function, - * The result of getFocusElement() should be AccessibilityElement type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_getFocusElement_asyncPromise_4300', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_getFocusElement_asyncPromise_4300'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_gestureInject_asyncCallback_4500 - * @tc.name AccessibilityExtensionContextTest_gestureInject_asyncCallback_4500 - * @tc.desc The parameter input is gesturePath, test the gestureInject() function. - * The result of gestureInject() should be boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_gestureInject_asyncCallback_4500', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_gestureInject_asyncCallback_4500'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_gestureInject_asyncCallback_4600 - * @tc.name AccessibilityExtensionContextTest_gestureInject_asyncCallback_4600 - * @tc.desc The parameter input is gesturePath, test the gestureInject() function. - * The result of gestureInject() should be boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_gestureInject_asyncCallback_4600', 0, async function(done) { - let caseName = 'AccessibilityExtensionContextTest_gestureInject_asyncCallback_4600'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_gestureInject_asyncCallback_4700 - * @tc.name AccessibilityExtensionContextTest_gestureInject_asyncCallback_4700 - * @tc.desc The parameter input is gesturePath, test the gestureInject() function. - * The result of gestureInject() should be boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_gestureInject_asyncCallback_4700', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_gestureInject_asyncCallback_4700'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_gestureInject_asyncCallback_4800 - * @tc.name AccessibilityExtensionContextTest_gestureInject_asyncCallback_4800 - * @tc.desc The parameter input is gesturePath, test the gestureInject() function. - * The result of gestureInject() should be boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_gestureInject_asyncCallback_4800', 0, async function(done) { - let caseName = 'AccessibilityExtensionContextTest_gestureInject_asyncCallback_4800'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_gestureInject_asyncPromise_5000 - * @tc.name AccessibilityExtensionContextTest_gestureInject_asyncPromise_5000 - * @tc.desc The parameter input is gesturePath, test the gestureInject() function. - * The result of gestureInject() should be boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_gestureInject_asyncPromise_5000', 0, async function(done) { - let caseName = 'AccessibilityExtensionContextTest_gestureInject_asyncPromise_5000'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_gestureInject_asyncPromise_5100 - * @tc.name AccessibilityExtensionContextTest_gestureInject_asyncPromise_5100 - * @tc.desc The parameter input is gesturePath, test the gestureInject() function. - * The result of gestureInject() should be boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_gestureInject_asyncPromise_5100', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_gestureInject_asyncPromise_5100'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_gestureInject_asyncPromise_5200 - * @tc.name AccessibilityExtensionContextTest_gestureInject_asyncPromise_5200 - * @tc.desc The parameter input is gesturePath, test the gestureInject() function. - * The result of gestureInject() should be boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_gestureInject_asyncPromise_5200', 0, async function(done) { - let caseName = 'AccessibilityExtensionContextTest_gestureInject_asyncPromise_5200'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityExtensionContextTest_gestureInject_asyncPromise_5300 - * @tc.name AccessibilityExtensionContextTest_gestureInject_asyncPromise_5300 - * @tc.desc The parameter input is gesturePath, test the gestureInject() function. - * The result of gestureInject() should be boolean type. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityExtensionContextTest_gestureInject_asyncPromise_5300', 0, async function (done) { - let caseName = 'AccessibilityExtensionContextTest_gestureInject_asyncPromise_5300'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - }) -} diff --git a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/test/List.test.ets b/barrierfree/accessibilityextensioncontext/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index e800c3c6bae719ec99a0694802b7a71a9b7ddde8..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontext/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 './AccessibilityExtensionContext.test.ets' - -export default function testsuite() { - abilityTest() -} \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontext/entry/src/main/module.json b/barrierfree/accessibilityextensioncontext/entry/src/main/module.json deleted file mode 100644 index 9c8b3612cd049c23137ba9873a9719d50b6e8b6a..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontext/entry/src/main/module.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default", - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [{ - "name": "com.example.accessibilityxts.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [{ - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - }] - }], - "extensionAbilities": [ - { - "name": "AccessibilityExtAbility", - "srcEntrance": "./ets/AccessibilityExtAbility/AccessibilityExtAbility.ts", - "label": "$string:Accessibility_label", - "description": "$string:Accessibility_desc", - "type": "accessibility", - "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" - } - ] - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontext/entry/src/main/resources/base/element/string.json b/barrierfree/accessibilityextensioncontext/entry/src/main/resources/base/element/string.json deleted file mode 100644 index caccebe85978bae1eaa236f53d98dc3fbbaa3923..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontext/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsAccessibilityExtensionTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - }, - { - "name": "Accessibility_desc", - "value": "accessibility_description" - }, - { - "name": "Accessibility_label", - "value": "accessibility_label" - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontext/entry/src/main/resources/base/media/icon.png b/barrierfree/accessibilityextensioncontext/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index 474a55588fd7216113dd42073aadf254d4dba023..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityextensioncontext/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/barrierfree/accessibilityextensioncontext/entry/src/main/resources/base/profile/accessibility_config.json b/barrierfree/accessibilityextensioncontext/entry/src/main/resources/base/profile/accessibility_config.json deleted file mode 100644 index c3562ab303d502e6d285bf9daae51fad0f07367a..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontext/entry/src/main/resources/base/profile/accessibility_config.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "accessibilityCapabilities": [ - "retrieve", - "touchGuide", - "gesture" - ], - "accessibilityCapabilityRationale": "a11y_rationale", - "settingsAbility": "com.accessibility.voiceaid.voiceAidSetting" -} \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontext/entry/src/main/resources/base/profile/main_pages.json b/barrierfree/accessibilityextensioncontext/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index a99e380b1101058975a15da3ddab9efc0f72972a..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontext/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index/index" - ] -} diff --git a/barrierfree/accessibilityextensioncontext/signature/openharmony_sx.p7b b/barrierfree/accessibilityextensioncontext/signature/openharmony_sx.p7b deleted file mode 100644 index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityextensioncontext/signature/openharmony_sx.p7b and /dev/null differ diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/AppScope/app.json b/barrierfree/accessibilityextensioncontextcaperrcode/AppScope/app.json deleted file mode 100644 index 5a401487806987d4e1e1824c70088b5f67184501..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontextcaperrcode/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.accessibilityxts", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon": "$media:icon", - "label": "$string:app_name", - "description": "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/AppScope/resources/base/element/string.json b/barrierfree/accessibilityextensioncontextcaperrcode/AppScope/resources/base/element/string.json deleted file mode 100644 index 633100a6d90763bfac9d20aaae683119d7320e9c..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontextcaperrcode/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string":[ - { - "name":"app_name", - "value":"ohosProject" - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/AppScope/resources/base/media/app_icon.png b/barrierfree/accessibilityextensioncontextcaperrcode/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index 474a55588fd7216113dd42073aadf254d4dba023..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityextensioncontextcaperrcode/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/BUILD.gn b/barrierfree/accessibilityextensioncontextcaperrcode/BUILD.gn deleted file mode 100644 index 7dc6ff4c863bd2c8c689d23ec078ab1b83ff66a4..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontextcaperrcode/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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("ActsAccessibilityExtensionContextCapErrCodeTest") { - hap_profile = "./entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":accessibilityextensioncontextcaperrcode_js_assets", - ":accessibilityextensioncontextcaperrcode_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAccessibilityExtensionContextCapErrCodeTest" - part_name = "accessibility" - subsystem_name = "barrierfree" -} - -ohos_app_scope("accessibilityextensioncontextcaperrcode_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("accessibilityextensioncontextcaperrcode_js_assets") { - source_dir = "./entry/src/main/ets" -} - -ohos_resources("accessibilityextensioncontextcaperrcode_resources") { - sources = [ "./entry/src/main/resources" ] - deps = [ ":accessibilityextensioncontextcaperrcode_app_profile" ] - hap_profile = "./entry/src/main/module.json" -} diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/Test.json b/barrierfree/accessibilityextensioncontextcaperrcode/Test.json deleted file mode 100644 index f385846b250746cf6a3126d62fb90d37bba233c9..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontextcaperrcode/Test.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "360000", - "bundle-name": "com.example.accessibilityxts", - "module-name": "phone", - "shell-timeout": "600000", - "testcase-timeout": 70000 - }, - "kits": [ - { - "test-file-name": [ - "ActsAccessibilityExtensionContextCapErrCodeTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "power-shell wakeup", - "power-shell setmode 602", - "param set persist.ace.testmode.enabled 1" - ] - } - ] -} diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts b/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts deleted file mode 100644 index 123975e6dc9fe9ef9b7f58136ec6018a8edcf3ef..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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 AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtensionAbility'; -import commonEvent from '@ohos.commonEvent'; -import {ExtensionContextTest} from './ExtensionContextTest'; - -class AccessibilityExtAbility extends AccessibilityExtensionAbility { - tester: ExtensionContextTest = undefined; - - onConnect() { - console.info("[Demo] AccessibilityExtAbility onConnect"); - this.tester = new ExtensionContextTest(this.context); - this.tester.init(); - - let commonEventPublishData = { - data: 'connect' - } - commonEvent.publish('onConnectState', commonEventPublishData, publishCallback); - - function publishCallback(err) { - console.info("onConnect====>onConnect publish call back result:" + JSON.stringify(err)); - } - } - - onDisconnect() { - console.info("[Demo] AccessibilityExtAbility onDisconnect"); - let commonEventPublishData = { - data: 'disconnect' - } - commonEvent.publish('onConnectState', commonEventPublishData, publishCallback); - - function publishCallback(err) { - console.info("onDisconnect====>onConnect publish call back result:" + JSON.stringify(err)); - } - - this.tester.clear(); - this.tester = undefined; - } - - onAccessibilityEvent(accessibilityEvent) { - console.info("[Demo] AccessibilityExtAbility onAccessibilityEvent: " + accessibilityEvent.eventType); - } -} - -export default AccessibilityExtAbility; \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/AccessibilityExtAbility/ExtensionContextTest.ts b/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/AccessibilityExtAbility/ExtensionContextTest.ts deleted file mode 100644 index 353014df7a40913c46744baa2bd867418b0dbea4..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/AccessibilityExtAbility/ExtensionContextTest.ts +++ /dev/null @@ -1,156 +0,0 @@ -/* - * 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 commonEvent from '@ohos.commonEvent'; -import display from '@ohos.display' -import { GesturePath } from '@ohos.accessibility.GesturePath'; -import { GesturePoint } from '@ohos.accessibility.GesturePoint'; - -export class ExtensionContextTest { - private context = undefined; - private subScriber = undefined; - - constructor(context) { - this.context = context; - } - - async init() { - this.subScriber = await commonEvent.createSubscriber({events: ['caseExecute']}); - commonEvent.subscribe(this.subScriber, (err, data) => { - console.info('ExtensionContextTest subscribe callback data:' + JSON.stringify(data)); - this.processCase(data.data); - }); - } - - clear() { - commonEvent.unsubscribe(this.subScriber); - this.subScriber = undefined; - this.context = undefined; - } - - private publishCaseResult(caseName: string, result: boolean) { - let commonEventPublishData = { - data: (result ? 'pass' : 'fail'), - parameters: { - case: caseName - } - } - commonEvent.publish('caseResult', commonEventPublishData, (err) => { - console.info("ExtensionContextTest publishCaseResult finish: " + JSON.stringify(commonEventPublishData)); - }); - } - - private async processCase(caseName) { - console.info('ExtensionContextTest processCase: ' + caseName); - let gesturePath; - - switch (caseName) { - case 'ActsAccessibilityExtensionContextCapErrCodeTest_getFocusElement_asyncCallback_0100': - this.getFocusElementByTypeCallback(caseName); - break; - case 'ActsAccessibilityExtensionContextCapErrCodeTest_getWindowRootElement_asyncCallback_0200': - this.getWindowRootElementCallback(caseName); - break; - case 'ActsAccessibilityExtensionContextCapErrCodeTest_getWindows_Callback_0300': - this.getWindowsCallback(caseName); - break; - case 'ActsAccessibilityExtensionContextCapErrCodeTest_gestureInject_asyncCallback_0400': - gesturePath = new GesturePath(60000); - gesturePath.points.push(new GesturePoint(50, 50), - new GesturePoint(100, 100), - new GesturePoint(1000, 1000)); - this.gestureInjectCallback(caseName, gesturePath); - break; - case 'ActsAccessibilityExtensionContextCapErrCodeTest_gestureInject_asyncCallback_0500': - gesturePath = new GesturePath(60000); - gesturePath.points.push(new GesturePoint(50, 50)); - this.gestureInjectPromise(caseName, gesturePath); - break; - default: - console.warn('ExtensionContextTest processCase unknown!!!!!!!!!!'); - break; - } - } - - private async getFocusElementByTypeCallback(caseName: string) { - let result = false; - this.context.getFocusElement(async (err, res) => { - if (err && err.code != 0) { - console.error(caseName + "err: " + JSON.stringify(err.code)); - if (err.code == 9300003) { - result = true; - } - } - this.publishCaseResult(caseName, result); - }); - } - - private async getWindowRootElementCallback(caseName: string) { - let result = false; - this.context.getWindowRootElement(async (err, res) => { - console.info(caseName + " res: " + JSON.stringify(res)); - if (err && err.code != 0) { - console.error(caseName + " err: " + JSON.stringify(err.code)); - if (err.code == 9300003) { - result = true; - } - } - this.publishCaseResult(caseName, result); - }); - } - - private async getWindowsCallback(caseName: string) { - let result = false; - this.context.getWindows((err, res) => { - console.info(caseName + " res: " + JSON.stringify(res)); - if (err && err.code != 0) { - console.error(caseName + " err: " + JSON.stringify(err.code)); - if (err.code == 9300003) { - result = true; - } - } - this.publishCaseResult(caseName, result); - }); - } - - private async gestureInjectCallback(caseName: string, gesturePath: object) { - let result = false; - this.context.injectGesture(gesturePath, (err, res) => { - console.info(caseName + " res: " + JSON.stringify(res)); - if (err && err.code != 0) { - console.error(caseName + " err: " + JSON.stringify(err.code)); - if (err.code == 9300003) { - result = true; - } - } - this.publishCaseResult(caseName, result); - }); - } - - private async gestureInjectPromise(caseName: string, gesturePath: object) { - let result = false; - this.context.injectGesture(gesturePath).then((res) => { - console.info(caseName + "err"); - this.publishCaseResult(caseName, result); - }).catch ((err) => { - if (err && err.code != 0) { - console.error(caseName + " err: " + JSON.stringify(err.code)); - if (err.code == 9300003) { - result = true; - } - } - this.publishCaseResult(caseName, result); - }); - } -} diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/Application/AbilityStage.ts b/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 8a1acf6be6bc92e41cb9001dce17015877b7b36c..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,7 +0,0 @@ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/MainAbility/MainAbility.ts b/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 40427aad12dce08c70cf7f161e73b7d81c3f5377..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,47 +0,0 @@ -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 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() { - // Ability is destroying, release resources for this ability - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate windowStage="+ windowStage) - //globalThis.windowStage = windowStage - //globalThis.abilityStorage = this.storage - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "MainAbility/pages/index/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") - } -}; diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/MainAbility/pages/index/index.ets b/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/MainAbility/pages/index/index.ets deleted file mode 100644 index 34d783925cf411d04cffd8433ee6d3a2388a1d45..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/MainAbility/pages/index/index.ets +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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'; - -@Entry -@Component -struct Index { - @State message: string = 'accessibility ExtensionContext'; - - aboutToAppear(){ - console.info("start run testcase!!!!"); - } - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - .margin({bottom: 10}) - - Row() { - Button('left') - Button('button1') - .margin({ - left: 10, - right: 10 - }) - Button('right') - } - .margin({bottom: 10}) - - Button('button2') - .margin({bottom: 10}) - - Button('button3') - .margin({bottom: 10}) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/TestAbility/TestAbility.ts b/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/TestAbility/TestAbility.ts deleted file mode 100644 index 75889c25d1d74af950262f3fd26da4d1cc3e4aa1..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/TestAbility/TestAbility.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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' - -export default class TestAbility extends Ability { - onCreate(want, launchParam) { - console.log('TestAbility onCreate') - } - - 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') - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/TestAbility/pages/index.ets b/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/TestAbility/pages/index.ets deleted file mode 100644 index e29d33fb1f74914762edf3a6b3abc01b92299ad3..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/TestAbility/pages/index.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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%') - } - } \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 3e708867dfc5e6468c598957128791fa5328c99c..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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.accessibilityxts.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') - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/test/AccessibilityExtensionContextCapErrCode.test.ets b/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/test/AccessibilityExtensionContextCapErrCode.test.ets deleted file mode 100644 index daa188569682bc63af85cdb47fe0673718a5bf5e..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/test/AccessibilityExtensionContextCapErrCode.test.ets +++ /dev/null @@ -1,246 +0,0 @@ -/* - * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" -import commonEvent from '@ohos.commonEvent' -import config from '@ohos.accessibility.config' - -const passStr = 'pass'; -const failStr = 'fail'; - -function publishCaseExecute(caseName: string) { - let commonEventPublishData = { - data: caseName - } - - commonEvent.publish('caseExecute', commonEventPublishData, (err) => { - console.info('caseExecute publish [' + caseName + '] callback result: ' + JSON.stringify(err)); - }); -} - -export default function abilityTest() { - describe('AccessibilityExtensionContextCapErrCodeTest', function () { - let subScriber = undefined; - let isConnect = false; - let caseResult = undefined; - - beforeAll(async function (done) { - console.info('AccessibilityExtensionContextCapErrCodeTest: beforeAll'); - subScriber = await commonEvent.createSubscriber({events: ['onConnectState', 'caseResult']}); - commonEvent.subscribe(subScriber, (err, data) => { - console.info('AccessibilityExtensionContextCapErrCodeTest beforeAll data:' + JSON.stringify(data) ); - if (data.data == 'connect') { - isConnect = true; - } else if (data.data == 'disconnect') { - isConnect = false; - } else if (data.data == passStr || data.data == failStr) { - caseResult = data; - } - }); - - config.enableAbility('com.example.accessibilityxts/AccessibilityExtAbility', - ["keyEventObserver"] - ).then(() => { - console.info(`AccessibilityExtensionContextCapErrCodeTest enableAbility: then`); - }).catch((err) => { - console.error(`AccessibilityExtensionContextCapErrCodeTest enableAbility has error: ${err.code}`); - }); - - setTimeout(done, 5000); - }) - - afterAll(async function (done) { - console.info('AccessibilityExtensionContextCapErrCodeTest: afterAll'); - commonEvent.unsubscribe(subScriber); - isConnect = false; - config.disableAbility('com.example.accessibilityxts/AccessibilityExtAbility').then(() => { - console.info(`AccessibilityExtensionContextCapErrCodeTest disableAbility: then`); - }).catch((err) => { - console.error(`AccessibilityExtensionContextCapErrCodeTest disableAbility has error: ${err.code}`); - }); - setTimeout(done, 5000); - }) - - beforeEach(async function (done) { - console.info('AccessibilityExtensionContextCapErrCodeTest: beforeEach'); - caseResult = undefined; - done(); - }) - - afterEach(async function (done) { - console.info('AccessibilityExtensionContextCapErrCodeTest: afterEach'); - done(); - }) - - /* - * @tc.number ActsAccessibilityExtensionContextCapErrCodeTest_getFocusElement_asyncCallback_0100 - * @tc.name ActsAccessibilityExtensionContextCapErrCodeTest_getFocusElement_asyncCallback_0100 - * @tc.desc No right accessibility so result of getFocusElement() should return errCode. - * @tc.size SmallTest - * @tc.type User - */ - it('ActsAccessibilityExtensionContextCapErrCodeTest_getFocusElement_asyncCallback_0100', 0, async function (done) { - let caseName = 'ActsAccessibilityExtensionContextCapErrCodeTest_getFocusElement_asyncCallback_0100'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number ActsAccessibilityExtensionContextCapErrCodeTest_getWindowRootElement_asyncCallback_0200 - * @tc.name ActsAccessibilityExtensionContextCapErrCodeTest_getWindowRootElement_asyncCallback_0200 - * @tc.desc No right accessibility so result of getWindowRootElement() should return errCode. - * @tc.size SmallTest - * @tc.type User - */ - it('ActsAccessibilityExtensionContextCapErrCodeTest_getWindowRootElement_asyncCallback_0200', 0, async function (done) { - let caseName = 'ActsAccessibilityExtensionContextCapErrCodeTest_getWindowRootElement_asyncCallback_0200'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number ActsAccessibilityExtensionContextCapErrCodeTest_getWindows_Callback_0300 - * @tc.name ActsAccessibilityExtensionContextCapErrCodeTest_getWindows_Callback_0300 - * @tc.desc No right accessibility so result of getWindows should return errCode. - * @tc.size SmallTest - * @tc.type User - */ - it('ActsAccessibilityExtensionContextCapErrCodeTest_getWindows_Callback_0300', 0, async function (done) { - let caseName = 'ActsAccessibilityExtensionContextCapErrCodeTest_getWindows_Callback_0300'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 5500); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number ActsAccessibilityExtensionContextCapErrCodeTest_gestureInject_asyncCallback_0400 - * @tc.name ActsAccessibilityExtensionContextCapErrCodeTest_gestureInject_asyncCallback_0400 - * @tc.desc No right accessibility so result of injectGesture() should return errCode. - * @tc.size SmallTest - * @tc.type User - */ - it('ActsAccessibilityExtensionContextCapErrCodeTest_gestureInject_asyncCallback_0400', 0, async function(done) { - let caseName = 'ActsAccessibilityExtensionContextCapErrCodeTest_gestureInject_asyncCallback_0400'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number ActsAccessibilityExtensionContextCapErrCodeTest_gestureInject_asyncCallback_0500 - * @tc.name ActsAccessibilityExtensionContextCapErrCodeTest_gestureInject_asyncCallback_0500 - * @tc.desc No right accessibility so result of injectGesture() should return errCode. - * @tc.size SmallTest - * @tc.type User - */ - it('ActsAccessibilityExtensionContextCapErrCodeTest_gestureInject_asyncCallback_0500', 0, async function (done) { - let caseName = 'ActsAccessibilityExtensionContextCapErrCodeTest_gestureInject_asyncCallback_0500'; - console.info(caseName + 'start'); - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - if (caseResult != undefined) { - console.info(caseName + ':' + caseResult.data); - expect(passStr).assertEqual(caseResult.data); - expect(caseName).assertEqual(caseResult.parameters.case); - } else { - console.info(caseName + ': caseResult is undefined'); - expect(null).assertFail(); - } - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - }) -} diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/test/List.test.ets b/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 67cb69058a0a998f9c148f2b28b329bc919a8e74..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 './AccessibilityExtensionContextCapErrCode.test.ets' - -export default function testsuite() { - abilityTest() -} diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/module.json b/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/module.json deleted file mode 100644 index 1adc66f550399d2a5d82e6425e0c93a3a200c093..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/module.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default", - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [{ - "name": "com.example.accessibilityxts.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [{ - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - }] - }], - "extensionAbilities": [ - { - "name": "AccessibilityExtAbility", - "srcEntrance": "./ets/AccessibilityExtAbility/AccessibilityExtAbility.ts", - "label": "$string:Accessibility_label", - "description": "$string:Accessibility_desc", - "type": "accessibility", - "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" - } - ] - } -} \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/resources/base/element/string.json b/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/resources/base/element/string.json deleted file mode 100644 index caccebe85978bae1eaa236f53d98dc3fbbaa3923..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsAccessibilityExtensionTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - }, - { - "name": "Accessibility_desc", - "value": "accessibility_description" - }, - { - "name": "Accessibility_label", - "value": "accessibility_label" - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/resources/base/media/icon.png b/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index 474a55588fd7216113dd42073aadf254d4dba023..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/resources/base/profile/accessibility_config.json b/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/resources/base/profile/accessibility_config.json deleted file mode 100644 index 2f3254e67c36efee5db1d6c9e07007e6fff857ad..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/resources/base/profile/accessibility_config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "accessibilityCapabilities": [ - "keyEventObserver" - ], - "accessibilityCapabilityRationale": "a11y_rationale", - "settingsAbility": "com.accessibility.voiceaid.voiceAidSetting" -} \ No newline at end of file diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/resources/base/profile/main_pages.json b/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 74b7ae57500e97c7962acdf33124b86a0d5d3d17..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilityextensioncontextcaperrcode/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index/index" - ] -} diff --git a/barrierfree/accessibilityextensioncontextcaperrcode/signature/openharmony_sx.p7b b/barrierfree/accessibilityextensioncontextcaperrcode/signature/openharmony_sx.p7b deleted file mode 100644 index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilityextensioncontextcaperrcode/signature/openharmony_sx.p7b and /dev/null differ diff --git a/barrierfree/accessibilitygestureevent/AppScope/app.json b/barrierfree/accessibilitygestureevent/AppScope/app.json deleted file mode 100644 index 1658a7acd9e1f7909752cef35a7b3a1ae155e4dc..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilitygestureevent/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.accessibilityxts", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon": "$media:icon", - "label": "$string:app_name", - "description": "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} diff --git a/barrierfree/accessibilitygestureevent/AppScope/resources/base/element/string.json b/barrierfree/accessibilitygestureevent/AppScope/resources/base/element/string.json deleted file mode 100644 index ee69f9a861d9dc269ed6638735d52674583498e1..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilitygestureevent/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string":[ - { - "name":"app_name", - "value":"ohosProject" - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilitygestureevent/AppScope/resources/base/media/app_icon.png b/barrierfree/accessibilitygestureevent/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index 474a55588fd7216113dd42073aadf254d4dba023..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilitygestureevent/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/barrierfree/accessibilitygestureevent/BUILD.gn b/barrierfree/accessibilitygestureevent/BUILD.gn deleted file mode 100644 index 1e426011a0be1fe1cbd3d170e0ef04aa256bcf25..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilitygestureevent/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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("ActsAccessibilityGestureEventTest") { - hap_profile = "./entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":accessibilitygestureevent_js_assets", - ":accessibilitygestureevent_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAccessibilityGestureEventTest" - part_name = "accessibility" - subsystem_name = "barrierfree" -} - -ohos_app_scope("accessibilitygestureevent_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("accessibilitygestureevent_js_assets") { - source_dir = "./entry/src/main/ets" -} - -ohos_resources("accessibilitygestureevent_resources") { - sources = [ "./entry/src/main/resources" ] - deps = [ ":accessibilitygestureevent_app_profile" ] - hap_profile = "./entry/src/main/module.json" -} diff --git a/barrierfree/accessibilitygestureevent/Test.json b/barrierfree/accessibilitygestureevent/Test.json deleted file mode 100644 index 2c22cb8cdaa62b8ce6d71bff06d2c7dabcf9187b..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilitygestureevent/Test.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "bundle-name": "com.example.accessibilityxts", - "module-name": "phone", - "shell-timeout": "180000", - "testcase-timeout": 70000 - }, - "kits": [ - { - "test-file-name": [ - "ActsAccessibilityGestureEventTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - },{ - "type": "ShellKit", - "run-command": [ - "power-shell wakeup", - "power-shell setmode 602" - ] - } - ] -} diff --git a/barrierfree/accessibilitygestureevent/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts b/barrierfree/accessibilitygestureevent/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts deleted file mode 100644 index b62088885f89b38928bf4c106fc4c28353730f8e..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilitygestureevent/entry/src/main/ets/AccessibilityExtAbility/AccessibilityExtAbility.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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 AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtensionAbility'; -import commonEvent from '@ohos.commonEvent'; -import {GestureEventTest} from './GestureEventTest'; - -class AccessibilityExtAbility extends AccessibilityExtensionAbility { - tester: GestureEventTest = undefined; - - onConnect() { - console.info("[Demo] AccessibilityExtAbility onConnect"); - this.tester = new GestureEventTest(this.context); - this.tester.init(); - - let commonEventPublishData = { - data: 'connect' - } - commonEvent.publish('onConnectState', commonEventPublishData, publishCallback); - - function publishCallback(err) { - console.info("onConnect====>onConnect publish call back result:" + JSON.stringify(err)); - } - } - - onDisconnect() { - console.info("[Demo] AccessibilityExtAbility onDisconnect"); - let commonEventPublishData = { - data: 'disconnect' - } - commonEvent.publish('onConnectState', commonEventPublishData, publishCallback); - - function publishCallback(err) { - console.info("onDisconnect====>onConnect publish call back result:" + JSON.stringify(err)); - } - - this.tester.clear(); - this.tester = undefined; - } - - onAccessibilityEvent(accessibilityEvent) { - let type = accessibilityEvent.eventType; - console.info("[Demo] AccessibilityExtAbility onAccessibilityEvent: " + type); - if (type === 'left' || type === 'leftThenRight' || type === 'leftThenUp' || type === 'leftThenDown' - || type === 'right' || type === 'rightThenLeft' || type === 'rightThenUp' || type === 'rightThenDown' - || type === 'up' || type === 'upThenLeft' || type === 'upThenRight' || type === 'upThenDown' - || type === 'down' || type === 'downThenLeft' || type === 'downThenRight' || type === 'downThenUp') { - let commonEventPublishData = { - data: 'accessibilityEvent', - parameters: { - eventType: type - } - } - commonEvent.publish('accessibilityEvent', commonEventPublishData, publishCallback); - } - - function publishCallback(err) { - console.info("[Demo] onAccessibilityEvent====>accessibilityEvent publish call back result:" + JSON.stringify(err)); - } - } -} - -export default AccessibilityExtAbility; \ No newline at end of file diff --git a/barrierfree/accessibilitygestureevent/entry/src/main/ets/AccessibilityExtAbility/GestureEventTest.ts b/barrierfree/accessibilitygestureevent/entry/src/main/ets/AccessibilityExtAbility/GestureEventTest.ts deleted file mode 100644 index 130c8dcf15a719fa1a59477b3636487272dbe518..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilitygestureevent/entry/src/main/ets/AccessibilityExtAbility/GestureEventTest.ts +++ /dev/null @@ -1,245 +0,0 @@ -/* - * 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 commonEvent from '@ohos.commonEvent'; -import { GesturePath } from '@ohos.accessibility.GesturePath'; -import { GesturePoint } from '@ohos.accessibility.GesturePoint'; - -export class GestureEventTest { - private context = undefined; - private subScriber = undefined; - - constructor(context) { - this.context = context; - } - - async init() { - this.subScriber = await commonEvent.createSubscriber({events: ['caseExecute']}); - commonEvent.subscribe(this.subScriber, (err, data) => { - console.info('GestureEventTest subscribe callback data:' + JSON.stringify(data)); - this.processCase(data.data); - }); - } - - clear() { - commonEvent.unsubscribe(this.subScriber); - this.subScriber = undefined; - this.context = undefined; - } - - private async processCase(caseName) { - console.info('GestureEventTest processCase start'); - let gesturePath = new GesturePath(100); - switch (caseName) { - case 'AccessibilityGestureEventTest_0100'://'left' - console.info('GestureEventTest processCase left'); - gesturePath.points.push(new GesturePoint(676, 735), - new GesturePoint(567, 729), - new GesturePoint(444, 719), - new GesturePoint(255, 714), - new GesturePoint(153, 715), - new GesturePoint(15, 729)); - this.gestureInject(caseName, gesturePath); - break; - case 'AccessibilityGestureEventTest_0200'://'leftThenRight' - console.info('GestureEventTest processCase leftThenRight'); - gesturePath.points.push(new GesturePoint(685, 798), - new GesturePoint(575, 792), - new GesturePoint(446, 785), - new GesturePoint(285, 784), - new GesturePoint(206, 785), - new GesturePoint(87, 787), - new GesturePoint(401, 772), - new GesturePoint(535, 786), - new GesturePoint(714, 806)); - this.gestureInject(caseName, gesturePath); - break; - case 'AccessibilityGestureEventTest_0300'://'leftThenUp' - console.info('GestureEventTest processCase leftThenUp'); - gesturePath.points.push(new GesturePoint(652, 903), - new GesturePoint(570, 905), - new GesturePoint(460, 920), - new GesturePoint(280, 737), - new GesturePoint(281, 555), - new GesturePoint(285, 333), - new GesturePoint(284, 116)); - this.gestureInject(caseName, gesturePath); - break; - case 'AccessibilityGestureEventTest_0400'://'leftThenDown' - console.info('GestureEventTest processCase leftThenDown'); - gesturePath.points.push(new GesturePoint(583, 520), - new GesturePoint(468, 485), - new GesturePoint(377, 456), - new GesturePoint(289, 435), - new GesturePoint(283, 626), - new GesturePoint(308, 836), - new GesturePoint(335, 1108)); - this.gestureInject(caseName, gesturePath); - break; - case 'AccessibilityGestureEventTest_0500'://'right' - console.info('GestureEventTest processCase right'); - gesturePath.points.push(new GesturePoint(77, 589), - new GesturePoint(185, 589), - new GesturePoint(318, 589), - new GesturePoint(499, 589), - new GesturePoint(630, 588)); - this.gestureInject(caseName, gesturePath); - break; - case 'AccessibilityGestureEventTest_0600'://'rightThenLeft' - console.info('GestureEventTest processCase rightThenLeft'); - gesturePath.points.push(new GesturePoint(174, 731), - new GesturePoint(251, 743), - new GesturePoint(393, 772), - new GesturePoint(673, 817), - new GesturePoint(591, 805), - new GesturePoint(511, 791), - new GesturePoint(423, 779), - new GesturePoint(333, 768), - new GesturePoint(244, 764), - new GesturePoint(167, 759), - new GesturePoint(71, 755)); - this.gestureInject(caseName, gesturePath); - break; - case 'AccessibilityGestureEventTest_0700'://'rightThenUp' - console.info('GestureEventTest processCase rightThenUp'); - gesturePath.points.push(new GesturePoint(117, 950), - new GesturePoint(216, 950), - new GesturePoint(311, 950), - new GesturePoint(438, 933), - new GesturePoint(491, 791), - new GesturePoint(478, 622), - new GesturePoint(471, 473), - new GesturePoint(464, 320), - new GesturePoint(458, 186)); - this.gestureInject(caseName, gesturePath); - break; - case 'AccessibilityGestureEventTest_0800'://'rightThenDown' - console.info('GestureEventTest processCase rightThenDown'); - gesturePath.points.push(new GesturePoint(204, 501), - new GesturePoint(307, 486), - new GesturePoint(422, 478), - new GesturePoint(547, 604), - new GesturePoint(440, 771), - new GesturePoint(348, 906)); - this.gestureInject(caseName, gesturePath); - break; - case 'AccessibilityGestureEventTest_0900'://'up' - console.info('GestureEventTest processCase up'); - gesturePath.points.push(new GesturePoint(372, 1053), - new GesturePoint(355, 873), - new GesturePoint(320, 558), - new GesturePoint(296, 314), - new GesturePoint(285, 163)); - this.gestureInject(caseName, gesturePath); - break; - case 'AccessibilityGestureEventTest_1000'://'upThenLeft' - console.info('GestureEventTest processCase upThenLeft'); - gesturePath.points.push(new GesturePoint(437, 1139), - new GesturePoint(437, 985), - new GesturePoint(453, 739), - new GesturePoint(466, 591), - new GesturePoint(483, 455), - new GesturePoint(489, 321), - new GesturePoint(383, 274), - new GesturePoint(258, 273), - new GesturePoint(179, 276), - new GesturePoint(102, 286), - new GesturePoint(3, 298)); - this.gestureInject(caseName, gesturePath); - break; - case 'AccessibilityGestureEventTest_1100'://'upThenRight' - console.info('GestureEventTest processCase upThenRight'); - gesturePath.points.push(new GesturePoint(332, 1143), - new GesturePoint(322, 973), - new GesturePoint(300, 779), - new GesturePoint(276, 627), - new GesturePoint(259, 496), - new GesturePoint(375, 406), - new GesturePoint(468, 409), - new GesturePoint(704, 436)); - this.gestureInject(caseName, gesturePath); - break; - case 'AccessibilityGestureEventTest_1200'://'upThenDown' - console.info('GestureEventTest processCase upThenDown'); - gesturePath.points.push(new GesturePoint(377, 1047), - new GesturePoint(368, 863), - new GesturePoint(355, 564), - new GesturePoint(339, 353), - new GesturePoint(331, 210), - new GesturePoint(361, 409), - new GesturePoint(375, 665), - new GesturePoint(380, 824), - new GesturePoint(386, 977), - new GesturePoint(393, 1177)); - this.gestureInject(caseName, gesturePath); - break; - case 'AccessibilityGestureEventTest_1300'://'down' - console.info('GestureEventTest processCase down'); - gesturePath.points.push(new GesturePoint(352, 250), - new GesturePoint(371, 462), - new GesturePoint(377, 828), - new GesturePoint(378, 956), - new GesturePoint(385, 1121)); - this.gestureInject(caseName, gesturePath); - break; - case 'AccessibilityGestureEventTest_1400'://'downThenLeft' - console.info('GestureEventTest processCase downThenLeft'); - gesturePath.points.push(new GesturePoint(404, 177), - new GesturePoint(406, 318), - new GesturePoint(405, 459), - new GesturePoint(415, 764), - new GesturePoint(432, 910), - new GesturePoint(335, 935), - new GesturePoint(262, 934), - new GesturePoint(182, 933), - new GesturePoint(24, 929)); - this.gestureInject(caseName, gesturePath); - break; - case 'AccessibilityGestureEventTest_1500'://'downThenRight' - console.info('GestureEventTest processCase downThenRight'); - gesturePath.points.push(new GesturePoint(317, 247), - new GesturePoint(318, 393), - new GesturePoint(299, 614), - new GesturePoint(280, 766), - new GesturePoint(278, 919), - new GesturePoint(419, 961), - new GesturePoint(502, 957), - new GesturePoint(627, 939)); - this.gestureInject(caseName, gesturePath); - break; - case 'AccessibilityGestureEventTest_1600'://'downThenUp' - console.info('GestureEventTest processCase downThenUp'); - gesturePath.points.push(new GesturePoint(321, 213), - new GesturePoint(346, 407), - new GesturePoint(354, 664), - new GesturePoint(356, 833), - new GesturePoint(358, 970), - new GesturePoint(357, 738), - new GesturePoint(349, 603), - new GesturePoint(344, 450), - new GesturePoint(342, 304), - new GesturePoint(340, 115)); - this.gestureInject(caseName, gesturePath); - break; - default: - console.warn('GestureEventTest processCase unknown!!!!!!!!!!'); - break; - } - } - - private async gestureInject(caseName: string, gesturePath: object) { - await this.context?.injectGesture(gesturePath); - console.info('GestureEventTest processCase: ' + caseName); - } -} \ No newline at end of file diff --git a/barrierfree/accessibilitygestureevent/entry/src/main/ets/Application/AbilityStage.ts b/barrierfree/accessibilitygestureevent/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 32dfe93ccff0375201857794de902cec4d239442..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilitygestureevent/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,7 +0,0 @@ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/barrierfree/accessibilitygestureevent/entry/src/main/ets/MainAbility/MainAbility.ts b/barrierfree/accessibilitygestureevent/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index cd47e022551551b3c393359b8cccafb7462c600a..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilitygestureevent/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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 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() { - // Ability is destroying, release resources for this ability - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate windowStage=" + windowStage) - //globalThis.windowStage = windowStage - //globalThis.abilityStorage = this.storage - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "MainAbility/pages/index/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") - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilitygestureevent/entry/src/main/ets/MainAbility/pages/index/index.ets b/barrierfree/accessibilitygestureevent/entry/src/main/ets/MainAbility/pages/index/index.ets deleted file mode 100644 index 83a21e8ff3279e5e8588a6d30cab940c15968c2b..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilitygestureevent/entry/src/main/ets/MainAbility/pages/index/index.ets +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 { - @State message: string = 'accessibilityEvent For Gesture'; - - aboutToAppear(){ - console.info("start run testcase!!!!"); - } - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/barrierfree/accessibilitygestureevent/entry/src/main/ets/TestAbility/TestAbility.ts b/barrierfree/accessibilitygestureevent/entry/src/main/ets/TestAbility/TestAbility.ts deleted file mode 100644 index 89a84730505783ba229175ab4b55d37f91a16266..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilitygestureevent/entry/src/main/ets/TestAbility/TestAbility.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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' - -export default class TestAbility extends Ability { - onCreate(want, launchParam) { - console.log('TestAbility onCreate') - } - - 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') - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilitygestureevent/entry/src/main/ets/TestAbility/pages/index.ets b/barrierfree/accessibilitygestureevent/entry/src/main/ets/TestAbility/pages/index.ets deleted file mode 100644 index b93567f962921124b282f78c8ef123965d1460c9..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilitygestureevent/entry/src/main/ets/TestAbility/pages/index.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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%') - } - } \ No newline at end of file diff --git a/barrierfree/accessibilitygestureevent/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/barrierfree/accessibilitygestureevent/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index fde2966cd3df4d631cff5b012cbe4421d902d19c..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilitygestureevent/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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.accessibilityxts.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') - } -}; \ No newline at end of file diff --git a/barrierfree/accessibilitygestureevent/entry/src/main/ets/test/AccessibilityGestureEventTest.test.ets b/barrierfree/accessibilitygestureevent/entry/src/main/ets/test/AccessibilityGestureEventTest.test.ets deleted file mode 100644 index 10f3e152dcf056874b9d8c2d28c034b5c8769693..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilitygestureevent/entry/src/main/ets/test/AccessibilityGestureEventTest.test.ets +++ /dev/null @@ -1,689 +0,0 @@ -/* - * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' -import commonEvent from '@ohos.commonEvent' -import config from '@ohos.accessibility.config' -import { GesturePath } from '@ohos.accessibility.GesturePath'; -import { GesturePoint } from '@ohos.accessibility.GesturePoint'; - -function publishCaseExecute(caseName: string) { - let commonEventPublishData = { - data: caseName - } - - commonEvent.publish('caseExecute', commonEventPublishData, (err) => { - console.info('caseExecute publish [' + caseName + '] callback result: ' + JSON.stringify(err)); - }); -} - -export default function abilityTest() { - let gestureEventTypes: Array = []; - describe('AccessibilityGestureEventTest', function () { - let subScriber = undefined; - let isConnect = false; - - beforeAll(async function (done) { - console.info('AccessibilityGestureEventTest: beforeAll'); - subScriber = await commonEvent.createSubscriber({events: ['onConnectState', 'accessibilityEvent']}); - commonEvent.subscribe(subScriber, (err, data) => { - console.info('AccessibilityGestureEventTest beforeAll data:' + JSON.stringify(data) ); - if (data.data == 'connect') { - isConnect = true; - } else if (data.data == 'disconnect') { - isConnect = false; - } else if (data.data == 'accessibilityEvent') { - gestureEventTypes.push(data.parameters.eventType); - } - }); - - config.enableAbility('com.example.accessibilityxts/AccessibilityExtAbility', - ["retrieve", "touchGuide", "gesture"] - ).then(() => { - console.info(`AccessibilityGestureEventTest enableAbility: then`); - }).catch((err) => { - console.error(`AccessibilityGestureEventTest enableAbility has error: ${err.code}`); - }); - - setTimeout(done, 3000); - }) - - afterAll(async function (done) { - console.info('AccessibilityGestureEventTest: afterAll'); - commonEvent.unsubscribe(subScriber); - config.disableAbility('com.example.accessibilityxts/AccessibilityExtAbility').then(() => { - console.info(`AccessibilityGestureEventTest disableAbility: then`); - }).catch((err) => { - console.error(`AccessibilityGestureEventTest disableAbility has error: ${err.code}`); - }); - setTimeout(done, 5000); - }) - - beforeEach(async function (done) { - console.info('AccessibilityGestureEventTest: beforeEach'); - gestureEventTypes.length = 0; - setTimeout(done, 5000); - }) - - afterEach(async function (done) { - console.info('AccessibilityGestureEventTest: afterEach'); - done(); - }) - - /* - * @tc.number AccessibilityGestureEventTest_0100 - * @tc.name AccessibilityGestureEventTest_0100 - * @tc.desc The inject Gesture is 'left', test the received accessibility - * gesture event is 'left' and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityGestureEventTest_0100', 0, async function (done) { - let caseName = 'AccessibilityGestureEventTest_0100'; - console.info(caseName + 'start'); - - let gestureType = 'left'; - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - let gestureTypes = gestureEventTypes; - let findResult = false; - for (let eventType of gestureTypes) { - if (gestureType == eventType || gestureTypes.length != 0) { - findResult = true; - } - } - console.info('AccessibilityGestureEventTest_0100 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityGestureEventTest_0200 - * @tc.name AccessibilityGestureEventTest_0200 - * @tc.desc The inject Gesture is 'leftThenRight', test the received accessibility - * gesture event is 'leftThenRight' and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityGestureEventTest_0200', 0, async function (done) { - let caseName = 'AccessibilityGestureEventTest_0200'; - console.info(caseName + 'start'); - - let gestureType = 'leftThenRight'; - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - let gestureTypes = gestureEventTypes; - let findResult = false; - for (let eventType of gestureTypes) { - if (gestureType == eventType || gestureTypes.length != 0) { - findResult = true; - } - } - console.info('AccessibilityGestureEventTest_0200 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityGestureEventTest_0300 - * @tc.name AccessibilityGestureEventTest_0300 - * @tc.desc The inject Gesture is 'leftThenUp', test the received accessibility - * gesture event is 'leftThenUp' and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityGestureEventTest_0300', 0, async function (done) { - let caseName = 'AccessibilityGestureEventTest_0300'; - console.info(caseName + 'start'); - - let gestureType = 'leftThenUp'; - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - let gestureTypes = gestureEventTypes; - let findResult = false; - for (let eventType of gestureTypes) { - if (gestureType == eventType || gestureTypes.length != 0) { - findResult = true; - } - } - console.info('AccessibilityGestureEventTest_0300 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityGestureEventTest_0400 - * @tc.name AccessibilityGestureEventTest_0400 - * @tc.desc The inject Gesture is 'leftThenDown', test the received accessibility - * gesture event is 'leftThenDown' and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityGestureEventTest_0400', 0, async function (done) { - let caseName = 'AccessibilityGestureEventTest_0400'; - console.info(caseName + 'start'); - - let gestureType = 'leftThenDown'; - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - let gestureTypes = gestureEventTypes; - let findResult = false; - for (let eventType of gestureTypes) { - if (gestureType == eventType || gestureTypes.length != 0) { - findResult = true; - } - } - console.info('AccessibilityGestureEventTest_0400 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityGestureEventTest_0500 - * @tc.name AccessibilityGestureEventTest_0500 - * @tc.desc The inject Gesture is 'right', test the received accessibility - * gesture event is 'right' and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityGestureEventTest_0500', 0, async function (done) { - let caseName = 'AccessibilityGestureEventTest_0500'; - console.info(caseName + 'start'); - - let gestureType = 'right'; - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - let gestureTypes = gestureEventTypes; - let findResult = false; - for (let eventType of gestureTypes) { - if (gestureType == eventType || gestureTypes.length != 0) { - findResult = true; - } - } - console.info('AccessibilityGestureEventTest_0500 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityGestureEventTest_0600 - * @tc.name AccessibilityGestureEventTest_0600 - * @tc.desc The inject Gesture is 'rightThenLeft', test the received accessibility - * gesture event is 'rightThenLeft' and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityGestureEventTest_0600', 0, async function (done) { - let caseName = 'AccessibilityGestureEventTest_0600'; - console.info(caseName + 'start'); - - let gestureType = 'rightThenLeft'; - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - let gestureTypes = gestureEventTypes; - let findResult = false; - for (let eventType of gestureTypes) { - if (gestureType == eventType || gestureTypes.length != 0) { - findResult = true; - } - } - console.info('AccessibilityGestureEventTest_0600 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityGestureEventTest_0700 - * @tc.name AccessibilityGestureEventTest_0700 - * @tc.desc The inject Gesture is 'rightThenUp', test the received accessibility - * gesture event is 'rightThenUp' and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityGestureEventTest_0700', 0, async function (done) { - let caseName = 'AccessibilityGestureEventTest_0700'; - console.info(caseName + 'start'); - - let gestureType = 'rightThenUp'; - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - let gestureTypes = gestureEventTypes; - let findResult = false; - for (let eventType of gestureTypes) { - if (gestureType == eventType || gestureTypes.length != 0) { - findResult = true; - } - } - console.info('AccessibilityGestureEventTest_0700 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityGestureEventTest_0800 - * @tc.name AccessibilityGestureEventTest_0800 - * @tc.desc The inject Gesture is 'rightThenDown', test the received accessibility - * gesture event is 'rightThenDown' and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityGestureEventTest_0800', 0, async function (done) { - let caseName = 'AccessibilityGestureEventTest_0800'; - console.info(caseName + 'start'); - - let gestureType = 'rightThenDown'; - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - let gestureTypes = gestureEventTypes; - let findResult = false; - for (let eventType of gestureTypes) { - if (gestureType == eventType || gestureTypes.length != 0) { - findResult = true; - } - } - console.info('AccessibilityGestureEventTest_0800 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityGestureEventTest_0900 - * @tc.name AccessibilityGestureEventTest_0900 - * @tc.desc The inject Gesture is 'up', test the received accessibility - * gesture event is 'up' and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityGestureEventTest_0900', 0, async function (done) { - let caseName = 'AccessibilityGestureEventTest_0900'; - console.info(caseName + 'start'); - - let gestureType = 'up'; - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - let gestureTypes = gestureEventTypes; - let findResult = false; - for (let eventType of gestureTypes) { - if (gestureType == eventType || gestureTypes.length != 0) { - findResult = true; - } - } - console.info('AccessibilityGestureEventTest_0900 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityGestureEventTest_1000 - * @tc.name AccessibilityGestureEventTest_1000 - * @tc.desc The inject Gesture is 'upThenLeft', test the received accessibility - * gesture event is 'upThenLeft' and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityGestureEventTest_1000', 0, async function (done) { - let caseName = 'AccessibilityGestureEventTest_1000'; - console.info(caseName + 'start'); - - let gestureType = 'upThenLeft'; - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - let gestureTypes = gestureEventTypes; - let findResult = false; - for (let eventType of gestureTypes) { - if (gestureType == eventType || gestureTypes.length != 0) { - findResult = true; - } - } - console.info('AccessibilityGestureEventTest_1000 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityGestureEventTest_1100 - * @tc.name AccessibilityGestureEventTest_1100 - * @tc.desc The inject Gesture is 'upThenRight', test the received accessibility - * gesture event is 'upThenRight' and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityGestureEventTest_1100', 0, async function (done) { - let caseName = 'AccessibilityGestureEventTest_1100'; - console.info(caseName + 'start'); - - let gestureType = 'upThenRight'; - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - let gestureTypes = gestureEventTypes; - let findResult = false; - for (let eventType of gestureTypes) { - if (gestureType == eventType || gestureTypes.length != 0) { - findResult = true; - } - } - console.info('AccessibilityGestureEventTest_1100 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityGestureEventTest_1200 - * @tc.name AccessibilityGestureEventTest_1200 - * @tc.desc The inject Gesture is 'upThenDown', test the received accessibility - * gesture event is 'upThenDown' and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityGestureEventTest_1200', 0, async function (done) { - let caseName = 'AccessibilityGestureEventTest_1200'; - console.info(caseName + 'start'); - - let gestureType = 'upThenDown'; - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - let gestureTypes = gestureEventTypes; - let findResult = false; - for (let eventType of gestureTypes) { - if (gestureType == eventType || gestureTypes.length != 0) { - findResult = true; - } - } - console.info('AccessibilityGestureEventTest_1200 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityGestureEventTest_1300 - * @tc.name AccessibilityGestureEventTest_1300 - * @tc.desc The inject Gesture is 'down', test the received accessibility - * gesture event is 'down' and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityGestureEventTest_1300', 0, async function (done) { - let caseName = 'AccessibilityGestureEventTest_1300'; - console.info(caseName + 'start'); - - let gestureType = 'down'; - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - let gestureTypes = gestureEventTypes; - let findResult = false; - for (let eventType of gestureTypes) { - if (gestureType == eventType || gestureTypes.length != 0) { - findResult = true; - } - } - console.info('AccessibilityGestureEventTest_1300 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityGestureEventTest_1400 - * @tc.name AccessibilityGestureEventTest_1400 - * @tc.desc The inject Gesture is 'downThenLeft', test the received accessibility - * gesture event is 'downThenLeft' and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityGestureEventTest_1400', 0, async function (done) { - let caseName = 'AccessibilityGestureEventTest_1400'; - console.info(caseName + 'start'); - - let gestureType = 'downThenLeft'; - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - let gestureTypes = gestureEventTypes; - let findResult = false; - for (let eventType of gestureTypes) { - if (gestureType == eventType || gestureTypes.length != 0) { - findResult = true; - } - } - console.info('AccessibilityGestureEventTest_1400 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityGestureEventTest_1500 - * @tc.name AccessibilityGestureEventTest_1500 - * @tc.desc The inject Gesture is 'downThenRight', test the received accessibility - * gesture event is 'downThenRight' and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityGestureEventTest_1500', 0, async function (done) { - let caseName = 'AccessibilityGestureEventTest_1500'; - console.info(caseName + 'start'); - - let gestureType = 'downThenRight'; - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - let gestureTypes = gestureEventTypes; - let findResult = false; - for (let eventType of gestureTypes) { - if (gestureType == eventType || gestureTypes.length != 0) { - findResult = true; - } - } - console.info('AccessibilityGestureEventTest_1500 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityGestureEventTest_1600 - * @tc.name AccessibilityGestureEventTest_1600 - * @tc.desc The inject Gesture is 'downThenUp', test the received accessibility - * gesture event is 'downThenUp' and return void. - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityGestureEventTest_1600', 0, async function (done) { - let caseName = 'AccessibilityGestureEventTest_1600'; - console.info(caseName + 'start'); - - let gestureType = 'downThenUp'; - - if (isConnect) { - publishCaseExecute(caseName); - - setTimeout(() => { - let gestureTypes = gestureEventTypes; - let findResult = false; - for (let eventType of gestureTypes) { - if (gestureType == eventType || gestureTypes.length != 0) { - findResult = true; - } - } - console.info('AccessibilityGestureEventTest_1600 case: ' + findResult); - expect(findResult).assertTrue(); - done(); - }, 3000); - } else { - console.error(caseName + ': extension not connected'); - expect(null).assertFail(); - done(); - } - }) - - /* - * @tc.number AccessibilityGestureEventTest_1700 - * @tc.name AccessibilityGestureEventTest_1700 - * @tc.desc test positionX positionX - * @tc.size SmallTest - * @tc.type User - */ - it('AccessibilityGestureEventTest_1700', 0, async function (done) { - let caseName = 'AccessibilityGestureEventTest_1700'; - console.info(caseName + 'start'); - - let gesturePoint = new GesturePoint(676, 735); - expect(gesturePoint.positionX == 676).assertTrue(); - expect(gesturePoint.positionY == 735).assertTrue(); - - let gesturePath = new GesturePath(100); - expect(gesturePath.durationTime == 100).assertTrue(); - - gesturePath.points.push(new GesturePoint(676, 735), - new GesturePoint(567, 729), - new GesturePoint(444, 719), - new GesturePoint(255, 714), - new GesturePoint(153, 715), - new GesturePoint(15, 729)); - expect(gesturePath.points.length == 6).assertTrue(); - console.info(caseName + 'start'); - done(); - }) - }) -} diff --git a/barrierfree/accessibilitygestureevent/entry/src/main/ets/test/List.test.ets b/barrierfree/accessibilitygestureevent/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index c29aa970cd0859fcfb43574b8bbbf447b7491c43..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilitygestureevent/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 './AccessibilityGestureEventTest.test.ets' - -export default function testsuite() { - abilityTest() -} \ No newline at end of file diff --git a/barrierfree/accessibilitygestureevent/entry/src/main/module.json b/barrierfree/accessibilitygestureevent/entry/src/main/module.json deleted file mode 100644 index 2b835817b88e995c752fb096ff09da61a0b90633..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilitygestureevent/entry/src/main/module.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default", - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [{ - "name": "com.example.accessibilityxts.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [{ - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - }] - }], - "extensionAbilities": [ - { - "name": "AccessibilityExtAbility", - "srcEntrance": "./ets/AccessibilityExtAbility/AccessibilityExtAbility.ts", - "label": "$string:Accessibility_label", - "description": "$string:Accessibility_desc", - "type": "accessibility", - "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" - } - ] - } -} \ No newline at end of file diff --git a/barrierfree/accessibilitygestureevent/entry/src/main/resources/base/element/string.json b/barrierfree/accessibilitygestureevent/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 054efce5f9d049f24f8afa1f2deee36c29a22d4a..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilitygestureevent/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsAccessibilityExtensionTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "serviceability_description", - "value": "my whether" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "app_name", - "value": "Demo" - }, - { - "name": "Accessibility_desc", - "value": "accessibility_description" - }, - { - "name": "Accessibility_label", - "value": "accessibility_label" - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibilitygestureevent/entry/src/main/resources/base/media/icon.png b/barrierfree/accessibilitygestureevent/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index 474a55588fd7216113dd42073aadf254d4dba023..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilitygestureevent/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/barrierfree/accessibilitygestureevent/entry/src/main/resources/base/profile/accessibility_config.json b/barrierfree/accessibilitygestureevent/entry/src/main/resources/base/profile/accessibility_config.json deleted file mode 100644 index c3562ab303d502e6d285bf9daae51fad0f07367a..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilitygestureevent/entry/src/main/resources/base/profile/accessibility_config.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "accessibilityCapabilities": [ - "retrieve", - "touchGuide", - "gesture" - ], - "accessibilityCapabilityRationale": "a11y_rationale", - "settingsAbility": "com.accessibility.voiceaid.voiceAidSetting" -} \ No newline at end of file diff --git a/barrierfree/accessibilitygestureevent/entry/src/main/resources/base/profile/main_pages.json b/barrierfree/accessibilitygestureevent/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index a99e380b1101058975a15da3ddab9efc0f72972a..0000000000000000000000000000000000000000 --- a/barrierfree/accessibilitygestureevent/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index/index" - ] -} diff --git a/barrierfree/accessibilitygestureevent/signature/openharmony_sx.p7b b/barrierfree/accessibilitygestureevent/signature/openharmony_sx.p7b deleted file mode 100644 index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibilitygestureevent/signature/openharmony_sx.p7b and /dev/null differ diff --git a/barrierfree/accessibilitysendaccessibilityevent/entry/src/main/ets/Application/AbilityStage.ts b/barrierfree/accessibilitysendaccessibilityevent/entry/src/main/ets/Application/AbilityStage.ts index 071c0d862407f266470cd7488a13b6bd745ee8fa..d617b713d9c8220dab387c3d844ed68b83b927a8 100644 --- a/barrierfree/accessibilitysendaccessibilityevent/entry/src/main/ets/Application/AbilityStage.ts +++ b/barrierfree/accessibilitysendaccessibilityevent/entry/src/main/ets/Application/AbilityStage.ts @@ -1,4 +1,4 @@ -import AbilityStage from "@ohos.application.AbilityStage" +import AbilityStage from "@ohos.app.ability.AbilityStage" export default class MyAbilityStage extends AbilityStage { onCreate() { diff --git a/barrierfree/accessibilitysendaccessibilityevent/entry/src/main/ets/MainAbility/MainAbility.ts b/barrierfree/accessibilitysendaccessibilityevent/entry/src/main/ets/MainAbility/MainAbility.ts index f9014b87a17cf7c30fb45d2f0455ac8e783a64f7..7e6de36c2c28a9145f54cba7fda122d3955bde1c 100644 --- a/barrierfree/accessibilitysendaccessibilityevent/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/barrierfree/accessibilitysendaccessibilityevent/entry/src/main/ets/MainAbility/MainAbility.ts @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Ability from '@ohos.application.Ability' +import Ability from '@ohos.app.ability.UIAbility' export default class MainAbility extends Ability { onCreate(want,launchParam){ diff --git a/barrierfree/accessibilitysendaccessibilityevent/entry/src/main/ets/TestAbility/TestAbility.ts b/barrierfree/accessibilitysendaccessibilityevent/entry/src/main/ets/TestAbility/TestAbility.ts index 78935adb89211ab492fb41a13635b475f5224b0b..cf3c10e0562d75ae6b2379838f2cd382cd18558a 100644 --- a/barrierfree/accessibilitysendaccessibilityevent/entry/src/main/ets/TestAbility/TestAbility.ts +++ b/barrierfree/accessibilitysendaccessibilityevent/entry/src/main/ets/TestAbility/TestAbility.ts @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Ability from '@ohos.application.Ability' +import Ability from '@ohos.app.ability.UIAbility' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' import { Hypium } from '@ohos/hypium' import testsuite from '../test/List.test' diff --git a/barrierfree/accessibilitysendaccessibilityevent/entry/src/main/module.json b/barrierfree/accessibilitysendaccessibilityevent/entry/src/main/module.json index e05c7b28f63a8bf9a0640243aedfc8a8e6ac3d3c..1ef4f93d3740502407b8b4d6151aabda44878e12 100644 --- a/barrierfree/accessibilitysendaccessibilityevent/entry/src/main/module.json +++ b/barrierfree/accessibilitysendaccessibilityevent/entry/src/main/module.json @@ -32,14 +32,6 @@ }] }], - "requestPermissions": [{ - "name": "ohos.permission.READ_ACCESSIBILITY_CONFIG", - "reason": "need use ohos.permission.READ_ACCESSIBILITY_CONFIG" - }, - { - "name": "ohos.permission.WRITE_ACCESSIBILITY_CONFIG", - "reason": "need use ohos.permission.WRITE_ACCESSIBILITY_CONFIG" - } - ] + "requestPermissions": [] } } \ No newline at end of file diff --git a/barrierfree/accessibilitysendaccessibilityevent/signature/openharmony_sx.p7b b/barrierfree/accessibilitysendaccessibilityevent/signature/openharmony_sx.p7b index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..26582542f5fe63bfaa0a91037221853e533e8850 100644 Binary files a/barrierfree/accessibilitysendaccessibilityevent/signature/openharmony_sx.p7b and b/barrierfree/accessibilitysendaccessibilityevent/signature/openharmony_sx.p7b differ diff --git a/barrierfree/accessibleabilitylist/signature/openharmony_sx.p7b b/barrierfree/accessibleabilitylist/signature/openharmony_sx.p7b index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..f844884d9f13c3578ca915e1cb67aa81b87dab46 100644 Binary files a/barrierfree/accessibleabilitylist/signature/openharmony_sx.p7b and b/barrierfree/accessibleabilitylist/signature/openharmony_sx.p7b differ diff --git a/barrierfree/accessiblecaptionconfiguration/signature/openharmony_sx.p7b b/barrierfree/accessiblecaptionconfiguration/signature/openharmony_sx.p7b index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..58c12ded656578ab95b5d874cee3d388b8cdfa3f 100644 Binary files a/barrierfree/accessiblecaptionconfiguration/signature/openharmony_sx.p7b and b/barrierfree/accessiblecaptionconfiguration/signature/openharmony_sx.p7b differ diff --git a/barrierfree/accessiblecheckability/signature/openharmony_sx.p7b b/barrierfree/accessiblecheckability/signature/openharmony_sx.p7b index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..dba05947cbdd2ffa2582fa6552a51b9dff2d98a2 100644 Binary files a/barrierfree/accessiblecheckability/signature/openharmony_sx.p7b and b/barrierfree/accessiblecheckability/signature/openharmony_sx.p7b differ diff --git a/barrierfree/accessibleregisterstate/signature/openharmony_sx.p7b b/barrierfree/accessibleregisterstate/signature/openharmony_sx.p7b index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..6d13cd9918d373c0cdaef7c647dd92d341a9b218 100644 Binary files a/barrierfree/accessibleregisterstate/signature/openharmony_sx.p7b and b/barrierfree/accessibleregisterstate/signature/openharmony_sx.p7b differ diff --git a/barrierfree/accessiblesendevent/signature/openharmony_sx.p7b b/barrierfree/accessiblesendevent/signature/openharmony_sx.p7b index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..96836487dbf6fb2c4af2e123b8dd6cbcb30ea42f 100644 Binary files a/barrierfree/accessiblesendevent/signature/openharmony_sx.p7b and b/barrierfree/accessiblesendevent/signature/openharmony_sx.p7b differ diff --git a/barrierfree/accessibletest/BUILD.gn b/barrierfree/accessibletest/BUILD.gn deleted file mode 100644 index 4a4805f145e3dbc9782a9c9bb84b9349b97dac5a..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/BUILD.gn +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (C) 2021 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("//build/ohos_var.gni") - -group("actsaccessibletest") { - testonly = true - if (is_standard_system) { - deps = [ - "actsabilitylisttest:ActsAbilityListTest", - "actscaptionconfigurationtest:ActsCaptionConfigurationTest", - "actsgesturesimulationtest:ActsGestureSimulationTest", - "sceneProject/accessibilityAudibleAbility:accessibilityAudibleAbility", - "sceneProject/accessibilityGenericAbility:accessibilityGenericAbility", - "sceneProject/accessibilityHapticAbility:accessibilityHapticAbility", - "sceneProject/accessibilitySpokenAbility:accessibilitySpokenAbility", - "sceneProject/accessibilityVisualAbility:accessibilityVisualAbility", - ] - } -} diff --git a/barrierfree/accessibletest/actsabilitylisttest/AppScope/app.json b/barrierfree/accessibletest/actsabilitylisttest/AppScope/app.json deleted file mode 100644 index e7e8606d8f5ee69b2cb72f71f1089957136af670..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsabilitylisttest/AppScope/app.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "app": { - "bundleName": "com.example.abilitylisttest", - "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 - } - } -} diff --git a/barrierfree/accessibletest/actsabilitylisttest/AppScope/resources/base/element/string.json b/barrierfree/accessibletest/actsabilitylisttest/AppScope/resources/base/element/string.json deleted file mode 100644 index b9d556bebf5f976578683fc750102cc13e853127..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsabilitylisttest/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "AbilityListTest" - } - ] -} diff --git a/barrierfree/accessibletest/actsabilitylisttest/AppScope/resources/base/media/app_icon.png b/barrierfree/accessibletest/actsabilitylisttest/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/actsabilitylisttest/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/barrierfree/accessibletest/actsabilitylisttest/BUILD.gn b/barrierfree/accessibletest/actsabilitylisttest/BUILD.gn deleted file mode 100644 index 50796edf680f4a68e4bd873f35f869b53d5c6b78..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsabilitylisttest/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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("ActsAbilityListTest") { - 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 = "ActsAbilityListTest" - 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" -} diff --git a/barrierfree/accessibletest/actsabilitylisttest/Test.json b/barrierfree/accessibletest/actsabilitylisttest/Test.json deleted file mode 100644 index b69097677c0632b3be36307eda2a8aaeedada765..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsabilitylisttest/Test.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "280000", - "bundle-name": "com.example.abilitylisttest", - "module-name": "phone", - "shell-timeout": "600000", - "testcase-timeout": 70000 - }, - "kits": [ - { - "test-file-name": [ - "ActsAbilityListTest.hap", - "accessibilityAudibleAbility.hap", - "accessibilityGenericAbility.hap", - "accessibilityHapticAbility.hap", - "accessibilitySpokenAbility.hap", - "accessibilityVisualAbility.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "power-shell wakeup", - "power-shell setmode 602", - "param set persist.ace.testmode.enabled 1" - ], - "teardown-command":[ - "bm uninstall -n com.example.abilitylisttest", - "bm uninstall -n com.example.accessibleaudibleability.hmservice", - "bm uninstall -n com.example.accessiblegenericability.hmservice", - "bm uninstall -n com.example.accessiblehapticability.hmservice", - "bm uninstall -n com.example.accessiblespokenability.hmservice", - "bm uninstall -n com.example.accessiblevisualability.hmservice" - ] - } - ] -} diff --git a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/Application/AbilityStage.ts b/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 4972d0cb74d9e97563c81264a0c2cb9d290d353e..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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.log("[AbilityListTest] MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/MainAbility/MainAbility.ts b/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index b17fcff203e5c2c5f770dee0fcfa21a77e15eb14..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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.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") - } -}; diff --git a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/MainAbility/pages/index.ets b/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 86a3fab7a074a579a18e7bc980d009596dce26c8..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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 config from '@ohos.accessibility.config' -import accessibility from '@ohos.accessibility' -import prompt from '@ohos.prompt' - -const AUDIBLE_BUNDLE_NAME = 'com.example.accessibleaudibleability.hmservice/ServiceExtAbility' -const GENERIC_BUNDLE_NAME = 'com.example.accessiblegenericability.hmservice/ServiceExtAbility' -const HAPTIC_BUNDLE_NAME = 'com.example.accessiblehapticability.hmservice/ServiceExtAbility' -const SPOKEN_BUNDLE_NAME = 'com.example.accessiblespokenability.hmservice/ServiceExtAbility' -const VISUAL_BUNDLE_NAME = 'com.example.accessiblevisualability.hmservice/ServiceExtAbility' -const LOG_PREFIX = '[CQH-ABILITY-LIST-TEST-MANUAL]' - -@Entry -@Component -struct Index { - @State message: string = 'AbilityListTest' - @State abilityListsCallBack: string = '' - @State abilityListsPromise: string = '' - - aboutToAppear() { - console.info("start run aboutToAppear") - } - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button('AbilityList_0170-0180启动辅助应用') - .fontSize(25) - .fontWeight(FontWeight.Bold) - .margin(5) - .onClick((e) => { - this.enableAbility(LOG_PREFIX, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - }) - Button('AbilityList_0170-0180关闭辅助应用') - .fontSize(25) - .fontWeight(FontWeight.Bold) - .margin(5) - .onClick((e) => { - this.disableAbility(LOG_PREFIX, [AUDIBLE_BUNDLE_NAME]) - }) - Button('AbilityList_0170(callback)查询辅助应用') - .fontSize(25) - .fontWeight(FontWeight.Bold) - .margin(5) - .onClick((e) => { - accessibility.getAbilityLists('all', 'enable', (err, data) => { - if (err && err.code != 0) { - console.error(LOG_PREFIX + 'failed to getAbilityLists because ' + JSON.stringify(err)) - return - } - console.error(LOG_PREFIX + 'success data:getAbilityLists : ' + JSON.stringify(data)) - console.error(LOG_PREFIX + 'data.length : ' + JSON.stringify(data.length)) - this.abilityListsCallBack = JSON.stringify(data) - }) - }) - Text(this.abilityListsCallBack) - .fontSize(25) - Button('AbilityList_0180(promise)查询辅助应用') - .fontSize(25) - .fontWeight(FontWeight.Bold) - .margin(5) - .onClick((e) => { - accessibility.getAbilityLists('all', 'enable').then((data) => { - console.error(LOG_PREFIX + 'success data:getAbilityLists : ' + JSON.stringify(data)) - console.error(LOG_PREFIX + 'data.length : ' + JSON.stringify(data.length)) - this.abilityListsPromise = JSON.stringify(data) - }).catch((err) => { - console.error(LOG_PREFIX + 'failed to getAbilityLists because ' + JSON.stringify(err)) - }) - }) - Text(this.abilityListsPromise) - .fontSize(25) - } - .width('100%') - } - .height('100%') - } - - enableAbility(logTag, bundleNameArr) { - for (let bundleName of bundleNameArr) { - config.enableAbility(bundleName, ['retrieve']).then((data) => { - console.error(logTag + 'enableAbility ' + bundleName + ' success. data: ' + JSON.stringify(data)) - prompt.showToast({ message: '启动应用成功'}) - }).catch((error) => { - console.error(logTag + 'enableAbility ' + bundleName + ' failed. Cause: ' + JSON.stringify(error)) - prompt.showToast({ message: '启动应用异常'}) - return - }) - } - } - - disableAbility(logTag, bundleNameArr) { - for (let bundleName of bundleNameArr) { - config.disableAbility(bundleName).then((data) => { - console.error(logTag + 'disableAbility ' + bundleName + ' success. data: ' + JSON.stringify(data)) - prompt.showToast({ message: '关闭应用成功'}) - }).catch((error) => { - console.error(logTag + 'disableAbility ' + bundleName + ' failed. Cause: ' + JSON.stringify(error)) - prompt.showToast({ message: '关闭应用异常'}) - return - }) - } - } -} diff --git a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/TestAbility/TestAbility.ts b/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/TestAbility/TestAbility.ts deleted file mode 100644 index 20877f79a5ad57aa25c107d236bd4c3835d0d472..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/TestAbility/TestAbility.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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') - } -}; diff --git a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/TestAbility/pages/index.ets b/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/TestAbility/pages/index.ets deleted file mode 100644 index 33b5d087aff46bee138cb4b6086fa0579101c8db..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/TestAbility/pages/index.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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%') - } - } diff --git a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 09b160c7278dd0db1c256d2b489386b1f303acc5..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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.abilitylisttest.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') - } -}; diff --git a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/test/Ability.test.ets b/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/test/Ability.test.ets deleted file mode 100644 index d30a8da7cd0c317f600b611e7656540b10a25a28..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/test/Ability.test.ets +++ /dev/null @@ -1,624 +0,0 @@ -/* - * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' -import config from '@ohos.accessibility.config' -import accessibility from '@ohos.accessibility' -import prompt from '@ohos.prompt' - -const AUDIBLE_BUNDLE_NAME = 'com.example.accessibleaudibleability.hmservice/ServiceExtAbility' -const GENERIC_BUNDLE_NAME = 'com.example.accessiblegenericability.hmservice/ServiceExtAbility' -const HAPTIC_BUNDLE_NAME = 'com.example.accessiblehapticability.hmservice/ServiceExtAbility' -const SPOKEN_BUNDLE_NAME = 'com.example.accessiblespokenability.hmservice/ServiceExtAbility' -const VISUAL_BUNDLE_NAME = 'com.example.accessiblevisualability.hmservice/ServiceExtAbility' -const LOG_PREFIX = '[CQH-ABILITY-LIST-TEST]' -const TIME_OUT = 3000 -const TIME_OUT_S = 1000 - -export default function abilityTest() { - describe('ActsAbilityListTest', function () { - afterEach(async function (done) { - disableAll(LOG_PREFIX + ' disableAll ') - setTimeout(() => { - done() - }, TIME_OUT) - }) - afterAll(async function (done) { - prompt.showToast({ - message: 'CASE All End' - }) - done() - }) - /** - * @tc.number: AbilityList_0010 - * @tc.name: getAbilityLists callback API. - * @tc.desc: getAbilityLists callback API abilityType is spoken, stateType is install. - */ - it('AbilityList_0010', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0010 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('spoken', 'install', (err, data) => { - if (err && err.code != 0) { - console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - return - } - console.info(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - console.info(logTag + 'data.length : ' + JSON.stringify(data.length)) - expect(data.length).assertLarger(0) - done() - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0020 - * @tc.name: getAbilityLists promise API. - * @tc.desc: getAbilityLists promise API abilityType is spoken, stateType is install. - */ - it('AbilityList_0020', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0020 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('spoken', 'install').then((data) => { - console.info(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - console.info(logTag + 'data.length : ' + JSON.stringify(data.length)) - expect(data.length).assertLarger(0) - done() - }).catch((err) => { - console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0030 - * @tc.name: getAbilityLists callback API. - * @tc.desc: getAbilityLists callback API abilityType is audible, stateType is install. - */ - it('AbilityList_0030', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0030 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('audible', 'install', (err, data) => { - if (err && err.code != 0) { - console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - return - } - console.info(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - console.info(logTag + 'data.length : ' + JSON.stringify(data.length)) - expect(data.length).assertLarger(0) - done() - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0040 - * @tc.name: getAbilityLists promise API. - * @tc.desc: getAbilityLists promise API abilityType is audible, stateType is install. - */ - it('AbilityList_0040', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0040 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('audible', 'install').then((data) => { - console.info(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - console.info(logTag + 'data.length : ' + JSON.stringify(data.length)) - expect(data.length).assertLarger(0) - done() - }).catch((err) => { - console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0050 - * @tc.name: getAbilityLists callback API. - * @tc.desc: getAbilityLists callback API abilityType is visual, stateType is install. - */ - it('AbilityList_0050', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0050 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('visual', 'install', (err, data) => { - if (err && err.code != 0) { - console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - return - } - console.info(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - console.info(logTag + 'data.length : ' + JSON.stringify(data.length)) - expect(data.length).assertLarger(0) - done() - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0060 - * @tc.name: getAbilityLists promise API. - * @tc.desc: getAbilityLists promise API abilityType is visual, stateType is install. - */ - it('AbilityList_0060', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0060 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('visual', 'install').then((data) => { - console.info(LOG_PREFIX + 'success data:getAbilityLists : ' + JSON.stringify(data)) - console.info(logTag + 'data.length : ' + JSON.stringify(data.length)) - expect(data.length).assertLarger(0) - done() - }).catch((err) => { - console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0070 - * @tc.name: getAbilityLists callback API. - * @tc.desc: getAbilityLists callback API abilityType is haptic, stateType is install. - */ - it('AbilityList_0070', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0070 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('haptic', 'install', (err, data) => { - if (err && err.code != 0) { - console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - return - } - console.info(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - console.info(logTag + 'data.length : ' + JSON.stringify(data.length)) - expect(data.length).assertLarger(0) - done() - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0080 - * @tc.name: getAbilityLists promise API. - * @tc.desc: getAbilityLists promise API abilityType is haptic, stateType is install. - */ - it('AbilityList_0080', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0080 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('haptic', 'install').then((data) => { - console.info(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - console.info(logTag + 'data.length : ' + JSON.stringify(data.length)) - expect(data.length).assertLarger(0) - done() - }).catch((err) => { - console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0090 - * @tc.name: getAbilityLists callback API. - * @tc.desc: getAbilityLists callback API abilityType is generic, stateType is install. - */ - it('AbilityList_0090', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0090 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('generic', 'install', (err, data) => { - if (err && err.code != 0) { - console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - return - } - console.info(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - console.info(logTag + 'data.length : ' + JSON.stringify(data.length)) - expect(data.length).assertLarger(0) - done() - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0100 - * @tc.name: getAbilityLists promise API. - * @tc.desc: getAbilityLists promise API abilityType is generic, stateType is install. - */ - it('AbilityList_0100', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0100 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('generic', 'install').then((data) => { - console.info(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - console.info(logTag + 'data.length : ' + JSON.stringify(data.length)) - expect(data.length).assertLarger(0) - done() - }).catch((err) => { - console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0110 - * @tc.name: getAbilityLists callback API. - * @tc.desc: getAbilityLists callback API abilityType is all, stateType is enable. - */ - it('AbilityList_0110', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0110 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('all', 'enable', (err, data) => { - if (err && err.code != 0) { - console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - return - } - console.info(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - console.info(logTag + 'data.length : ' + JSON.stringify(data.length)) - expect(data.length).assertLarger(0) - done() - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0111 - * @tc.name: getAbilityLists callback API. - * @tc.desc: getAbilityLists callback API abilityType is all, stateType is enable, get eventTypes. - */ - it('AbilityList_0111', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0111 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('all', 'enable', (err, data) => { - if (err && err.code != 0) { - console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - return - } - console.info(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - let eventTypes = [] - if (data.length > 0) { - eventTypes = data[0].eventTypes - } - expect(eventTypes.length).assertLarger(0) - done() - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0112 - * @tc.name: getAbilityLists callback API. - * @tc.desc: getAbilityLists callback API abilityType is all, stateType is enable, get targetBundleNames. - */ - it('AbilityList_0112', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0112 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('all', 'enable', (err, data) => { - if (err && err.code != 0) { - console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - return - } - console.info(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - let targetBundleNames = [] - if (data.length > 0) { - targetBundleNames = data[0].targetBundleNames - } - expect(targetBundleNames.length).assertLarger(0) - done() - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0113 - * @tc.name: getAbilityLists callback API. - * @tc.desc: getAbilityLists callback API abilityType is all, stateType is enable, get other attribute. - */ - it('AbilityList_0113', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0113 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('all', 'enable', (err, data) => { - if (err && err.code != 0) { - console.error(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - return - } - console.error(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - let id = '' - let name = '' - let bundleName = '' - let abilityTypes = [] - let capabilities = [] - let description = '' - if (data.length > 0) { - id = data[0].id - name = data[0].name - bundleName = data[0].bundleName - abilityTypes = data[0].abilityTypes - capabilities = data[0].capabilities - description = data[0].description - } - expect(id.length).assertLarger(0) - expect(name.length).assertLarger(0) - expect(bundleName.length).assertLarger(0) - expect(abilityTypes.length).assertLarger(0) - expect(capabilities.length).assertLarger(0) - expect(description.length).assertLarger(0) - done() - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0120 - * @tc.name: getAbilityLists promise API. - * @tc.desc: getAbilityLists promise API abilityType is all, stateType is enable. - */ - it('AbilityList_0120', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0120 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('all', 'enable').then((data) => { - console.info(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - console.info(logTag + 'data.length : ' + JSON.stringify(data.length)) - expect(data.length).assertLarger(0) - done() - }).catch((err) => { - console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0121 - * @tc.name: getAbilityLists promise API. - * @tc.desc: getAbilityLists promise API abilityType is all, stateType is enable, get eventTypes. - */ - it('AbilityList_0121', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0121 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('all', 'enable').then((data) => { - console.info(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - let eventTypes = [] - if (data.length > 0) { - eventTypes = data[0].eventTypes - } - expect(eventTypes.length).assertLarger(0) - done() - }).catch((err) => { - console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0122 - * @tc.name: getAbilityLists promise API. - * @tc.desc: getAbilityLists promise API abilityType is all, stateType is enable, get targetBundleNames. - */ - it('AbilityList_0122', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0122 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('all', 'enable').then((data) => { - console.info(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - let targetBundleNames = [] - if (data.length > 0) { - targetBundleNames = data[0].targetBundleNames - } - expect(targetBundleNames.length).assertLarger(0) - done() - }).catch((err) => { - console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0123 - * @tc.name: getAbilityLists promise API. - * @tc.desc: getAbilityLists promise API abilityType is all, stateType is enable, get other attribute. - */ - it('AbilityList_0123', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0123 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('all', 'enable').then((data) => { - console.error(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - let id = '' - let name = '' - let bundleName = '' - let abilityTypes = [] - let capabilities = [] - let description = '' - if (data.length > 0) { - id = data[0].id - name = data[0].name - bundleName = data[0].bundleName - abilityTypes = data[0].abilityTypes - capabilities = data[0].capabilities - description = data[0].description - } - expect(id.length).assertLarger(0) - expect(name.length).assertLarger(0) - expect(bundleName.length).assertLarger(0) - expect(abilityTypes.length).assertLarger(0) - expect(capabilities.length).assertLarger(0) - expect(description.length).assertLarger(0) - done() - }).catch((err) => { - console.error(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0130 - * @tc.name: getAbilityLists callback API. - * @tc.desc: getAbilityLists callback API abilityType is all, stateType is disable. - */ - it('AbilityList_0130', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0130 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('all', 'disable', (err, data) => { - if (err && err.code != 0) { - console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - return - } - console.info(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - console.info(logTag + 'data.length : ' + JSON.stringify(data.length)) - expect(data.length).assertLarger(0) - done() - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0140 - * @tc.name: getAbilityLists promise API. - * @tc.desc: getAbilityLists promise API abilityType is all, stateType is disable. - */ - it('AbilityList_0140', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0140 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('all', 'disable').then((data) => { - console.info(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - console.info(logTag + 'data.length : ' + JSON.stringify(data.length)) - expect(data.length).assertLarger(0) - done() - }).catch((err) => { - console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0150 - * @tc.name: getAbilityLists callback API. - * @tc.desc: getAbilityLists callback API abilityType is all, stateType is enable. - */ - it('AbilityList_0150', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0150 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('all', 'disable', (err, data) => { - if (err && err.code != 0) { - console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - return - } - console.info(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - console.info(logTag + 'data.length : ' + JSON.stringify(data.length)) - expect(data.length).assertLarger(0) - done() - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - /** - * @tc.number: AbilityList_0160 - * @tc.name: getAbilityLists promise API. - * @tc.desc: getAbilityLists promise API abilityType is all, stateType is enable. - */ - it('AbilityList_0160', 1, async function (done) { - let logTag = LOG_PREFIX + ' AbilityList_0160 ' - enableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME]) - setTimeout(() => { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME]) - setTimeout(() => { - accessibility.getAbilityLists('all', 'disable').then((data) => { - console.info(logTag + 'success data:getAbilityLists : ' + JSON.stringify(data)) - console.info(logTag + 'data.length : ' + JSON.stringify(data.length)) - expect(data.length).assertLarger(0) - done() - }).catch((err) => { - console.info(logTag + 'failed to getAbilityLists because ' + JSON.stringify(err)) - }) - }, TIME_OUT) - }, TIME_OUT_S) - }) - }) - - function enableAbility(logTag, bundleNameArr) { - for (let bundleName of bundleNameArr) { - config.enableAbility(bundleName, ['retrieve']).then(() => { - console.info(logTag + 'enableAbility ' + bundleName + ' success.') - }).catch((error) => { - console.info(logTag + 'enableAbility ' + bundleName + ' failed. Cause: ' + JSON.stringify(error)) - return - }) - } - } - - function disableAbility(logTag, bundleNameArr) { - for (let bundleName of bundleNameArr) { - config.disableAbility(bundleName).then(() => { - console.info(logTag + 'disableAbility ' + bundleName + ' success.') - }).catch((error) => { - console.info(logTag + 'disableAbility ' + bundleName + ' failed. Cause: ' + JSON.stringify(error)) - return - }) - } - } - - function disableAll(logTag) { - disableAbility(logTag, [AUDIBLE_BUNDLE_NAME, GENERIC_BUNDLE_NAME, HAPTIC_BUNDLE_NAME, SPOKEN_BUNDLE_NAME, VISUAL_BUNDLE_NAME]) - } -} diff --git a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/test/List.test.ets b/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index cb35098ac281d443c7add6de76cee00a268ce092..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 diff --git a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/module.json b/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/module.json deleted file mode 100644 index 6232e63c98cf3fc24d3bd36f1908d993b1c52efa..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/module.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:entry_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default", - "phone", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "com.example.abilitylisttest.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" - ] - } - ] - } - ], - "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" - } - ] - } -} diff --git a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/resources/base/element/string.json b/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 26c6350af6eeb5284556f05dd7a8360a06b2b5f5..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "string": [ - { - "name": "entry_desc", - "value": "AbilityListTest entry" - }, - { - "name": "MainAbility_desc", - "value": "AbilityListTest MainAbility" - }, - { - "name": "MainAbility_label", - "value": "AbilityList" - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/resources/base/media/icon.png b/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/resources/base/profile/main_pages.json b/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index c1858c216308ad312862a877139a8ba6908ec3c6..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsabilitylisttest/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index" - ] -} diff --git a/barrierfree/accessibletest/actsabilitylisttest/signature/openharmony_sx.p7b b/barrierfree/accessibletest/actsabilitylisttest/signature/openharmony_sx.p7b deleted file mode 100644 index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/actsabilitylisttest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/barrierfree/accessibletest/actscaptionconfigurationtest/AppScope/app.json b/barrierfree/accessibletest/actscaptionconfigurationtest/AppScope/app.json deleted file mode 100644 index c626da84041386e4a7767b2cbfeafe13ac2c8b57..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actscaptionconfigurationtest/AppScope/app.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "app": { - "bundleName": "com.example.myapplicationxtsd", - "vendor": "example", - "versionCode": 1000000, - "versionName": "1.0.0", - "icon": "$media:app_icon", - "label": "$string:app_name", - "description": "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} diff --git a/barrierfree/accessibletest/actscaptionconfigurationtest/AppScope/resources/base/element/string.json b/barrierfree/accessibletest/actscaptionconfigurationtest/AppScope/resources/base/element/string.json deleted file mode 100644 index bea3196ac976df41039009ea9ba8af2a4c8003a7..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actscaptionconfigurationtest/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "MyApplicationXtsD" - }, - { - "name": "description_application", - "value": "MyApplicationXtsD" - } - ] -} diff --git a/barrierfree/accessibletest/actscaptionconfigurationtest/AppScope/resources/base/media/app_icon.png b/barrierfree/accessibletest/actscaptionconfigurationtest/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/actscaptionconfigurationtest/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/barrierfree/accessibletest/actscaptionconfigurationtest/BUILD.gn b/barrierfree/accessibletest/actscaptionconfigurationtest/BUILD.gn deleted file mode 100644 index 321a2b7d93375598fee2924f8328c0a70ea6b457..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actscaptionconfigurationtest/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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("ActsCaptionConfigurationTest") { - 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 = "ActsCaptionConfigurationTest" - 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" -} diff --git a/barrierfree/accessibletest/actscaptionconfigurationtest/Test.json b/barrierfree/accessibletest/actscaptionconfigurationtest/Test.json deleted file mode 100644 index d0b668300c1cccd1b6c89bac008d68df8e94d33e..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actscaptionconfigurationtest/Test.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "500000", - "bundle-name": "com.example.myapplicationxtsd", - "module-name": "phone", - "shell-timeout": "600000", - "testcase-timeout": 70000 - }, - "kits": [ - { - "test-file-name": [ - "ActsCaptionConfigurationTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "power-shell wakeup", - "power-shell setmode 602", - "param set persist.ace.testmode.enabled 1" - ], - "teardown-command":[ - "bm uninstall -n com.example.myapplicationxtsd" - ] - } - ] -} diff --git a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/Application/AbilityStage.ts b/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index add36a172b393fc11866ac788a9a3d8258410cdf..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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("[Demo] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/MainAbility/MainAbility.ts b/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 871643e56b2d19878104d250c2fecc0f721e4adf..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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") - } -}; diff --git a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/MainAbility/pages/index.ets b/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 2427bbde2907b3a624b915bc0f2fbb9cf0ee22a2..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,677 +0,0 @@ -/* - * 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 commonEvent from '@ohos.commonEvent' -import accessibility from '@ohos.accessibility'; -import config from '@ohos.accessibility.config' - -export { }; -const LOG: string = "[xtsLog]"; - -const CaptionConfiguration_0270 = () => { - const caseName = "CaptionConfiguration_0270" - const logTag = LOG + caseName; - config.captions.get().then((res) => { - console.info(logTag + "Config before modification. enabled=" + res); - config.captions.set(!res).then(() => { - console.info(logTag + "Config after modification. enabled=" + !res); - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "caption set err=" + JSON.stringify(err)); - }); - }); -} - -const printCaptionsManagerStyle = (logTag, captionsManager) => { - const back = "{\"fontFamily\":\"" + captionsManager.style.fontFamily + - "\",\"fontScale\":" + captionsManager.style.fontScale + - ",\"fontColor\":\"" + captionsManager.style.fontColor + - "\",\"fontEdgeType\":\"" + captionsManager.style.fontEdgeType + - "\",\"backgroundColor\":\"" + captionsManager.style.backgroundColor + - "\",\"windowColor\":\"" + captionsManager.style.windowColor + "\"}"; - console.info(logTag + back); - return back; -}; - -const printCaptionStyle = (logTag, CaptionStyle) => { - const back = "{\"fontFamily\":\"" + CaptionStyle.fontFamily + - "\",\"fontScale\":" + CaptionStyle.fontScale + - ",\"fontColor\":\"" + CaptionStyle.fontColor + - "\",\"fontEdgeType\":\"" + CaptionStyle.fontEdgeType + - "\",\"backgroundColor\":\"" + CaptionStyle.backgroundColor + - "\",\"windowColor\":\"" + CaptionStyle.windowColor + "\"}"; - console.info(logTag + back); - return back; -}; - -const foreachList = (currValue, array) => { - if (!currValue || currValue.length < 1) { - return array[0]; - } - let result = array[0]; - array.forEach((value, index) => { - if (currValue === value) { - if (array.length > index + 1) { - result = array[index + 1]; - } - } - }); - return result; -} - -const CaptionConfiguration_0280 = () => { - const caseName = "CaptionConfiguration_0280" - const logTag = LOG + caseName; - config.captionsStyle.get().then((res) => { - if (!res) { - console.info(logTag + "captionsStyle is undefined"); - return; - } - var captionsStyle = res; - printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res)); - captionsStyle.fontFamily = foreachList(res.fontFamily, ['default', 'monospacedSerif', 'serif', - 'monospacedSansSerif', 'sansSerif', 'casual', 'cursive', 'smallCapitals']); - printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle)); - config.captionsStyle.set(captionsStyle).then(() => { - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); - }); - }) -}; - -const CaptionConfiguration_0290 = () => { - const caseName = "CaptionConfiguration_0290" - const logTag = LOG + caseName; - config.captions.get().then((res) => { - console.info(logTag + "Config before modification. enabled=" + res); - config.captions.set(!res).then(() => { - console.info(logTag + "Config after modification. enabled=" + !res); - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "caption set err=" + JSON.stringify(err)); - }); - }); -} - -const CaptionConfiguration_0300 = () => { - const caseName = "CaptionConfiguration_0300" - const logTag = LOG + caseName; - config.captionsStyle.get().then((res) => { - if (!res) { - console.info(logTag + "captionsStyle is undefined"); - return; - } - var captionsStyle = res; - printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res)); - captionsStyle.fontFamily = foreachList(res.fontFamily, ['default', 'monospacedSerif', 'serif', - 'monospacedSansSerif', 'sansSerif', 'casual', 'cursive', 'smallCapitals']); - printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle)); - config.captionsStyle.set(captionsStyle).then(() => { - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); - }); - }) -}; - -const CaptionConfiguration_0310 = () => { - const caseName = "CaptionConfiguration_0310" - const logTag = LOG + caseName; - config.captionsStyle.get().then((res) => { - if (!res) { - console.info(logTag + "captionsStyle is undefined"); - return; - } - var captionsStyle = res; - printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res)); - captionsStyle.fontFamily = foreachList(res.fontFamily, ['default', 'monospacedSerif', 'serif', - 'monospacedSansSerif', 'sansSerif', 'casual', 'cursive', 'smallCapitals']); - printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle)); - config.captionsStyle.set(captionsStyle).then(() => { - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); - }); - }) -}; - -const CaptionConfiguration_0320 = () => { - const caseName = "CaptionConfiguration_0320" - const logTag = LOG + caseName; - config.captionsStyle.get().then((res) => { - if (!res) { - console.info(logTag + "captionsStyle is undefined"); - return; - } - var captionsStyle = res; - printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res)); - captionsStyle.fontScale = (res.fontScale ?? 0) + 1; - printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle)); - config.captionsStyle.set(captionsStyle).then(() => { - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); - }); - }) -}; - -const CaptionConfiguration_0330 = () => { - const caseName = "CaptionConfiguration_0330" - const logTag = LOG + caseName; - config.captionsStyle.get().then((res) => { - if (!res) { - console.info(logTag + "captionsStyle is undefined"); - return; - } - var captionsStyle = res; - printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res)); - captionsStyle.fontColor = foreachList(res.fontColor, ['red', 'yellow', 'blue', '#FFFFFF', '#000000', 'black', 'white']); - printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle)); - config.captionsStyle.set(captionsStyle).then(() => { - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); - }); - }) -}; - -const CaptionConfiguration_0340 = () => { - const caseName = "CaptionConfiguration_0340" - const logTag = LOG + caseName; - config.captionsStyle.get().then((res) => { - if (!res) { - console.info(logTag + "captionsStyle is undefined"); - return; - } - var captionsStyle = res; - printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res)); - captionsStyle.fontEdgeType = foreachList(res.fontEdgeType, ['none', 'raised', 'depressed', 'uniform', 'dropShadow']); - printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle)); - config.captionsStyle.set(captionsStyle).then(() => { - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); - }); - }) -}; - -const CaptionConfiguration_0090 = () => { - const caseName = "CaptionConfiguration_0090" - const logTag = LOG + caseName; - config.captionsStyle.get().then((res) => { - if (!res) { - console.info(logTag + "captionsStyle is undefined"); - return; - } - var captionsStyle = res; - printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res)); - captionsStyle.backgroundColor = foreachList(res.backgroundColor, ['red', 'yellow', 'blue', '#ff0000ff', '#ff000000', '#00000000', '#f0000000', 'black', 'white']); - printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle)); - config.captionsStyle.set(captionsStyle).then(() => { - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); - }); - }) -}; - -const CaptionConfiguration_0100 = () => { - const caseName = "CaptionConfiguration_0100" - const logTag = LOG + caseName; - config.captionsStyle.get().then((res) => { - if (!res) { - console.info(logTag + "captionsStyle is undefined"); - return; - } - var captionsStyle = res; - printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res)); - captionsStyle.windowColor = foreachList(res.windowColor, ['red', 'yellow', 'blue', '#ff0000ff', '#ff000000', '#00000000', '#f0000000', 'black', 'white']); - printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle)); - config.captionsStyle.set(captionsStyle).then(() => { - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); - }); - }) -}; - -const CaptionConfiguration_0110 = () => { - const caseName = "CaptionConfiguration_0110" - const logTag = LOG + caseName; - config.captionsStyle.get().then((res) => { - if (!res) { - console.info(logTag + "captionsStyle is undefined"); - return; - } - var captionsStyle = res; - for (let index = 0; index < 3; index++) { - printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res)); - captionsStyle.windowColor = foreachList(res.windowColor, ['red', 'yellow', 'blue', '#ff0000ff', '#ff000000', '#00000000', '#f0000000', 'black', 'white']); - printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle)); - config.captionsStyle.set(captionsStyle).then(() => { - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); - }); - } - }) -}; - -const CaptionConfiguration_0120 = () => { - const caseName = "CaptionConfiguration_0120" - const logTag = LOG + caseName; - config.captions.get().then((res) => { - console.info(logTag + "Config before modification. enabled=" + res); - config.captions.set(!res).then(() => { - console.info(logTag + "Config after modification. enabled=" + !res); - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "caption set err=" + JSON.stringify(err)); - }); - }); -}; - -const CaptionConfiguration_0130 = () => { - const caseName = "CaptionConfiguration_0130" - const logTag = LOG + caseName; - config.captionsStyle.get().then((res) => { - if (!res) { - console.info(logTag + "captionsStyle is undefined"); - return; - } - var captionsStyle = res; - printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res)); - captionsStyle.fontEdgeType = undefined; - printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle)); - config.captionsStyle.set(captionsStyle).then(() => { - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); - }); - }) -}; - -const CaptionConfiguration_0140 = () => { - const caseName = "CaptionConfiguration_0140" - const logTag = LOG + caseName; - config.captions.get().then((res) => { - console.info(logTag + "Config before modification. enabled=" + res); - config.captions.set(!res).then(() => { - console.info(logTag + "Config after modification. enabled=" + !res); - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "caption set err=" + JSON.stringify(err)); - }); - }); -}; - -const CaptionConfiguration_0150 = () => { - const caseName = "CaptionConfiguration_0150" - const logTag = LOG + caseName; - config.captionsStyle.get().then((res) => { - if (!res) { - console.info(logTag + "captionsStyle is undefined"); - return; - } - var captionsStyle = res; - printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res)); - captionsStyle.fontFamily = foreachList(res.fontFamily, ['default', 'monospacedSerif', 'serif', - 'monospacedSansSerif', 'sansSerif', 'casual', 'cursive', 'smallCapitals']); - printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle)); - config.captionsStyle.set(captionsStyle).then(() => { - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); - }); - }) -}; - -const CaptionConfiguration_0160 = () => { - const caseName = "CaptionConfiguration_0160" - const logTag = LOG + caseName; - config.captions.get().then((res) => { - console.info(logTag + "Config before modification. enabled=" + res); - config.captions.set(!res).then(() => { - console.info(logTag + "Config after modification. enabled=" + !res); - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "caption set err=" + JSON.stringify(err)); - }); - }); -}; - -const CaptionConfiguration_0170 = () => { - const caseName = "CaptionConfiguration_0170" - const logTag = LOG + caseName; - config.captionsStyle.get().then((res) => { - if (!res) { - console.info(logTag + "captionsStyle is undefined"); - return; - } - var captionsStyle = res; - printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res)); - captionsStyle.fontFamily = foreachList(res.fontFamily, ['default', 'monospacedSerif', 'serif', - 'monospacedSansSerif', 'sansSerif', 'casual', 'cursive', 'smallCapitals']); - printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle)); - config.captionsStyle.set(captionsStyle).then(() => { - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); - }); - }) -}; - -const CaptionConfiguration_0180 = () => { - const caseName = "CaptionConfiguration_0180" - const logTag = LOG + caseName; - config.captionsStyle.get().then((res) => { - if (!res) { - console.info(logTag + "captionsStyle is undefined"); - return; - } - var captionsStyle = res; - printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res)); - captionsStyle.fontFamily = foreachList(res.fontFamily, ['default', 'monospacedSerif', 'serif', - 'monospacedSansSerif', 'sansSerif', 'casual', 'cursive', 'smallCapitals']); - printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle)); - config.captionsStyle.set(captionsStyle).then(() => { - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); - }); - }) -}; - -const CaptionConfiguration_0190 = () => { - const caseName = "CaptionConfiguration_0190" - const logTag = LOG + caseName; - config.captionsStyle.get().then((res) => { - if (!res) { - console.info(logTag + "captionsStyle is undefined"); - return; - } - var captionsStyle = res; - printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res)); - captionsStyle.fontScale = (res.fontScale ?? 0) + 1; - printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle)); - config.captionsStyle.set(captionsStyle).then(() => { - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); - }); - }) -}; - -const CaptionConfiguration_0200 = () => { - const caseName = "CaptionConfiguration_0200" - const logTag = LOG + caseName; - config.captionsStyle.get().then((res) => { - if (!res) { - console.info(logTag + "captionsStyle is undefined"); - return; - } - var captionsStyle = res; - printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res)); - captionsStyle.fontColor = foreachList(res.fontColor, ['red', 'yellow', 'blue', '#FFFFFF', '#000000', 'black', 'white']); - printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle)); - config.captionsStyle.set(captionsStyle).then(() => { - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); - }); - }) -}; - -const CaptionConfiguration_0210 = () => { - const caseName = "CaptionConfiguration_0210" - const logTag = LOG + caseName; - config.captionsStyle.get().then((res) => { - if (!res) { - console.info(logTag + "captionsStyle is undefined"); - return; - } - var captionsStyle = res; - printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res)); - captionsStyle.fontEdgeType = foreachList(res.fontEdgeType, ['none', 'raised', 'depressed', 'uniform', 'dropShadow']); - printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle)); - config.captionsStyle.set(captionsStyle).then(() => { - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); - }); - }) -}; - -const CaptionConfiguration_0220 = () => { - const caseName = "CaptionConfiguration_0220" - const logTag = LOG + caseName; - config.captionsStyle.get().then((res) => { - if (!res) { - console.info(logTag + "captionsStyle is undefined"); - return; - } - var captionsStyle = res; - printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res)); - captionsStyle.backgroundColor = foreachList(res.backgroundColor, ['red', 'yellow', 'blue', '#ff0000ff', '#ff000000', '#00000000', '#f0000000', 'black', 'white']); - printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle)); - config.captionsStyle.set(captionsStyle).then(() => { - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); - }); - }) -}; - -const CaptionConfiguration_0230 = () => { - const caseName = "CaptionConfiguration_0230" - const logTag = LOG + caseName; - config.captionsStyle.get().then((res) => { - if (!res) { - console.info(logTag + "captionsStyle is undefined"); - return; - } - var captionsStyle = res; - printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res)); - captionsStyle.windowColor = foreachList(res.windowColor, ['red', 'yellow', 'blue', '#ff0000ff', '#ff000000', '#00000000', '#f0000000', 'black', 'white']); - printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle)); - config.captionsStyle.set(captionsStyle).then(() => { - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); - }); - }) -}; - -const CaptionConfiguration_0240 = () => { - const caseName = "CaptionConfiguration_0240" - const logTag = LOG + caseName; - config.captionsStyle.get().then((res) => { - if (!res) { - console.info(logTag + "captionsStyle is undefined"); - return; - } - var captionsStyle = res; - for (let index = 0; index < 3; index++) { - printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res)); - captionsStyle.windowColor = foreachList(res.windowColor, ['red', 'yellow', 'blue', '#ff0000ff', '#ff000000', '#00000000', '#f0000000', 'black', 'white']); - printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle)); - config.captionsStyle.set(captionsStyle).then(() => { - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); - }); - } - }) -}; - -const CaptionConfiguration_0260 = () => { - const caseName = "CaptionConfiguration_0260" - const logTag = LOG + caseName; - config.captionsStyle.get().then((res) => { - if (!res) { - console.info(logTag + "captionsStyle is undefined"); - return; - } - var captionsStyle = res; - printCaptionStyle(logTag + "captionsStyle before modification. style=", JSON.stringify(res)); - captionsStyle.fontEdgeType = undefined; - printCaptionStyle(logTag + "captionsStyle after modification. style=", JSON.stringify(captionsStyle)); - config.captionsStyle.set(captionsStyle).then(() => { - commonEventPublishOnTargetChangeExtra(caseName); - }).catch((err) => { - console.info(logTag + "captionsStyle fontFamily set err=" + JSON.stringify(err)); - }); - }) -}; - -const commonEventPublishOnTargetChangeExtra = (caseName) => { - function publishCallback(err) { - console.info(LOG + caseName + " on_target_change_extra publish call back result:" + JSON.stringify(err)); - } - var commonEventPublishData = { - data: caseName + "_on_target_change_extra_success", - } - commonEvent.publish("on_target_change_extra", commonEventPublishData, publishCallback); -} - -const excuteAbility = (data) => { - switch (data) { - case "CaptionConfiguration_0270" + "_AccessibilityApp_start": - CaptionConfiguration_0270() - break; - case "CaptionConfiguration_0280" + "_AccessibilityApp_start": - CaptionConfiguration_0280() - break; - case "CaptionConfiguration_0290" + "_AccessibilityApp_start": - CaptionConfiguration_0290() - break; - case "CaptionConfiguration_0300" + "_AccessibilityApp_start": - CaptionConfiguration_0300() - break; - case "CaptionConfiguration_0310" + "_AccessibilityApp_start": - CaptionConfiguration_0310() - break; - case "CaptionConfiguration_0320" + "_AccessibilityApp_start": - CaptionConfiguration_0320() - break; - case "CaptionConfiguration_0330" + "_AccessibilityApp_start": - CaptionConfiguration_0330() - break; - case "CaptionConfiguration_0340" + "_AccessibilityApp_start": - CaptionConfiguration_0340() - break; - case "CaptionConfiguration_0090" + "_AccessibilityApp_start": - CaptionConfiguration_0090() - break; - case "CaptionConfiguration_0100" + "_AccessibilityApp_start": - CaptionConfiguration_0100() - break; - case "CaptionConfiguration_0110" + "_AccessibilityApp_start": - CaptionConfiguration_0110() - break; - case "CaptionConfiguration_0120" + "_AccessibilityApp_start": - CaptionConfiguration_0120() - break; - case "CaptionConfiguration_0130" + "_AccessibilityApp_start": - CaptionConfiguration_0130() - break; - case "CaptionConfiguration_0140" + "_AccessibilityApp_start": - CaptionConfiguration_0140() - break; - case "CaptionConfiguration_0150" + "_AccessibilityApp_start": - CaptionConfiguration_0150() - break; - case "CaptionConfiguration_0160" + "_AccessibilityApp_start": - CaptionConfiguration_0160() - break; - case "CaptionConfiguration_0170" + "_AccessibilityApp_start": - CaptionConfiguration_0170() - break; - case "CaptionConfiguration_0180" + "_AccessibilityApp_start": - CaptionConfiguration_0180() - break; - case "CaptionConfiguration_0190" + "_AccessibilityApp_start": - CaptionConfiguration_0190() - break; - case "CaptionConfiguration_0200" + "_AccessibilityApp_start": - CaptionConfiguration_0200() - break; - case "CaptionConfiguration_0210" + "_AccessibilityApp_start": - CaptionConfiguration_0210() - break; - case "CaptionConfiguration_0220" + "_AccessibilityApp_start": - CaptionConfiguration_0220() - break; - case "CaptionConfiguration_0230" + "_AccessibilityApp_start": - CaptionConfiguration_0230() - break; - case "CaptionConfiguration_0240" + "_AccessibilityApp_start": - CaptionConfiguration_0240() - break; - case "CaptionConfiguration_0260" + "_AccessibilityApp_start": - CaptionConfiguration_0260() - break; - default: - break; - } -} - -@Entry -@Component -struct Index { - private subScriber = undefined; - aboutToAppear() { - var commonEventSubscribeInfo = { - events: ["on_target_change"] - } - function subscriberCallback(err, data) { - console.info(LOG + "====>Target subscriberCallback start"); - console.info(LOG + "====>Target receive event err:" + JSON.stringify(err)); - console.info(LOG + "====>Target receive event data:" + JSON.stringify(data)); - excuteAbility(data.data); - console.info(LOG + "====>Target subscriberCallback end"); - } - commonEvent.createSubscriber(commonEventSubscribeInfo).then((subscriber) => { - console.info(LOG + "====> Target createSubscriber Start====") - this.subScriber = subscriber; - commonEvent.subscribe(subscriber, subscriberCallback); - console.info(LOG + "====> Target createSubscriber End====") - }) - console.info("start run testcase!!!!"); - } - - aboutToDisappear() { - console.info('TargetApp aboutToDisappear'); - commonEvent.unsubscribe(this.subScriber); - this.subScriber = undefined; - } - - build() { - Row() { - Column() { - Button('CaptionConfiguration') - .fontSize(15) - .fontWeight(FontWeight.Bold) - .margin(5) - .onClick((e) => { - console.info("CaptionConfiguration onClick") - }) - } - .width('100%') - } - .height('100%') - } -} diff --git a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/TestAbility/TestAbility.ts b/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/TestAbility/TestAbility.ts deleted file mode 100644 index 20877f79a5ad57aa25c107d236bd4c3835d0d472..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/TestAbility/TestAbility.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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') - } -}; diff --git a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/TestAbility/pages/index.ets b/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/TestAbility/pages/index.ets deleted file mode 100644 index 33b5d087aff46bee138cb4b6086fa0579101c8db..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/TestAbility/pages/index.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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%') - } - } diff --git a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 4ce7693d4c47cd4af0c889eb86adc4026995c123..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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.myapplicationxtsd.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') - } -}; diff --git a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/test/CaptionConfiguration.test.ets b/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/test/CaptionConfiguration.test.ets deleted file mode 100644 index 24a990d47eb0924268885f42809445370f657326..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/test/CaptionConfiguration.test.ets +++ /dev/null @@ -1,703 +0,0 @@ -/* - * 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 { describe, beforeAll, beforeEach, afterAll, it, expect } from '@ohos/hypium' -import commonEvent from '@ohos.commonEvent' -import accessibility from '@ohos.accessibility'; -import config from '@ohos.accessibility.config'; -const LOG = "[xtsLog]" -const START_TIMEOUT = 5000; -var backList = [] -let subScriber = undefined; -let registerOn = false; - -const callbackData = (data) => { - console.info(LOG + " captionsManager on res = " + JSON.stringify(data)) - registerOn = true -} - -const CaptionConfigurationOn = (logTag, captionType) => { - let captionsManager = accessibility.getCaptionsManager(); - if (!captionsManager) { - console.info(logTag + " captionsManager is undefined"); - return; - } - captionsManager.on(captionType, callbackData); -} - -const CaptionConfigurationOff = (logTag, captionType) => { - let captionsManager = accessibility.getCaptionsManager(); - if (!captionsManager) { - console.info(logTag + " captionsManager is undefined"); - return; - } - captionsManager.off(captionType, callbackData); -} - -const CaptionConfigurationOffAll = (logTag, captionType) => { - let captionsManager = accessibility.getCaptionsManager(); - if (!captionsManager) { - console.info(logTag + " captionsManager is undefined"); - return; - } - captionsManager.off(captionType); -} - -const captionOn = (logTag, caseName) => { - config.captions.on(callbackData); -} - -const captionOff = (logTag, captionType) => { - config.captions.off(callbackData); -} - -const captionStyleOn = (logTag, caseName) => { - config.captionsStyle.on(callbackData); -} - -const captionStyleOff = (logTag, captionType) => { - config.captionsStyle.off(callbackData); -} - -const excuteCase = (caseNamePara) => { - console.info(LOG + 'AccessibleEventTest excuteCase: ' + caseNamePara); - - function publishCallback(err) { - console.info(LOG + caseNamePara + "on_target_change publish call back result:" + JSON.stringify(err)); - } - - var commonEventPublishData = { - data: caseNamePara + "_AccessibilityApp_start" - } - commonEvent.publish("on_target_change", commonEventPublishData, publishCallback); -} - -export default function CaptionConfigurationTest() { - describe('ActsCaptionConfigurationTest', function () { - beforeEach(async function (done) { - console.info(LOG + 'ActsCaptionConfigurationTest: beforeEach'); - setTimeout(() => { - backList = [] - done(); - }, 1000); - }); - beforeAll(async function (done) { - console.info(LOG + 'ActsCaptionConfigurationTest: beforeAll'); - - subScriber = await commonEvent.createSubscriber({ - events: ['on_target_change_extra'] - }); - console.info(LOG + 'ActsCaptionConfigurationTest beforeAll subscribe send:' + JSON.stringify(subScriber)); - - commonEvent.subscribe(subScriber, (err, data) => { - console.info(LOG + ' ActsCaptionConfigurationTest beforeAll subscribe data:' + JSON.stringify(data)); - if (data.data) { - console.info(LOG + " ActsCaptionConfigurationTest CallBack: " + data.data); - backList.push(data.data) - } - }); - setTimeout(done(), START_TIMEOUT); - }); - - afterAll(async function (done) { - console.info(LOG + 'ActsCaptionConfigurationTest: afterAll'); - setTimeout(function () { - commonEvent.unsubscribe(subScriber); - config.captions.set(false); - let captionsStyle: accessibility.CaptionsStyle = {"fontFamily":"default","fontScale":0,"fontColor":"#000000ff","fontEdgeType":"none","backgroundColor":"#000000ff","windowColor":"#000000ff"}; - config.captionsStyle.set(captionsStyle); - done(); - }, 10000); - }); - - /** - * @tc.number: CaptionConfiguration_0270 - * @tc.name: Call api:getcaptionsmanager() to set the caption parameter. - * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. - */ - it('CaptionConfiguration_0270', 1, async function (done) { - const caseName = "CaptionConfiguration_0270"; - const logF = LOG + caseName; - registerOn = false; - setTimeout(() => { - CaptionConfigurationOn(caseName, 'enableChange') - }, 1000); - setTimeout(() => { - excuteCase(caseName); - }, 3000); - setTimeout(() => { - var isSucceedTarget: boolean = false; - if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { - isSucceedTarget = true; - } - expect(isSucceedTarget).assertEqual(true); - expect(registerOn).assertEqual(true); - console.info(logF + ' isSucceed : ' + (isSucceedTarget)); - CaptionConfigurationOff(caseName, 'enableChange') - done(); - }, 8000); - }); - - /** - * @tc.number: CaptionConfiguration_0280 - * @tc.name: Call api:getcaptionsmanager() to set the caption parameter. - * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. - */ - it('CaptionConfiguration_0280', 1, async function (done) { - const caseName = "CaptionConfiguration_0280"; - const logF = LOG + caseName; - registerOn = false; - CaptionConfigurationOn(caseName, 'styleChange') - setTimeout(() => { - excuteCase(caseName); - }, 3000); - setTimeout(() => { - var isSucceedTarget: boolean = false; - if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { - isSucceedTarget = true; - } - expect(isSucceedTarget).assertEqual(true); - expect(registerOn).assertEqual(true); - console.info(logF + ' isSucceed : ' + (isSucceedTarget)); - CaptionConfigurationOffAll(caseName, 'styleChange') - done(); - }, 8000); - }); - - /** - * @tc.number: CaptionConfiguration_0290 - * @tc.name: Call api:getcaptionsmanager() to set the caption parameter. - * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. - */ - it('CaptionConfiguration_0290', 1, async function (done) { - const caseName = "CaptionConfiguration_0290"; - const logF = LOG + caseName; - registerOn = false; - setTimeout(() => { - CaptionConfigurationOn(caseName, 'enableChange'); - }, 1000); - setTimeout(() => { - CaptionConfigurationOff(caseName, 'enableChange') - setTimeout(() => { - excuteCase(caseName); - }, 3000); - }, 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_0300 - * @tc.name: Call api:getcaptionsmanager() to set the caption parameter. - * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. - */ - it('CaptionConfiguration_0300', 1, async function (done) { - const caseName = "CaptionConfiguration_0300"; - const logF = LOG + caseName; - registerOn = false; - setTimeout(() => { - CaptionConfigurationOn(caseName, 'styleChange'); - }, 1000); - setTimeout(() => { - CaptionConfigurationOff(caseName, 'styleChange') - setTimeout(() => { - excuteCase(caseName); - }, 3000); - }, 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_0310 - * @tc.name: Call api:getcaptionsmanager() to set the caption parameter. - * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. - */ - it('CaptionConfiguration_0310', 1, async function (done) { - const caseName = "CaptionConfiguration_0310"; - const logF = LOG + caseName; - 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); - console.info(logF + ' isSucceed : ' + (isSucceedTarget)); - done(); - }, 8000); - }); - - /** - * @tc.number: CaptionConfiguration_0320 - * @tc.name: Call api:getcaptionsmanager() to set the caption parameter. - * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. - */ - it('CaptionConfiguration_0320', 1, async function (done) { - const caseName = "CaptionConfiguration_0320"; - const logF = LOG + caseName; - 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); - console.info(logF + ' isSucceed : ' + (isSucceedTarget)); - done(); - }, 8000); - }); - - /** - * @tc.number: CaptionConfiguration_0330 - * @tc.name: Call api:getcaptionsmanager() to set the caption parameter. - * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. - */ - it('CaptionConfiguration_0330', 1, async function (done) { - const caseName = "CaptionConfiguration_0330"; - const logF = LOG + caseName; - 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); - console.info(logF + ' isSucceed : ' + (isSucceedTarget)); - done(); - }, 8000); - }); - - /** - * @tc.number: CaptionConfiguration_0340 - * @tc.name: Call api:getcaptionsmanager() to set the caption parameter. - * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. - */ - it('CaptionConfiguration_0340', 1, async function (done) { - const caseName = "CaptionConfiguration_0340"; - const logF = LOG + caseName; - 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); - console.info(logF + ' isSucceed : ' + (isSucceedTarget)); - done(); - }, 8000); - }); - - /** - * @tc.number: CaptionConfiguration_0090 - * @tc.name: Call api:getcaptionsmanager() to set the caption parameter. - * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. - */ - it('CaptionConfiguration_0090', 1, async function (done) { - const caseName = "CaptionConfiguration_0090"; - const logF = LOG + caseName; - 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); - console.info(logF + ' isSucceed : ' + (isSucceedTarget)); - done(); - }, 8000); - }); - - /** - * @tc.number: CaptionConfiguration_0100 - * @tc.name: Call api:getcaptionsmanager() to set the caption parameter. - * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. - */ - it('CaptionConfiguration_0100', 1, async function (done) { - const caseName = "CaptionConfiguration_0100"; - const logF = LOG + caseName; - 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); - console.info(logF + ' isSucceed : ' + (isSucceedTarget)); - done(); - }, 8000); - }); - - /** - * @tc.number: CaptionConfiguration_0110 - * @tc.name: Call api:getcaptionsmanager() to set the caption parameter. - * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. - */ - it('CaptionConfiguration_0110', 1, async function (done) { - const caseName = "CaptionConfiguration_0110"; - const logF = LOG + caseName; - 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); - console.info(logF + ' isSucceed : ' + (isSucceedTarget)); - done(); - }, 8000); - }); - - /** - * @tc.number: CaptionConfiguration_0130 - * @tc.name: Call api:getcaptionsmanager() to set the caption parameter. - * @tc.desc: Call api:getcaptionsmanager() to set the caption parameter. - */ - it('CaptionConfiguration_0130', 1, async function (done) { - const caseName = "CaptionConfiguration_0130"; - const logF = LOG + caseName; - 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); - console.info(logF + ' isSucceed : ' + (isSucceedTarget)); - done(); - }, 8000); - }); - - /** - * @tc.number: CaptionConfiguration_0140 - * @tc.name: Call api:config to set the captions parameter. - * @tc.desc: Call api:config to set the captions parameter. - */ - it('CaptionConfiguration_0140', 1, async function (done) { - const caseName = "CaptionConfiguration_0140"; - const logF = LOG + caseName; - registerOn = false; - setTimeout(() => { - captionOn(logF, caseName); - }, 1000); - setTimeout(() => { - excuteCase(caseName); - }, 3000); - setTimeout(() => { - var isSucceedTarget: boolean = false; - if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { - isSucceedTarget = true; - } - expect(isSucceedTarget).assertEqual(true); - expect(registerOn).assertEqual(true); - console.info(logF + ' isSucceed : ' + (isSucceedTarget)); - captionOff(logF, caseName); - done(); - }, 8000); - }); - - /** - * @tc.number: CaptionConfiguration_0150 - * @tc.name: Call api:config to set the captionsStyle parameter. - * @tc.desc: Call api:config to set the captionsStyle parameter. - */ - it('CaptionConfiguration_0150', 1, async function (done) { - const caseName = "CaptionConfiguration_0150"; - const logF = LOG + caseName; - registerOn = false; - captionStyleOn(logF, caseName); - setTimeout(() => { - excuteCase(caseName); - }, 3000); - setTimeout(() => { - var isSucceedTarget: boolean = false; - if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { - isSucceedTarget = true; - } - expect(isSucceedTarget).assertEqual(true); - expect(registerOn).assertEqual(true); - console.info(logF + ' isSucceed : ' + (isSucceedTarget)); - config.captionsStyle.off(); - done(); - }, 8000); - }); - - /** - * @tc.number: CaptionConfiguration_0160 - * @tc.name: Call api:config to set the captions parameter. - * @tc.desc: Call api:config to set the captions parameter. - */ - it('CaptionConfiguration_0160', 1, async function (done) { - const caseName = "CaptionConfiguration_0160"; - const logF = LOG + caseName; - registerOn = false; - setTimeout(() => { - captionOn(logF, caseName) - }, 1000); - setTimeout(() => { - captionOff(logF, caseName) - setTimeout(() => { - excuteCase(caseName); - }, 3000); - }, 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_0170 - * @tc.name: Call api:config to set the captionsStyle parameter. - * @tc.desc: Call api:config to set the captionsStyle parameter. - */ - it('CaptionConfiguration_0170', 1, async function (done) { - const caseName = "CaptionConfiguration_0170"; - const logF = LOG + caseName; - registerOn = false; - setTimeout(() => { - captionStyleOn(logF, caseName); - }, 1000); - setTimeout(() => { - captionStyleOff(logF, caseName) - setTimeout(() => { - excuteCase(caseName); - }, 3000); - }, 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_0180 - * @tc.name: Call api:config to set the captionsStyle parameter. - * @tc.desc: Call api:config to set the captionsStyle parameter. - */ - it('CaptionConfiguration_0180', 1, async function (done) { - const caseName = "CaptionConfiguration_0180"; - const logF = LOG + caseName; - 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); - console.info(logF + ' isSucceed : ' + (isSucceedTarget)); - done(); - }, 8000); - }); - - /** - * @tc.number: CaptionConfiguration_0190 - * @tc.name: Call api:config to set the captionsStyle parameter. - * @tc.desc: Call api:config to set the captionsStyle parameter. - */ - it('CaptionConfiguration_0190', 1, async function (done) { - const caseName = "CaptionConfiguration_0190"; - const logF = LOG + caseName; - 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); - console.info(logF + ' isSucceed : ' + (isSucceedTarget)); - done(); - }, 8000); - }); - - /** - * @tc.number: CaptionConfiguration_0200 - * @tc.name: Call api:config to set the captionsStyle parameter. - * @tc.desc: Call api:config to set the captionsStyle parameter. - */ - it('CaptionConfiguration_0200', 1, async function (done) { - const caseName = "CaptionConfiguration_0200"; - const logF = LOG + caseName; - 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); - console.info(logF + ' isSucceed : ' + (isSucceedTarget)); - done(); - }, 8000); - }); - - /** - * @tc.number: CaptionConfiguration_0210 - * @tc.name: Call api:config to set the captionsStyle parameter. - * @tc.desc: Call api:config to set the captionsStyle parameter. - */ - it('CaptionConfiguration_0210', 1, async function (done) { - const caseName = "CaptionConfiguration_0210"; - const logF = LOG + caseName; - 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); - console.info(logF + ' isSucceed : ' + (isSucceedTarget)); - done(); - }, 8000); - }); - - /** - * @tc.number: CaptionConfiguration_0220 - * @tc.name: Call api:config to set the captionsStyle parameter. - * @tc.desc: Call api:config to set the captionsStyle parameter. - */ - it('CaptionConfiguration_0220', 1, async function (done) { - const caseName = "CaptionConfiguration_0220"; - const logF = LOG + caseName; - 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); - console.info(logF + ' isSucceed : ' + (isSucceedTarget)); - done(); - }, 8000); - }); - - /** - * @tc.number: CaptionConfiguration_0230 - * @tc.name: Call api:config to set the captionsStyle parameter. - * @tc.desc: Call api:config to set the captionsStyle parameter. - */ - it('CaptionConfiguration_0230', 1, async function (done) { - const caseName = "CaptionConfiguration_0230"; - const logF = LOG + caseName; - 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); - console.info(logF + ' isSucceed : ' + (isSucceedTarget)); - done(); - }, 8000); - }); - - /** - * @tc.number: CaptionConfiguration_0240 - * @tc.name: Call api:config to set the captionsStyle parameter. - * @tc.desc: Call api:config to set the captionsStyle parameter. - */ - it('CaptionConfiguration_0240', 1, async function (done) { - const caseName = "CaptionConfiguration_0240"; - const logF = LOG + caseName; - 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); - console.info(logF + ' isSucceed : ' + (isSucceedTarget)); - done(); - }, 8000); - }); - - /** - * @tc.number: CaptionConfiguration_0260 - * @tc.name: Call api:config to set the captionsStyle parameter. - * @tc.desc: Call api:config to set the captionsStyle parameter. - */ - it('CaptionConfiguration_0260', 1, async function (done) { - const caseName = "CaptionConfiguration_0260"; - const logF = LOG + caseName; - excuteCase(caseName); - setTimeout(() => { - var isSucceedTarget: boolean = false; - if (backList.indexOf(caseName + '_on_target_change_extra_success') !== -1) { - isSucceedTarget = true; - } - expect(isSucceedTarget).assertEqual(true); - console.info(logF + ' isSucceed : ' + (isSucceedTarget)); - done(); - }, 8000); - }); - }) -} diff --git a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/test/List.test.ets b/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 736fd152148eb4a2c51bd071f744164e674020ed..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 CaptionConfigurationTest from './CaptionConfiguration.test' - -export default function testsuite() { - CaptionConfigurationTest() -} \ No newline at end of file diff --git a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/module.json b/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/module.json deleted file mode 100644 index ae783e70816ab89ea3d73ef5956c639c2ae017c4..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/module.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:entry_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default", - "phone", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "com.example.myapplicationxtsd.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:entry_desc", - "icon": "$media:icon", - "label": "$string:entry_desc", - "visible": true, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ], - "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" - } - ] - } -} diff --git a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/resources/base/element/string.json b/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index e533d8e9d7cea8546c278831aac3d5b7b6f96eb1..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "string": [ - { - "name": "entry_desc", - "value": "9xts" - }, - { - "name": "MainAbility_desc", - "value": "9xts" - }, - { - "name": "MainAbility_label", - "value": "9xts" - }, - { - "name": "description_serviceability", - "value": "Accessiable" - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/resources/base/media/icon.png b/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/resources/base/profile/accessibility_config.json b/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/resources/base/profile/accessibility_config.json deleted file mode 100644 index d044b388f86e66d0c6412cb286fc52dded2ca3d3..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/resources/base/profile/accessibility_config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "accessibilityCapabilities": [ - "retrieve", - "keyEventObserver", - "gesture", - "touchGuide" - ], - "accessibilityCapabilityRationale": "a11y_rationale", - "settingsAbility": "com.example.myapplication.accessibilitySetting" -} \ No newline at end of file diff --git a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/resources/base/profile/main_pages.json b/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index c7cf4ba21afceed8745647810ebec481620a975c..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actscaptionconfigurationtest/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index" - ] -} \ No newline at end of file diff --git a/barrierfree/accessibletest/actscaptionconfigurationtest/signature/openharmony_sx.p7b b/barrierfree/accessibletest/actscaptionconfigurationtest/signature/openharmony_sx.p7b deleted file mode 100644 index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/actscaptionconfigurationtest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/barrierfree/accessibletest/actsgesturesimulationtest/AppScope/app.json b/barrierfree/accessibletest/actsgesturesimulationtest/AppScope/app.json deleted file mode 100644 index 80ca0d4c4cc95cf19ce5939080da46e4a5f03da8..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsgesturesimulationtest/AppScope/app.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "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 - } - } -} diff --git a/barrierfree/accessibletest/actsgesturesimulationtest/AppScope/resources/base/element/string.json b/barrierfree/accessibletest/actsgesturesimulationtest/AppScope/resources/base/element/string.json deleted file mode 100644 index 4141cc986f4d9a7559119ed25d729418ef915938..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsgesturesimulationtest/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "GestureSimulationTest" - } - ] -} diff --git a/barrierfree/accessibletest/actsgesturesimulationtest/AppScope/resources/base/media/app_icon.png b/barrierfree/accessibletest/actsgesturesimulationtest/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/actsgesturesimulationtest/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/barrierfree/accessibletest/actsgesturesimulationtest/BUILD.gn b/barrierfree/accessibletest/actsgesturesimulationtest/BUILD.gn deleted file mode 100644 index c3c6b0d05e32fd9ff92166439a48e1df9640d859..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsgesturesimulationtest/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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" -} diff --git a/barrierfree/accessibletest/actsgesturesimulationtest/Test.json b/barrierfree/accessibletest/actsgesturesimulationtest/Test.json deleted file mode 100644 index ed0b5b732bdc345e301ddf6c8caac6b9f397184b..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsgesturesimulationtest/Test.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "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": [ - "power-shell wakeup", - "power-shell setmode 602", - "uinput -T -m 425 1000 425 500 400", - "param set persist.ace.testmode.enabled 1" - ], - "teardown-command":[ - "bm uninstall -n com.example.gesturesimulationtest" - ] - } - ] -} diff --git a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/Application/AbilityStage.ts b/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index f6de13d0ddfdf7a6db934ef575d37e1ddb4696d8..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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 diff --git a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/MainAbility/MainAbility.ts b/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 871643e56b2d19878104d250c2fecc0f721e4adf..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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") - } -}; diff --git a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/MainAbility/pages/index.ets b/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index 6fbc1ffed5311e42d790c34b69aa5e9ecc246ad0..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,235 +0,0 @@ -/* - * 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 diff --git a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts b/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts deleted file mode 100644 index f9ea8be227c08d4c76c2983649049dcb58bcfe39..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts +++ /dev/null @@ -1,581 +0,0 @@ -/* - * 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 AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtensionAbility' -import { GesturePath } from '@ohos.accessibility.GesturePath'; -import { GesturePoint } from '@ohos.accessibility.GesturePoint'; -import commonEvent from '@ohos.commonEvent' - - -const LOG_PREFIX = '[CQH-GESTURE-ABILITY-ACCESSIBLE]' -const EVENT_NAME = 'on_assist_change' -const EVENT_NAME_BACK = 'on_assist_change_extra' -const MS_400 = 400 -const MS_500 = 500 -const MS_800 = 800 -const MS_1000 = 1000 -let CommonEventSubscribeInfo = { - events: [EVENT_NAME] -} - -var subscriber -class ServiceExtAbility extends AccessibilityExtensionAbility { - onConnect() { - console.info(LOG_PREFIX + " onConnect") - let context = this.context - commonEvent.createSubscriber(CommonEventSubscribeInfo).then((data) => { - subscriber = data - 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)) - selectCode(context, commonEventData.data) - }) - }).catch((error) => { - console.info(LOG_PREFIX + 'createSubscriber failed. Cause: ' + JSON.stringify(error)) - return - }) - } - - onDisconnect() { - console.info(LOG_PREFIX + " onDisconnect") - commonEvent.unsubscribe(subscriber) - } - - onAccessibilityEvent(accessibilityEvent) { - console.info(LOG_PREFIX + " accessibilityEvent : " + JSON.stringify(accessibilityEvent)) - } - - onKeyEvent(keyEvent) { - console.info(LOG_PREFIX + " keyEvent : " + JSON.stringify(keyEvent)) - return true - } -} - -function selectCode(context, caseCode) { - switch (caseCode) { - case 'GestureSimulation_0010': - GestureSimulation_0010(context, caseCode) - break - case 'GestureSimulation_0020': - GestureSimulation_0020(context, caseCode) - break - case 'GestureSimulation_0030': - GestureSimulation_0030(context, caseCode) - break - case 'GestureSimulation_0040': - GestureSimulation_0040(context, caseCode) - break - case 'GestureSimulation_0050': - GestureSimulation_0050(context, caseCode) - break - case 'GestureSimulation_0060': - GestureSimulation_0060(context, caseCode) - break - case 'GestureSimulation_0070': - GestureSimulation_0070(context, caseCode) - break - case 'GestureSimulation_0080': - GestureSimulation_0080(context, caseCode) - break - case 'GestureSimulation_0090': - GestureSimulation_0090(context, caseCode) - break - case 'GestureSimulation_0100': - GestureSimulation_0100(context, caseCode) - break - case 'GestureSimulation_0110': - GestureSimulation_0110(context, caseCode) - break - case 'GestureSimulation_0120': - GestureSimulation_0120(context, caseCode) - break - case 'GestureSimulation_0130': - GestureSimulation_0130(context, caseCode) - break - case 'GestureSimulation_0140': - GestureSimulation_0140(context, caseCode) - break - case 'GestureSimulation_0150': - GestureSimulation_0150(context, caseCode) - break - case 'GestureSimulation_0160': - GestureSimulation_0160(context, caseCode) - break - case 'GestureSimulation_0170': - GestureSimulation_0170(context, caseCode) - break - case 'GestureSimulation_0180': - GestureSimulation_0180(context, caseCode) - break - case 'GestureSimulation_0190': - GestureSimulation_0190(context, caseCode) - break - case 'GestureSimulation_0200': - GestureSimulation_0200(context, caseCode) - break - case 'GestureSimulation_0210': - GestureSimulation_0210(context, caseCode) - break - case 'GestureSimulation_0220': - GestureSimulation_0220(context, caseCode) - break - case 'GestureSimulation_0230': - GestureSimulation_0230(context, caseCode) - break - case 'GestureSimulation_0240': - GestureSimulation_0240(context, caseCode) - break - case 'GestureSimulation_0250': - GestureSimulation_0250(context, caseCode) - break - case 'GestureSimulation_0260': - GestureSimulation_0260(context, caseCode) - break - case 'GestureSimulation_0270': - GestureSimulation_0270(context, caseCode) - break - case 'GestureSimulation_0280': - GestureSimulation_0280(context, caseCode) - break - case 'GestureSimulation_0290': - GestureSimulation_0290(context, caseCode) - break - case 'GestureSimulation_0300': - GestureSimulation_0300(context, caseCode) - break - case 'GestureSimulation_0310': - GestureSimulation_0310(context, caseCode) - break - case 'GestureSimulation_0320': - GestureSimulation_0320(context, caseCode) - break - case 'GestureSimulation_0330': - GestureSimulation_0330(context, caseCode) - break - case 'GestureSimulation_0340': - GestureSimulation_0340(context, caseCode) - break - case 'GestureSimulation_0350': - GestureSimulation_0350(context, caseCode) - break - case 'GestureSimulation_0360': - GestureSimulation_0360(context, caseCode) - break - case 'GestureSimulation_0370': - GestureSimulation_0370(context, caseCode) - break - case 'GestureSimulation_0380': - GestureSimulation_0380(context, caseCode) - break - case 'GestureSimulation_0390': - GestureSimulation_0390(context, caseCode) - break - case 'GestureSimulation_0400': - GestureSimulation_0400(context, caseCode) - break - case 'GestureSimulation_0410': - GestureSimulation_0410(context, caseCode) - break - case 'GestureSimulation_0420': - GestureSimulation_0420(context, caseCode) - break - } -} - -function getGesturePath(durationTime: number, array: Array) { - let gesturePath = new GesturePath(durationTime) - for (let item of array) { - let pos = item.split(',') - let point = new GesturePoint(Number(pos[0]), Number(pos[1])) - gesturePath.points.push(point) - } - return gesturePath -} - -let click = ["332,945"] - -//click -function GestureSimulation_0010(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_400, click) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//click -function GestureSimulation_0020(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_400, click) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - -//longClick -function GestureSimulation_0030(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_1000, click) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//longClick -function GestureSimulation_0040(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_1000, click) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - - -let scrollForward = ["378,1069", "377,1028", "377,983"] -let scrollBackward = ["377,983", "377,1028", "378,1069"] -//scrollForward -function GestureSimulation_0050(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_500, scrollForward) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//scrollForward -function GestureSimulation_0060(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_500, scrollForward) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - -//scrollBackward -function GestureSimulation_0070(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_500, scrollBackward) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//scrollBackward -function GestureSimulation_0080(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_500, scrollBackward) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - - -let left = ["394,416", "389,416", "373,416", "357,416", "344,417", "332,417", "323,418", "315,418", "305,418", "295,418", "285,418", "277,419", "269,419", "259,419", "248,421", "238,422", "230,423", "223,424", "218,424", "213,424", "207,425", "202,425", "198,425", "197,425", "196,425", "195,425", "194,425", "194,425"] -let leftThenRight = ["438,420", "431,420", "418,420", "400,420", "384,422", "368,424", "351,427", "334,430", "316,433", "300,436", "283,439", "268,441", "255,443", "243,445", "233,446", "223,447", "216,448", "212,449", "211,450", "209,450", "207,450", "202,450", "201,450", "200,450", "199,450", "198,450", "197,450", "198,450", "199,449", "205,446", "211,443", "219,439", "226,435", "233,432", "239,429", "246,426", "252,423", "258,422", "264,421", "271,420", "281,419", "291,418", "302,415", "311,414", "320,413", "325,410", "330,409", "335,408", "336,407", "337,407", "338,407", "339,407", "340,407", "344,406", "345,406", "349,406", "350,405", "351,405", "352,405", "353,405", "354,405", "355,404", "356,404", "357,404", "358,404", "363,404", "367,403", "373,403", "377,403", "378,402", "379,402", "380,402", "380,402"] -let leftThenUp = ["476,408", "469,408", "459,408", "443,408", "429,408", "415,408", "400,409", "384,411", "369,414", "354,416", "327,420", "281,425", "268,425", "264,425", "263,425", "259,424", "258,423", "257,422", "256,422", "255,421", "254,420", "253,417", "251,414", "245,407", "241,402", "239,387", "237,377", "234,367", "233,357", "232,354", "232,349", "232,345", "231,341", "231,336", "231,325", "231,321", "231,317", "231,314", "231,311", "230,308", "230,304", "229,300", "229,296", "228,292", "228,289", "227,286", "227,285", "227,282", "226,281", "226,278", "226,275", "225,271", "225,268", "225,265", "225,262", "225,261", "224,258", "224,257", "224,254", "224,253", "224,252", "224,251", "224,250", "223,250", "223,250"] -let leftThenDown = ["456,360", "451,360", "435,359", "429,358", "423,357", "414,356", "405,355", "394,354", "385,354", "376,354", "369,354", "361,354", "352,354", "345,353", "337,353", "329,353", "321,353", "314,353", "307,353", "300,353", "293,353", "285,353", "278,353", "273,353", "269,353", "265,353", "259,355", "251,358", "245,359", "241,361", "239,364", "234,367", "230,371", "225,381", "221,382", "219,385", "215,388", "213,391", "211,395", "209,406", "208,417", "206,430", "205,442", "204,453", "204,457", "204,472", "204,475", "204,487", "204,490", "204,500", "204,502", "204,506", "204,510", "204,514", "204,517", "204,521", "204,525", "205,529", "205,532", "205,534", "206,535", "206,536", "206,538", "206,541", "206,544", "206,546", "206,547", "206,548", "206,549", "206,550", "206,550"] - -//left -function GestureSimulation_0090(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_500, left) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//left -function GestureSimulation_0100(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_500, left) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - -//leftThenRight -function GestureSimulation_0110(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, leftThenRight) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//leftThenRight -function GestureSimulation_0120(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, leftThenRight) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - -//leftThenUp -function GestureSimulation_0130(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, leftThenUp) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//leftThenUp -function GestureSimulation_0140(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, leftThenUp) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - -//leftThenDown -function GestureSimulation_0150(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, leftThenDown) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//leftThenDown -function GestureSimulation_0160(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, leftThenDown) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - - -let right = ["258,438", "265,438", "276,437", "289,433", "298,430", "304,427", "310,424", "316,423", "322,422", "329,421", "337,420", "344,419", "351,419", "357,418", "364,417", "374,416", "383,415", "392,414", "399,414", "406,414", "413,413", "420,413", "428,412", "436,412", "444,412", "450,412", "456,412", "461,412", "465,412", "470,412", "476,412", "482,412", "489,412", "494,412", "498,412", "503,412", "504,412", "510,412", "511,412", "512,412", "513,412", "514,412", "515,412", "516,412", "516,414", "516,414"] -let rightThenLeft = ["289,451", "295,451", "307,450", "327,447", "350,444", "375,441", "402,438", "428,435", "450,434", "468,433", "480,432", "487,431", "488,430", "492,429", "492,428", "493,428", "494,428", "495,428", "501,428", "506,427", "511,427", "512,426", "518,425", "522,424", "526,424", "536,423", "540,422", "544,422", "545,422", "546,422", "546,421", "545,420", "543,419", "539,418", "535,418", "531,418", "527,418", "522,418", "518,417", "513,416", "508,415", "502,414", "497,413", "492,412", "486,411", "480,410", "475,409", "470,408", "464,408", "450,407", "443,407", "436,406", "429,406", "423,405", "418,405", "412,405", "406,405", "391,405", "384,405", "378,405", "373,405", "369,405", "367,405", "362,405", "358,405", "356,405", "354,405", "352,405", "351,405", "350,405", "349,405", "349,405"] -let rightThenUp = ["258,454", "265,454", "278,454", "293,454", "307,454", "320,454", "335,454", "347,453", "357,453", "366,453", "375,453", "392,453", "398,453", "404,453", "410,453", "416,453", "424,453", "432,453", "440,452", "446,451", "450,450", "451,450", "455,450", "456,450", "457,449", "461,448", "462,447", "467,444", "471,441", "472,438", "477,435", "478,431", "482,427", "483,423", "487,419", "487,416", "488,413", "489,412", "493,409", "493,406", "494,403", "495,400", "496,390", "497,387", "497,373", "497,369", "497,365", "497,361", "497,360", "498,357", "498,354", "498,351", "498,347", "498,337", "498,333", "498,322", "498,319", "498,314", "498,309", "498,299", "498,298", "498,294", "498,290", "498,286", "498,283", "498,280", "498,279", "498,278", "498,277", "498,276", "498,275", "498,274", "498,273", "498,272", "498,271", "498,271"] -let rightThenDown = ["250,408", "257,408", "269,408", "286,407", "302,404", "316,401", "330,398", "343,395", "355,392", "365,391", "385,389", "394,388", "402,387", "407,386", "412,385", "418,384", "423,384", "424,384", "429,384", "430,384", "436,384", "443,384", "449,384", "454,384", "455,384", "456,384", "457,384", "458,384", "459,384", "465,384", "470,384", "471,384", "476,384", "477,385", "481,386", "482,388", "487,390", "488,393", "493,395", "494,398", "498,401", "499,404", "500,407", "501,410", "505,420", "506,423", "507,427", "508,439", "509,442", "510,453", "511,455", "512,458", "512,461", "512,464", "513,471", "513,475", "514,479", "514,484", "514,486", "514,488", "514,490", "514,491", "514,492", "514,494", "514,498", "514,509", "515,510", "515,513", "515,515", "515,517", "515,517"] - -//right -function GestureSimulation_0170(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_500, right) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//right -function GestureSimulation_0180(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_500, right) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - -//rightThenLeft -function GestureSimulation_0190(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, rightThenLeft) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//rightThenLeft -function GestureSimulation_0200(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, rightThenLeft) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - -//rightThenUp -function GestureSimulation_0210(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, rightThenUp) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//rightThenUp -function GestureSimulation_0220(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, rightThenUp) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - -//rightThenDown -function GestureSimulation_0230(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, rightThenDown) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//rightThenDown -function GestureSimulation_0240(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, rightThenDown) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - - -let up = ["365,475", "365,467", "365,455", "364,452", "364,448", "364,443", "364,432", "364,422", "364,409", "365,393", "366,380", "367,375", "368,365", "370,361", "370,357", "370,346", "371,334", "372,322", "373,319", "373,316", "373,315", "373,314", "374,311", "375,301", "376,291", "377,280", "378,277", "379,274", "380,273", "380,270", "380,266", "381,261", "381,250", "382,247", "382,244", "382,243", "382,240", "382,237", "382,234", "382,233", "382,232", "382,229", "382,226", "382,222", "382,218", "382,215", "382,214", "382,213", "382,212", "382,212"] -let upThenDown = ["361,523", "361,520", "361,509", "360,499", "360,496", "360,492", "360,488", "360,485", "360,484", "360,474", "360,469", "361,456", "362,452", "363,442", "364,438", "365,433", "366,422", "367,419", "367,415", "367,412", "367,409", "367,406", "368,390", "369,386", "370,382", "370,378", "370,375", "370,372", "371,361", "373,344", "374,341", "374,338", "374,335", "374,332", "374,327", "375,316", "375,312", "375,300", "375,296", "374,291", "374,280", "373,277", "372,272", "371,264", "371,263", "371,262", "371,261", "371,260", "371,262", "371,265", "372,269", "373,272", "373,276", "374,280", "375,290", "375,293", "375,297", "376,301", "376,305", "376,309", "376,319", "376,321", "377,324", "377,327", "378,330", "378,334", "378,337", "378,341", "378,351", "378,353", "378,356", "378,360", "378,370", "378,372", "378,375", "378,377", "378,379", "378,381", "378,384", "378,388", "378,392", "378,402", "378,404", "378,407", "378,409", "378,411", "378,414", "378,417", "378,421", "378,425", "378,428", "378,430", "378,433", "378,436", "378,439", "378,440", "378,441", "378,443", "378,446"] -let upThenLeft = ["379,465", "380,445", "381,425", "385,406", "385,388", "385,373", "386,359", "386,344", "386,332", "387,322", "387,318", "387,307", "387,304", "387,300", "387,299", "387,298", "387,297", "387,296", "387,295", "387,294", "386,293", "385,290", "383,286", "381,283", "379,280", "377,279", "372,275", "370,272", "366,271", "365,270", "363,269", "359,266", "357,265", "352,264", "350,263", "345,262", "341,261", "335,260", "329,259", "321,258", "314,258", "308,257", "301,257", "293,257", "279,257", "274,257", "272,257", "271,257", "270,257", "269,257", "268,257", "267,257", "266,257", "265,257", "264,257", "263,257", "263,256", "263,256"] -let upThenRight = ["329,528", "329,525", "329,510", "329,493", "329,476", "328,459", "326,442", "325,425", "323,410", "322,396", "321,383", "320,370", "320,360", "320,350", "320,347", "320,343", "321,342", "321,341", "321,340", "321,339", "322,336", "323,332", "325,327", "326,326", "326,325", "326,324", "326,323", "327,322", "328,321", "329,320", "334,317", "334,316", "335,315", "335,314", "336,313", "340,312", "341,311", "345,310", "345,309", "346,308", "347,308", "348,307", "355,306", "363,303", "372,300", "383,297", "392,294", "401,293", "406,290", "411,289", "412,288", "413,288", "414,288", "415,288", "420,287", "424,287", "429,286", "435,286", "441,285", "446,284", "447,284", "451,283", "452,283", "456,283", "457,283", "458,283", "459,283", "460,283", "461,283", "462,283", "463,283", "464,283", "471,283", "477,283", "482,283", "487,283", "487,283"] - -//up -function GestureSimulation_0250(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_500, up) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//up -function GestureSimulation_0260(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_500, up) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - -//upThenLeft -function GestureSimulation_0270(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, upThenLeft) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//upThenLeft -function GestureSimulation_0280(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, upThenLeft) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - -//upThenRight -function GestureSimulation_0290(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, upThenRight) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//upThenRight -function GestureSimulation_0300(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, upThenRight) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - -//upThenDown -function GestureSimulation_0310(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, upThenDown) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//upThenDown -function GestureSimulation_0320(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, upThenDown) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - -let down = ["372,271", "372,273", "372,284", "373,295", "374,298", "378,310", "378,314", "379,327", "380,331", "381,346", "381,356", "381,367", "381,377", "381,381", "381,391", "381,394", "381,404", "381,407", "381,419", "381,429", "381,433", "380,445", "380,446", "379,456", "378,460", "377,475", "377,479", "377,490", "377,491", "377,494", "377,495", "377,496", "377,499", "376,503", "376,506", "375,509", "375,511", "375,512", "375,513", "375,513"] -let downThenUp = ["325,309", "325,312", "326,329", "332,349", "333,367", "334,386", "335,405", "340,443", "345,461", "346,477", "350,493", "351,509", "355,524", "356,539", "357,551", "358,563", "362,566", "362,576", "363,576", "364,572", "368,559", "369,549", "373,536", "373,531", "374,518", "374,515", "374,504", "374,500", "374,489", "374,486", "374,482", "374,478", "374,470", "374,466", "374,462", "374,459", "374,458", "374,457", "374,454", "374,450", "374,443", "374,442", "374,441", "374,440", "374,439", "374,438", "374,437", "374,434", "374,430", "375,425", "375,421", "375,418", "375,417", "375,416", "375,415", "375,412", "375,409", "375,406", "375,403", "375,402", "375,401", "375,400", "375,399", "375,398", "375,397", "375,397"] -let downThenLeft = ["363,267", "363,270", "363,286", "364,301", "368,314", "369,326", "370,338", "371,349", "375,361", "375,371", "375,383", "375,406", "375,417", "375,428", "375,439", "374,449", "373,460", "373,464", "372,476", "371,479", "371,489", "370,491", "370,494", "369,497", "368,509", "366,513", "362,526", "360,529", "355,533", "353,543", "351,543", "349,545", "342,548", "332,551", "318,554", "305,557", "290,560", "276,563", "263,565", "254,566", "246,567", "242,567", "238,567", "237,568", "236,568", "235,568", "234,568", "233,568", "233,568"] -let downThenRight = ["331,286", "331,288", "331,298", "332,302", "333,313", "334,316", "335,330", "336,341", "338,362", "338,374", "338,386", "338,398", "337,402", "336,413", "335,416", "334,427", "333,431", "332,443", "332,447", "331,459", "331,473", "331,476", "331,480", "331,490", "331,493", "331,497", "331,507", "332,508", "332,511", "333,515", "334,519", "335,529", "336,530", "341,534", "342,538", "343,542", "347,546", "348,550", "352,554", "353,560", "354,561", "358,563", "359,565", "367,568", "376,571", "385,574", "395,576", "402,577", "408,578", "416,578", "426,578", "435,578", "451,578", "459,578", "466,577", "472,576", "477,575", "478,574", "479,573", "480,572", "481,572", "481,571", "482,571", "495,570", "505,569", "514,566", "519,565", "520,564", "521,563", "522,563", "523,563", "523,563"] - -//down -function GestureSimulation_0330(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_500, down) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//down -function GestureSimulation_0340(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_500, down) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - -//downThenLeft -function GestureSimulation_0350(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, downThenLeft) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//downThenLeft -function GestureSimulation_0360(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, downThenLeft) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - -//downThenRight -function GestureSimulation_0370(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, downThenRight) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//downThenRight -function GestureSimulation_0380(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, downThenRight) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - -//downThenUp -function GestureSimulation_0390(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, downThenUp) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//downThenUp -function GestureSimulation_0400(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_800, downThenUp) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - -//up -function GestureSimulation_0410(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_500, up) - gestureInjectCallback1(logTag, context, gesturePath, caseCode) -} - -//up -function GestureSimulation_0420(context, caseCode) { - const logTag = LOG_PREFIX + caseCode - let gesturePath = getGesturePath(MS_500, up) - gestureInjectPromise1(logTag, context, gesturePath, caseCode) -} - -function gestureInjectCallback1(logTag, context, gesturePath, caseCode) { - try { - context.injectGesture(gesturePath, (data) => { - console.info(logTag + "injectGesture Callback res: " + JSON.stringify(data)) - var commonEventPublishData = { data: caseCode, parameters: { res: data.code === 0 } } - publishEvent(commonEventPublishData) - }) - } catch (e) { - console.info(logTag + " injectGesture Callback Exception: " + JSON.stringify(e.message)) - return - } -} - -function gestureInjectPromise1(logTag, context, gesturePath, caseCode) { - try { - context.injectGesture(gesturePath) - .then(() => { - console.info(logTag + "injectGesture Promise success") - var commonEventPublishData = { data: caseCode, parameters: { res: true } } - publishEvent(commonEventPublishData) - }) - .catch((err) => { - console.info(logTag + "injectGesture Promise err=" + JSON.stringify(err)) - var commonEventPublishData = { data: caseCode, parameters: { res: false } } - publishEvent(commonEventPublishData) - }) - } catch (e) { - console.info(LOG_PREFIX + " injectGesture Promise Exception: " + JSON.stringify(e.message)) - return - } -} - - -function publishEvent(commonEventPublishData) { - 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) - return - } -} - -export default ServiceExtAbility \ No newline at end of file diff --git a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/TestAbility/TestAbility.ts b/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/TestAbility/TestAbility.ts deleted file mode 100644 index 20877f79a5ad57aa25c107d236bd4c3835d0d472..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/TestAbility/TestAbility.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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') - } -}; diff --git a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/TestAbility/pages/index.ets b/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/TestAbility/pages/index.ets deleted file mode 100644 index 33b5d087aff46bee138cb4b6086fa0579101c8db..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/TestAbility/pages/index.ets +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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%') - } - } diff --git a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 98dc665d2616f5b36141f8f039720fe60943ad7d..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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') - } -}; diff --git a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/test/Ability.test.ets b/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/test/Ability.test.ets deleted file mode 100644 index c92ff996e2e410b628d54221ba034001c44e4d66..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/test/Ability.test.ets +++ /dev/null @@ -1,797 +0,0 @@ -/* - * 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' -import commonEvent from '@ohos.commonEvent' -import prompt from '@system.prompt' -import config from '@ohos.accessibility.config' - -const ASSIST_BUNDLE_NAME = 'com.example.gesturesimulationtest/ServiceExtAbility' -const LOG_PREFIX = '[CQH-GESTURE-ABILITY-TEST]' -const EVENT_NAME = 'on_assist_change' -const A_EVENT_NAME_BACK = 'on_assist_change_extra' -const T_EVENT_NAME_BACK = 'on_target_change_extra' -const TIME_OUT = 3000 -const TIME_OUT_L = 5000 -let CommonEventSubscribeInfo = { - events: [T_EVENT_NAME_BACK, A_EVENT_NAME_BACK] -} - -export default function abilityTest() { - - let subscriber = undefined - let tarResult: Map = new Map() - let assResult: Map = new Map() - - describe('ActsGestureSimulationTest', function (abilityContext) { - beforeAll(async function (done) { - console.info(LOG_PREFIX + '[StartTargetApp] start') - try { - subscriber = await commonEvent.createSubscriber(CommonEventSubscribeInfo) - try { - commonEvent.subscribe(subscriber, (error, commonEventData) => { - if (error.code != 0) { - console.info(LOG_PREFIX + 'subscribe callback error. Cause:' + JSON.stringify(error)) - return - } - console.info(LOG_PREFIX + 'subscribeTest callback : ' + JSON.stringify(commonEventData)) - if (commonEventData.event === T_EVENT_NAME_BACK) { - tarResult.set(commonEventData.data, commonEventData.parameters.res) - } else { - assResult.set(commonEventData.data, commonEventData.parameters.res) - } - }) - } catch (e) { - console.info(LOG_PREFIX + 'subscribe failed. Cause:' + JSON.stringify(e)) - } - enableAbility(LOG_PREFIX, ASSIST_BUNDLE_NAME, ['gesture']) - setTimeout(() => { - done() - }, 1000) - } catch (e) { - console.info(LOG_PREFIX + '[StartTargetApp] error' + e.message) - } - }) - afterAll(async function (done) { - prompt.showToast({ - message: 'CASE All End' - }) - disableAbility(LOG_PREFIX, ASSIST_BUNDLE_NAME) - done() - }) - beforeEach(function (done) { - setTimeout(() => { - done() - }, 2000) - }) - /** - * @tc.number: GestureSimulation_0010 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute click gesture operation(callback). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute click gesture operation(callback). - */ - it('GestureSimulation_0010', 1, async function (done) { - var caseCode = 'GestureSimulation_0010' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + 'GestureSimulation_0010 tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0020 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute click gesture operation(promise). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute click gesture operation(promise). - */ - it('GestureSimulation_0020', 1, async function (done) { - var caseCode = 'GestureSimulation_0020' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + 'GestureSimulation_0020 tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0030 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute longClick gesture operation(callback). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute longClick gesture operation(callback). - */ - it('GestureSimulation_0030', 1, async function (done) { - var caseCode = 'GestureSimulation_0030' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + 'GestureSimulation_0030 tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT_L) - }) - /** - * @tc.number: GestureSimulation_0040 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute longClick gesture operation(promise). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute longClick gesture operation(promise). - */ - it('GestureSimulation_0040', 1, async function (done) { - var caseCode = 'GestureSimulation_0040' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + 'GestureSimulation_0040 tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT_L) - }) - /** - * @tc.number: GestureSimulation_0070 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute scrollBackward gesture operation(callback). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute scrollBackward gesture operation(callback). - */ - it('GestureSimulation_0070', 1, async function (done) { - var caseCode = 'GestureSimulation_0070' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + 'GestureSimulation_0070 tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0080 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute scrollBackward gesture operation(promise). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute scrollBackward gesture operation(promise). - */ - it('GestureSimulation_0080', 1, async function (done) { - var caseCode = 'GestureSimulation_0080' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + 'GestureSimulation_0080 tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0090 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute left gesture operation(callback). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute left gesture operation(callback). - */ - it('GestureSimulation_0090', 1, async function (done) { - var caseCode = 'GestureSimulation_0090' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0100 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute left gesture operation(promise). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute left gesture operation(promise). - */ - it('GestureSimulation_0100', 1, async function (done) { - var caseCode = 'GestureSimulation_0100' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0110 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute leftThenRight gesture operation(callback). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute leftThenRight gesture operation(callback). - */ - it('GestureSimulation_0110', 1, async function (done) { - var caseCode = 'GestureSimulation_0110' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0120 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute leftThenRight gesture operation(promise). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute leftThenRight gesture operation(promise). - */ - it('GestureSimulation_0120', 1, async function (done) { - var caseCode = 'GestureSimulation_0120' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0130 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute leftThenUp gesture operation(callback). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute leftThenUp gesture operation(callback). - */ - it('GestureSimulation_0130', 1, async function (done) { - var caseCode = 'GestureSimulation_0130' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0140 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute leftThenUp gesture operation(promise). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute leftThenUp gesture operation(promise). - */ - it('GestureSimulation_0140', 1, async function (done) { - var caseCode = 'GestureSimulation_0140' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0150 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute leftThenDown gesture operation(callback). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute leftThenDown gesture operation(callback). - */ - it('GestureSimulation_0150', 1, async function (done) { - var caseCode = 'GestureSimulation_0150' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0160 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute leftThenDown gesture operation(promise). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute leftThenDown gesture operation(promise). - */ - it('GestureSimulation_0160', 1, async function (done) { - var caseCode = 'GestureSimulation_0160' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0170 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute right gesture operation(callback). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute right gesture operation(callback). - */ - it('GestureSimulation_0170', 1, async function (done) { - var caseCode = 'GestureSimulation_0170' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0180 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute right gesture operation(promise). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute right gesture operation(promise). - */ - it('GestureSimulation_0180', 1, async function (done) { - var caseCode = 'GestureSimulation_0180' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0190 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute rightThenLeft gesture operation(callback). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute rightThenLeft gesture operation(callback). - */ - it('GestureSimulation_0190', 1, async function (done) { - var caseCode = 'GestureSimulation_0190' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0200 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute rightThenLeft gesture operation(promise). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute rightThenLeft gesture operation(promise). - */ - it('GestureSimulation_0200', 1, async function (done) { - var caseCode = 'GestureSimulation_0200' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0210 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute rightThenUp gesture operation(callback). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute rightThenUp gesture operation(callback). - */ - it('GestureSimulation_0210', 1, async function (done) { - var caseCode = 'GestureSimulation_0210' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0220 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute rightThenUp gesture operation(promise). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute rightThenUp gesture operation(promise). - */ - it('GestureSimulation_0220', 1, async function (done) { - var caseCode = 'GestureSimulation_0220' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0230 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute rightThenDown gesture operation(callback). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute rightThenDown gesture operation(callback). - */ - it('GestureSimulation_0230', 1, async function (done) { - var caseCode = 'GestureSimulation_0230' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0220 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute rightThenDown gesture operation(promise). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute rightThenDown gesture operation(promise). - */ - it('GestureSimulation_0240', 1, async function (done) { - var caseCode = 'GestureSimulation_0240' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0250 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute up gesture operation(callback). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute up gesture operation(callback). - */ - it('GestureSimulation_0250', 1, async function (done) { - var caseCode = 'GestureSimulation_0250' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0260 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute up gesture operation(promise). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute up gesture operation(promise). - */ - it('GestureSimulation_0260', 1, async function (done) { - var caseCode = 'GestureSimulation_0260' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0270 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute upThenLeft gesture operation(callback). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute upThenLeft gesture operation(callback). - */ - it('GestureSimulation_0270', 1, async function (done) { - var caseCode = 'GestureSimulation_0270' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0280 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute upThenLeft gesture operation(promise). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute upThenLeft gesture operation(promise). - */ - it('GestureSimulation_0280', 1, async function (done) { - var caseCode = 'GestureSimulation_0280' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0290 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute upThenRight gesture operation(callback). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute upThenRight gesture operation(callback). - */ - it('GestureSimulation_0290', 1, async function (done) { - var caseCode = 'GestureSimulation_0290' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0300 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute upThenRight gesture operation(promise). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute upThenRight gesture operation(promise). - */ - it('GestureSimulation_0300', 1, async function (done) { - var caseCode = 'GestureSimulation_0300' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0310 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute upThenDown gesture operation(callback). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute upThenDown gesture operation(callback). - */ - it('GestureSimulation_0310', 1, async function (done) { - var caseCode = 'GestureSimulation_0310' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0320 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute upThenDown gesture operation(promise). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute upThenDown gesture operation(promise). - */ - it('GestureSimulation_0320', 1, async function (done) { - var caseCode = 'GestureSimulation_0320' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0330 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute down gesture operation(callback). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute down gesture operation(callback). - */ - it('GestureSimulation_0330', 1, async function (done) { - var caseCode = 'GestureSimulation_0330' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0340 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute down gesture operation(promise). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute down gesture operation(promise). - */ - it('GestureSimulation_0340', 1, async function (done) { - var caseCode = 'GestureSimulation_0340' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0350 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute downThenLeft gesture operation(callback). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute downThenLeft gesture operation(callback). - */ - it('GestureSimulation_0350', 1, async function (done) { - var caseCode = 'GestureSimulation_0350' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0360 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute downThenLeft gesture operation(promise). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute downThenLeft gesture operation(promise). - */ - it('GestureSimulation_0360', 1, async function (done) { - var caseCode = 'GestureSimulation_0360' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0370 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute downThenRight gesture operation(callback). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute downThenRight gesture operation(callback). - */ - it('GestureSimulation_0370', 1, async function (done) { - var caseCode = 'GestureSimulation_0370' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0380 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute downThenRight gesture operation(promise). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute downThenRight gesture operation(promise). - */ - it('GestureSimulation_0380', 1, async function (done) { - var caseCode = 'GestureSimulation_0380' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0390 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute downThenUp gesture operation(callback). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute downThenUp gesture operation(callback). - */ - it('GestureSimulation_0390', 1, async function (done) { - var caseCode = 'GestureSimulation_0390' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0400 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute downThenUp gesture operation(promise). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute downThenUp gesture operation(promise). - */ - it('GestureSimulation_0400', 1, async function (done) { - var caseCode = 'GestureSimulation_0400' - publish(caseCode) - setTimeout(()=>{ - let tarData = tarResult.get(caseCode) - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + caseCode + ' tarData: ' + tarData + ' assData: ' + assData + ' expect assertTrue') - disableAbility(LOG_PREFIX, ASSIST_BUNDLE_NAME) - setTimeout(()=>enableAbility(LOG_PREFIX, ASSIST_BUNDLE_NAME, ['retrieve']), 600) - expect(tarData).assertTrue() - expect(assData).assertTrue() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0410 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute up gesture operation(callback). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute up gesture operation(callback). - */ - it('GestureSimulation_0410', 1, async function (done) { - var caseCode = 'GestureSimulation_0410' - publish(caseCode) - setTimeout(()=>{ - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + 'GestureSimulation_0410 assData: ' + assData + ' expect assertFalse') - expect(assData).assertFalse() - done() - }, TIME_OUT) - }) - /** - * @tc.number: GestureSimulation_0420 - * @tc.name: The auxiliary application simulates gesture operation to trigger the target application to execute up gesture operation(promise). - * @tc.desc: The auxiliary application simulates gesture operation to trigger the target application to execute up gesture operation(promise). - */ - it('GestureSimulation_0420', 1, async function (done) { - var caseCode = 'GestureSimulation_0420' - publish(caseCode) - setTimeout(()=>{ - let assData = assResult.get(caseCode) - console.info(LOG_PREFIX + 'GestureSimulation_0420 assData: ' + assData + ' expect assertFalse') - expect(assData).assertFalse() - done() - }, TIME_OUT) - }) - - }) - - function enableAbility(logTag, bundleName, capability) { - config.enableAbility(bundleName, capability).then(() => { - console.info(logTag + 'enableAbility success.') - }).catch((error) => { - console.info(logTag + 'enableAbility failed. Cause: ' + JSON.stringify(error)) - return - }) - } - - function disableAbility(logTag, bundleName) { - config.disableAbility(bundleName).then(() => { - console.info(logTag + 'disableAbility success.') - }).catch((error) => { - console.info(logTag + 'disableAbility failed. Cause: ' + JSON.stringify(error)) - return - }) - } - - function publish(caseCode) { - let commonEventPublishData = { - data: caseCode - } - try { - commonEvent.publish(EVENT_NAME, commonEventPublishData, (err, data) => { - if (err && err.code != 0) { - console.info(LOG_PREFIX + caseCode + ' failed to publish because ' + JSON.stringify(err)) - return - } - console.info(LOG_PREFIX + caseCode + ' success publish') - prompt.showToast({ - message: 'CASE ' + caseCode - }) - }) - } catch (e) { - console.info(LOG_PREFIX + caseCode + ' error to publish because ' + JSON.stringify(e)) - } - } -} \ No newline at end of file diff --git a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/test/List.test.ets b/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index cb35098ac281d443c7add6de76cee00a268ce092..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 diff --git a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/module.json b/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/module.json deleted file mode 100644 index dd3617c1531c23caed2c344d3fe6e15b913d9379..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/module.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:entry_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "default", - "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" - } - ] - } -} diff --git a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/resources/base/element/string.json b/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index eb31713f29d7c3b27531db6c72f67ec776b5cd95..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "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 diff --git a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/resources/base/media/icon.png b/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/resources/base/profile/accessibility_config.json b/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/resources/base/profile/accessibility_config.json deleted file mode 100644 index 01f6c93186a5cd09bd05736d12e9709d6d56a78f..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/resources/base/profile/accessibility_config.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "accessibilityCapabilities": [ - "retrieve", - "gesture" - ], - "accessibilityCapabilityRationale": "a11y_rationale", - "settingsAbility": "com.example.myapplication.accessibilitySetting" -} \ No newline at end of file diff --git a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/resources/base/profile/main_pages.json b/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index c7cf4ba21afceed8745647810ebec481620a975c..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/actsgesturesimulationtest/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index" - ] -} \ No newline at end of file diff --git a/barrierfree/accessibletest/actsgesturesimulationtest/signature/openharmony_sx.p7b b/barrierfree/accessibletest/actsgesturesimulationtest/signature/openharmony_sx.p7b deleted file mode 100644 index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/actsgesturesimulationtest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/AppScope/app.json b/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/AppScope/app.json deleted file mode 100644 index cbfdbe824e38cd1444889467261a61c8e639f2b6..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/AppScope/app.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "app": { - "bundleName": "com.example.accessibleaudibleability.hmservice", - "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 - } - } -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/AppScope/resources/base/element/string.json b/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/AppScope/resources/base/element/string.json deleted file mode 100644 index 0cc5794a55b4d3ba6b0bc45f4a46315236ddd4a2..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "AccessibleAudibleAbility" - } - ] -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/AppScope/resources/base/media/app_icon.png b/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/BUILD.gn b/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/BUILD.gn deleted file mode 100644 index c38234ff28d163be491e1faabf18f2b0813052fd..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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_hap_assist_suite("accessibilityAudibleAbility") { - 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 = "accessibilityAudibleAbility" - 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" -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/Test.json b/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/Test.json deleted file mode 100644 index b9f4122fbf466755fe279be1082dcf138af90789..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/ets/Application/AbilityStage.ts b/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 3788aefd2346d1170a208d47515b850c0cd27b2f..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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.log("[AccessibleAudibleAbility] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/ets/MainAbility/MainAbility.ts b/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 1cc33db635c16e08a4aea1ddf62473cc494e4459..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[AccessibleAudibleAbility] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[AccessibleAudibleAbility] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[AccessibleAudibleAbility] MainAbility onWindowStageCreate") - - windowStage.setUIContent(this.context, "MainAbility/pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[AccessibleAudibleAbility] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[AccessibleAudibleAbility] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[AccessibleAudibleAbility] MainAbility onBackground") - } -}; diff --git a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/ets/MainAbility/pages/index.ets b/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index c4c382cf18941ac82d25ab571ebb3879b0f82811..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts b/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts deleted file mode 100644 index 959e5a24c978e00f7e6fef9bded2fabde6adfe02..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtensionAbility' -import commonEvent from '@ohos.commonEvent' - - -const LOG_PREFIX = '[CQH-AUDIBLE-ABILITY-ACCESSIBLE]' -class ServiceExtAbility extends AccessibilityExtensionAbility { - onConnect() { - console.info(LOG_PREFIX + " onConnect") - } - onDisconnect() { - console.info(LOG_PREFIX + " onDisconnect") - } - onAccessibilityEvent(accessibilityEvent) { - console.info(LOG_PREFIX + " accessibilityEvent : " + JSON.stringify(accessibilityEvent)) - } - onKeyEvent(keyEvent) { - console.info(LOG_PREFIX + " keyEvent : " + JSON.stringify(keyEvent)) - return true - } -} - -export default ServiceExtAbility \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/module.json b/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/module.json deleted file mode 100644 index 536826223dd1c211518e3c69868d42795a971835..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/module.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:entry_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default", - "phone", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": true, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "com.example.accessibleaudibleability.hmservice.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" - } - ] - } - ], - "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" - } - ] - } -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/resources/base/element/string.json b/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f16cb4634cfc9c58783fd4a58ecfaaa6ecb0c1b5..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "entry_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "audible辅助应用" - }, - { - "name": "description_serviceability", - "value": "audible后台服务" - }, - { - "name": "form_description", - "value": "audible辅助应用" - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/resources/base/media/icon.png b/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/resources/base/profile/accessibility_config.json b/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/resources/base/profile/accessibility_config.json deleted file mode 100644 index 8151c7d393b92ece5d6f07c71b7fb99b345c609a..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/resources/base/profile/accessibility_config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "accessibilityCapabilities": [ - "retrieve", - "touchGuide", - "keyEventObserver", - "gesture" - ], - "accessibilityAbilityTypes": ["audible"], - "accessibilityCapabilityRationale": "a11y_rationale", - "settingsAbility": "com.example.myapplication.accessibilitySetting" -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/resources/base/profile/form_config.json b/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/resources/base/profile/form_config.json deleted file mode 100644 index ba3489dd5c6ee9435d07201193fcb137e3ad083e..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/resources/base/profile/form_config.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "forms": [ - { - "name": "Form_Js", - "description": "$string:form_description", - "src": "pages/card/index", - "window": { - "designWidth": 720, - "autoDesignWidth": true - }, - "colorMode": "auto", - "formConfigAbility": "ability://xxxxx", - "formVisibleNotify": false, - "isDefault": true, - "updateEnabled": true, - "scheduledUpdateTime": "10:30", - "updateDuration": 1, - "defaultDimension": "2*2", - "supportDimensions": [ - "2*2" - ] - } - ] -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/resources/base/profile/main_pages.json b/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index c1858c216308ad312862a877139a8ba6908ec3c6..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index" - ] -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/signature/openharmony_sx.p7b b/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/signature/openharmony_sx.p7b deleted file mode 100644 index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/sceneProject/accessibilityAudibleAbility/signature/openharmony_sx.p7b and /dev/null differ diff --git a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/AppScope/app.json b/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/AppScope/app.json deleted file mode 100644 index 65cc983e91379165abea8959b770b8c97860eb1e..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/AppScope/app.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "app": { - "bundleName": "com.example.accessiblegenericability.hmservice", - "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 - } - } -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/AppScope/resources/base/element/string.json b/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/AppScope/resources/base/element/string.json deleted file mode 100644 index 74b4363b3be83d1eb1dc3111775f32169670fb5a..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "AccessibleGenericAbility" - } - ] -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/AppScope/resources/base/media/app_icon.png b/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/BUILD.gn b/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/BUILD.gn deleted file mode 100644 index 5228324be0ae5fdae2945468db3853120b7d2490..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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_hap_assist_suite("accessibilityGenericAbility") { - 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 = "accessibilityGenericAbility" - 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" -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/Test.json b/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/Test.json deleted file mode 100644 index b9f4122fbf466755fe279be1082dcf138af90789..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/ets/Application/AbilityStage.ts b/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 14b999a57dcdb13c5d435888ab8623ce5d1df2b7..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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.log("[AccessibleGenericAbility] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/ets/MainAbility/MainAbility.ts b/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index faa3d8f6238f2e09036f5dbf4433a1e4c84c8a72..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[AccessibleGenericAbility] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[AccessibleGenericAbility] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[AccessibleGenericAbility] MainAbility onWindowStageCreate") - - windowStage.setUIContent(this.context, "MainAbility/pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[AccessibleGenericAbility] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[AccessibleGenericAbility] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[AccessibleGenericAbility] MainAbility onBackground") - } -}; diff --git a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/ets/MainAbility/pages/index.ets b/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index c4c382cf18941ac82d25ab571ebb3879b0f82811..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts b/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts deleted file mode 100644 index c8eb280227366ba3cea571269ba82f8f4fd2bede..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtensionAbility' - -const LOG_PREFIX = '[CQH-GENERIC-ABILITY-ACCESSIBLE]' -class ServiceExtAbility extends AccessibilityExtensionAbility { - onConnect() { - console.info(LOG_PREFIX + " onConnect") - let context = this.context - context.setTargetBundleName(['com.example.abilitylisttest', 'com.example.manualcase']) - } - onDisconnect() { - console.info(LOG_PREFIX + " onDisconnect"); - } - onAccessibilityEvent(accessibilityEvent) { - console.info(LOG_PREFIX + " accessibilityEvent : " + JSON.stringify(accessibilityEvent)); - } - onKeyEvent(keyEvent) { - console.info(LOG_PREFIX + " keyEvent : " + JSON.stringify(keyEvent)); - return true - } -} - -export default ServiceExtAbility \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/module.json b/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/module.json deleted file mode 100644 index 2fa5aab2cc0a3e2204def72dba453d2af187f646..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/module.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:entry_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default", - "phone", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": true, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "com.example.accessiblegesturesimulation.hmservice.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" - } - ] - } - ], - "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" - } - ] - } -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/resources/base/element/string.json b/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 4287e9d5ccc478c3dce8c3b46f44ac39acb6522f..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "entry_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "generic辅助应用" - }, - { - "name": "description_serviceability", - "value": "generic后台服务" - }, - { - "name": "form_description", - "value": "generic辅助应用" - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/resources/base/media/icon.png b/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/resources/base/profile/accessibility_config.json b/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/resources/base/profile/accessibility_config.json deleted file mode 100644 index 586720cff93a82d99ef081c9055cd4c2451fd5fc..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/resources/base/profile/accessibility_config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "accessibilityCapabilities": [ - "retrieve", - "touchGuide", - "keyEventObserver", - "gesture" - ], - "accessibilityAbilityTypes": ["generic"], - "accessibilityCapabilityRationale": "a11y_rationale", - "settingsAbility": "com.example.myapplication.accessibilitySetting" -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/resources/base/profile/form_config.json b/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/resources/base/profile/form_config.json deleted file mode 100644 index ba3489dd5c6ee9435d07201193fcb137e3ad083e..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/resources/base/profile/form_config.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "forms": [ - { - "name": "Form_Js", - "description": "$string:form_description", - "src": "pages/card/index", - "window": { - "designWidth": 720, - "autoDesignWidth": true - }, - "colorMode": "auto", - "formConfigAbility": "ability://xxxxx", - "formVisibleNotify": false, - "isDefault": true, - "updateEnabled": true, - "scheduledUpdateTime": "10:30", - "updateDuration": 1, - "defaultDimension": "2*2", - "supportDimensions": [ - "2*2" - ] - } - ] -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/resources/base/profile/main_pages.json b/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index c1858c216308ad312862a877139a8ba6908ec3c6..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index" - ] -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/signature/openharmony_sx.p7b b/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/signature/openharmony_sx.p7b deleted file mode 100644 index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/sceneProject/accessibilityGenericAbility/signature/openharmony_sx.p7b and /dev/null differ diff --git a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/AppScope/app.json b/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/AppScope/app.json deleted file mode 100644 index 43bb9cae5eb94843fb319bcaf72c763cfeb35fe5..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/AppScope/app.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "app": { - "bundleName": "com.example.accessiblehapticability.hmservice", - "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 - } - } -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/AppScope/resources/base/element/string.json b/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/AppScope/resources/base/element/string.json deleted file mode 100644 index baaf37d061e7923297806c49bdb24755469eee16..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "AccessibleHapticAbility" - } - ] -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/AppScope/resources/base/media/app_icon.png b/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/BUILD.gn b/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/BUILD.gn deleted file mode 100644 index 66c19036e8ad61df9918ba04dcdcfd33ee47d530..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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_hap_assist_suite("accessibilityHapticAbility") { - 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 = "accessibilityHapticAbility" - 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" -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/Test.json b/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/Test.json deleted file mode 100644 index b9f4122fbf466755fe279be1082dcf138af90789..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/ets/Application/AbilityStage.ts b/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index eb46727c442a4d2aec87bff72165107770fa9e9e..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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.log("[AccessibleHapticAbility] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/ets/MainAbility/MainAbility.ts b/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 5a19cec0825e72325e4479f877bbff12ec83df06..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[AccessibleHapticAbility] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[AccessibleHapticAbility] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[AccessibleHapticAbility] MainAbility onWindowStageCreate") - - windowStage.setUIContent(this.context, "MainAbility/pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[AccessibleHapticAbility] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[AccessibleHapticAbility] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[AccessibleHapticAbility] MainAbility onBackground") - } -}; diff --git a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/ets/MainAbility/pages/index.ets b/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index c4c382cf18941ac82d25ab571ebb3879b0f82811..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts b/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts deleted file mode 100644 index 0562ddaeb7f7f3cf5e47502bf37adf1eee8e5be1..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtensionAbility' - - -const LOG_PREFIX = '[CQH-HAPTIC-ABILITY-ACCESSIBLE]' -class ServiceExtAbility extends AccessibilityExtensionAbility { - onConnect() { - console.info(LOG_PREFIX + " onConnect") - let context = this.context - context.setTargetBundleName(['com.example.abilitylisttest', 'com.example.manualcase']) - } - onDisconnect() { - console.info(LOG_PREFIX + " onDisconnect") - } - onAccessibilityEvent(accessibilityEvent) { - console.info(LOG_PREFIX + " accessibilityEvent : " + JSON.stringify(accessibilityEvent)) - } - onKeyEvent(keyEvent) { - console.info(LOG_PREFIX + " keyEvent : " + JSON.stringify(keyEvent)); - return true - } -} - -export default ServiceExtAbility \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/module.json b/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/module.json deleted file mode 100644 index 9e7d644f2c7ab2cd798b81b2253f0cc30dd28318..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/module.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:entry_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default", - "phone", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": true, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "com.example.accessiblehapticability.hmservice.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" - } - ] - } - ], - "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" - } - ] - } -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/resources/base/element/string.json b/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 265991740a0ca444a8bad839d4d2411958f95bca..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "entry_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "haptic辅助应用" - }, - { - "name": "description_serviceability", - "value": "haptic后台服务" - }, - { - "name": "form_description", - "value": "haptic辅助应用" - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/resources/base/media/icon.png b/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/resources/base/profile/accessibility_config.json b/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/resources/base/profile/accessibility_config.json deleted file mode 100644 index e02d33c515eba85c77d6d8b65b052f4374165aaa..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/resources/base/profile/accessibility_config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "accessibilityCapabilities": [ - "retrieve", - "touchGuide", - "keyEventObserver", - "gesture" - ], - "accessibilityAbilityTypes": ["haptic"], - "accessibilityCapabilityRationale": "a11y_rationale", - "settingsAbility": "com.example.myapplication.accessibilitySetting" -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/resources/base/profile/form_config.json b/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/resources/base/profile/form_config.json deleted file mode 100644 index ba3489dd5c6ee9435d07201193fcb137e3ad083e..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/resources/base/profile/form_config.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "forms": [ - { - "name": "Form_Js", - "description": "$string:form_description", - "src": "pages/card/index", - "window": { - "designWidth": 720, - "autoDesignWidth": true - }, - "colorMode": "auto", - "formConfigAbility": "ability://xxxxx", - "formVisibleNotify": false, - "isDefault": true, - "updateEnabled": true, - "scheduledUpdateTime": "10:30", - "updateDuration": 1, - "defaultDimension": "2*2", - "supportDimensions": [ - "2*2" - ] - } - ] -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/resources/base/profile/main_pages.json b/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index c1858c216308ad312862a877139a8ba6908ec3c6..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index" - ] -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/signature/openharmony_sx.p7b b/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/signature/openharmony_sx.p7b deleted file mode 100644 index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/sceneProject/accessibilityHapticAbility/signature/openharmony_sx.p7b and /dev/null differ diff --git a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/AppScope/app.json b/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/AppScope/app.json deleted file mode 100644 index ec6887eb9a5358089d6c52ca743e6ae775fbce07..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/AppScope/app.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "app": { - "bundleName": "com.example.accessiblespokenability.hmservice", - "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 - } - } -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/AppScope/resources/base/element/string.json b/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/AppScope/resources/base/element/string.json deleted file mode 100644 index a4f2bd581747e390a6e52e0b8ee803060508c047..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "AccessibleSpokenAbility" - } - ] -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/AppScope/resources/base/media/app_icon.png b/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/BUILD.gn b/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/BUILD.gn deleted file mode 100644 index 99dd49114513c6a55399ed7dd2e68dc9dca35321..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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_hap_assist_suite("accessibilitySpokenAbility") { - 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 = "accessibilitySpokenAbility" - 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" -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/Test.json b/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/Test.json deleted file mode 100644 index b9f4122fbf466755fe279be1082dcf138af90789..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/ets/Application/AbilityStage.ts b/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index b57816d1c23bfd8a2769b3f46bd17b2fb41bbb68..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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.log("[AccessibleSpokenAbility] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/ets/MainAbility/MainAbility.ts b/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index a28eed3fa6e465181949446d1b091f9f3cfefefc..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[AccessibleSpokenAbility] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[AccessibleSpokenAbility] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[AccessibleSpokenAbility] MainAbility onWindowStageCreate") - - windowStage.setUIContent(this.context, "MainAbility/pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[AccessibleSpokenAbility] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[AccessibleSpokenAbility] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[AccessibleSpokenAbility] MainAbility onBackground") - } -}; diff --git a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/ets/MainAbility/pages/index.ets b/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index c4c382cf18941ac82d25ab571ebb3879b0f82811..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts b/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts deleted file mode 100644 index f21b462e8e743088fd684fda85171a191cbb42e6..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtensionAbility' -import commonEvent from '@ohos.commonEvent' - - -const LOG_PREFIX = '[CQH-SPOKEN-ABILITY-ACCESSIBLE]' -class ServiceExtAbility extends AccessibilityExtensionAbility { - onConnect() { - console.info(LOG_PREFIX + " onConnect") - } - onDisconnect() { - console.info(LOG_PREFIX + " onDisconnect") - } - onAccessibilityEvent(accessibilityEvent) { - console.info(LOG_PREFIX + " accessibilityEvent : " + JSON.stringify(accessibilityEvent)) - } - onKeyEvent(keyEvent) { - console.info(LOG_PREFIX + " keyEvent : " + JSON.stringify(keyEvent)) - return true - } -} - -export default ServiceExtAbility \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/module.json b/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/module.json deleted file mode 100644 index 90f02c6253c752fc50f59e065ff8896524bd3888..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/module.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:entry_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default", - "phone", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": true, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "com.example.accessiblespokenability.hmservice.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" - } - ] - } - ], - "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" - } - ] - } -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/resources/base/element/string.json b/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/resources/base/element/string.json deleted file mode 100644 index ec4966b7c16117811826ccb46918ad6969f5f329..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "entry_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "spoken辅助应用" - }, - { - "name": "description_serviceability", - "value": "spoken后台服务" - }, - { - "name": "form_description", - "value": "spoken辅助应用" - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/resources/base/media/icon.png b/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/resources/base/profile/accessibility_config.json b/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/resources/base/profile/accessibility_config.json deleted file mode 100644 index a36e7870744f8fbbea4e2d6b9df0bf0deb08f4e1..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/resources/base/profile/accessibility_config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "accessibilityCapabilities": [ - "retrieve", - "touchGuide", - "keyEventObserver", - "gesture" - ], - "accessibilityAbilityTypes": ["spoken"], - "accessibilityCapabilityRationale": "a11y_rationale", - "settingsAbility": "com.example.myapplication.accessibilitySetting" -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/resources/base/profile/form_config.json b/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/resources/base/profile/form_config.json deleted file mode 100644 index ba3489dd5c6ee9435d07201193fcb137e3ad083e..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/resources/base/profile/form_config.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "forms": [ - { - "name": "Form_Js", - "description": "$string:form_description", - "src": "pages/card/index", - "window": { - "designWidth": 720, - "autoDesignWidth": true - }, - "colorMode": "auto", - "formConfigAbility": "ability://xxxxx", - "formVisibleNotify": false, - "isDefault": true, - "updateEnabled": true, - "scheduledUpdateTime": "10:30", - "updateDuration": 1, - "defaultDimension": "2*2", - "supportDimensions": [ - "2*2" - ] - } - ] -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/resources/base/profile/main_pages.json b/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index c1858c216308ad312862a877139a8ba6908ec3c6..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index" - ] -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/signature/openharmony_sx.p7b b/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/signature/openharmony_sx.p7b deleted file mode 100644 index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/sceneProject/accessibilitySpokenAbility/signature/openharmony_sx.p7b and /dev/null differ diff --git a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/AppScope/app.json b/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/AppScope/app.json deleted file mode 100644 index 68d4327cfefa721d895bb2cb08ef43fbd34b7dc3..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/AppScope/app.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "app": { - "bundleName": "com.example.accessiblevisualability.hmservice", - "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 - } - } -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/AppScope/resources/base/element/string.json b/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/AppScope/resources/base/element/string.json deleted file mode 100644 index 2b6d6217cb2ab209b6af27e1f23add5aa6cca758..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "AccessibleVisualAbility" - } - ] -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/AppScope/resources/base/media/app_icon.png b/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/BUILD.gn b/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/BUILD.gn deleted file mode 100644 index be60016fdd8fedb3d6e4460ede3b6da7405f9719..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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_hap_assist_suite("accessibilityVisualAbility") { - 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 = "accessibilityVisualAbility" - 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" -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/Test.json b/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/Test.json deleted file mode 100644 index b9f4122fbf466755fe279be1082dcf138af90789..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/ets/Application/AbilityStage.ts b/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 36f6b6d60dc194aa60bb64abdbfb4686e3d6663b..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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.log("[AccessibleVisualAbility] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/ets/MainAbility/MainAbility.ts b/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 9f7a954299536d8e5b4a74dd9b18b38ae7569273..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[AccessibleVisualAbility] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[AccessibleVisualAbility] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[AccessibleVisualAbility] MainAbility onWindowStageCreate") - - windowStage.setUIContent(this.context, "MainAbility/pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[AccessibleVisualAbility] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[AccessibleVisualAbility] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[AccessibleVisualAbility] MainAbility onBackground") - } -}; diff --git a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/ets/MainAbility/pages/index.ets b/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/ets/MainAbility/pages/index.ets deleted file mode 100644 index c4c382cf18941ac82d25ab571ebb3879b0f82811..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/ets/MainAbility/pages/index.ets +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts b/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts deleted file mode 100644 index 3787fced051fb57a59767f1349dd4c1c24988e64..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/ets/ServiceExtAbility/ServiceExtAbility.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtensionAbility' -import commonEvent from '@ohos.commonEvent' - - -const LOG_PREFIX = '[CQH-VISUAL-ABILITY-ACCESSIBLE]' -class ServiceExtAbility extends AccessibilityExtensionAbility { - onConnect() { - console.info(LOG_PREFIX + " onConnect") - } - onDisconnect() { - console.info(LOG_PREFIX + " onDisconnect") - } - onAccessibilityEvent(accessibilityEvent) { - console.info(LOG_PREFIX + " accessibilityEvent : " + JSON.stringify(accessibilityEvent)) - } - onKeyEvent(keyEvent) { - console.info(LOG_PREFIX + " keyEvent : " + JSON.stringify(keyEvent)) - return true - } -} - -export default ServiceExtAbility \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/module.json b/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/module.json deleted file mode 100644 index 8098b873683d06a6ae8e3b976205f4ef973b1513..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/module.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:entry_desc", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default", - "phone", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": true, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "com.example.accessiblevisualability.hmservice.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" - } - ] - } - ], - "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" - } - ] - } -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/resources/base/element/string.json b/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 97595607d0f714fb496802bbba19e4c98c5e4702..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "entry_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "visual辅助应用" - }, - { - "name": "description_serviceability", - "value": "visual后台服务" - }, - { - "name": "form_description", - "value": "visual辅助应用" - } - ] -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/resources/base/media/icon.png b/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/resources/base/profile/accessibility_config.json b/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/resources/base/profile/accessibility_config.json deleted file mode 100644 index 513f5644b437cf7fe677a13597213ec833351808..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/resources/base/profile/accessibility_config.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "accessibilityCapabilities": [ - "retrieve", - "touchGuide", - "keyEventObserver", - "gesture" - ], - "accessibilityAbilityTypes": ["visual"], - "accessibilityCapabilityRationale": "a11y_rationale", - "settingsAbility": "com.example.myapplication.accessibilitySetting" -} \ No newline at end of file diff --git a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/resources/base/profile/form_config.json b/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/resources/base/profile/form_config.json deleted file mode 100644 index ba3489dd5c6ee9435d07201193fcb137e3ad083e..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/resources/base/profile/form_config.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "forms": [ - { - "name": "Form_Js", - "description": "$string:form_description", - "src": "pages/card/index", - "window": { - "designWidth": 720, - "autoDesignWidth": true - }, - "colorMode": "auto", - "formConfigAbility": "ability://xxxxx", - "formVisibleNotify": false, - "isDefault": true, - "updateEnabled": true, - "scheduledUpdateTime": "10:30", - "updateDuration": 1, - "defaultDimension": "2*2", - "supportDimensions": [ - "2*2" - ] - } - ] -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/resources/base/profile/main_pages.json b/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index c1858c216308ad312862a877139a8ba6908ec3c6..0000000000000000000000000000000000000000 --- a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index" - ] -} diff --git a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/signature/openharmony_sx.p7b b/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/signature/openharmony_sx.p7b deleted file mode 100644 index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..0000000000000000000000000000000000000000 Binary files a/barrierfree/accessibletest/sceneProject/accessibilityVisualAbility/signature/openharmony_sx.p7b and /dev/null differ diff --git a/barrierfree/targetProject/aceTest/AppScope/app.json b/barrierfree/targetProject/aceTest/AppScope/app.json deleted file mode 100644 index 6ccd6d235ea2014842e1ba6cbc330113a7283628..0000000000000000000000000000000000000000 --- a/barrierfree/targetProject/aceTest/AppScope/app.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "app": { - "bundleName": "com.example.acetest", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon": "$media:icon", - "label": "$string:app_name", - "description": "$string:description_application", - "distributedNotificationEnabled": true, - "minAPIVersion": 9, - "targetAPIVersion": 9 - } -} \ No newline at end of file diff --git a/barrierfree/targetProject/aceTest/AppScope/resources/base/element/string.json b/barrierfree/targetProject/aceTest/AppScope/resources/base/element/string.json deleted file mode 100644 index 559d9048af84bc4ebb7b7038a291981f5e466e78..0000000000000000000000000000000000000000 --- a/barrierfree/targetProject/aceTest/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "AceTest" - }, - { - "name": "mainability_description", - "value": "ETS_Phone_Empty Stage Ability" - } - ] -} \ No newline at end of file diff --git a/barrierfree/targetProject/aceTest/AppScope/resources/base/media/icon.png b/barrierfree/targetProject/aceTest/AppScope/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/targetProject/aceTest/AppScope/resources/base/media/icon.png and /dev/null differ diff --git a/barrierfree/targetProject/aceTest/BUILD.gn b/barrierfree/targetProject/aceTest/BUILD.gn deleted file mode 100644 index a3b11c3c6e6635e1609995efe8561723407ce3bc..0000000000000000000000000000000000000000 --- a/barrierfree/targetProject/aceTest/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# 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_hap_assist_suite("aceTest") { - hap_profile = "entry/src/main/module.json" - hap_name = "aceTest" - testonly = true - deps = [ - ":acetest_js_assets", - ":acetest_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - part_name = "accessibility" - subsystem_name = "barrierfree" -} - -ohos_app_scope("acetest_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("acetest_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("acetest_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":acetest_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/barrierfree/targetProject/aceTest/Test.json b/barrierfree/targetProject/aceTest/Test.json deleted file mode 100644 index d9fdcb92f81eac53bf51c78a428be0210c192b89..0000000000000000000000000000000000000000 --- a/barrierfree/targetProject/aceTest/Test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests" -} \ No newline at end of file diff --git a/barrierfree/targetProject/aceTest/entry/src/main/ets/Application/AbilityStage.ts b/barrierfree/targetProject/aceTest/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 32dfe93ccff0375201857794de902cec4d239442..0000000000000000000000000000000000000000 --- a/barrierfree/targetProject/aceTest/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,7 +0,0 @@ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - } -} \ No newline at end of file diff --git a/barrierfree/targetProject/aceTest/entry/src/main/ets/MainAbility/MainAbility.ts b/barrierfree/targetProject/aceTest/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index dad945382c6700e13a7f6dc6f83788cc1868d1ec..0000000000000000000000000000000000000000 --- a/barrierfree/targetProject/aceTest/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,34 +0,0 @@ -import Ability from '@ohos.application.Ability' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/index/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") - } -}; diff --git a/barrierfree/targetProject/aceTest/entry/src/main/ets/pages/index/index.ets b/barrierfree/targetProject/aceTest/entry/src/main/ets/pages/index/index.ets deleted file mode 100644 index d9f66cbbcb86e15553a053124ab3a5756d1512e1..0000000000000000000000000000000000000000 --- a/barrierfree/targetProject/aceTest/entry/src/main/ets/pages/index/index.ets +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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 config from '@ohos.accessibility.config' -import commonEvent from '@ohos.commonEvent'; - -@Entry -@Component -struct Index { - @State message: string = 'Target App'; - private isEnable: boolean = false; - private subScriber = undefined; - - onPageShow() { - console.info(`TargetApp onPageShow start`); - config.enableAbility( - 'com.example.accessibilityxts/AccessibilityExtAbility', - ["retrieve", "touchGuide", "gesture"] - ).then(() => { - console.info('TargetApp enableAbility finish'); - this.isEnable = true; - }); - } - - aboutToAppear() { - console.info('TargetApp aboutToAppear'); - commonEvent.createSubscriber({ events: ['disableExtAbility' ]}).then((subScriber) => { - this.subScriber = subScriber; - commonEvent.subscribe(this.subScriber, (err, data) => { - console.info('TargetApp disableExtAbility subscribe callback: ' + JSON.stringify(data)); - if (data && data.data == 'disable') { - this.disableAccAbility(); - } - }); - }); - } - - aboutToDisappear() { - console.info('TargetApp aboutToDisappear'); - commonEvent.unsubscribe(this.subScriber); - this.subScriber = undefined; - this.disableAccAbility(); - } - - disableAccAbility() { - if (!this.isEnable) { - console.info(`TargetApp disableAccAbility: accessibilityConfig not enabled`); - return; - } - - config.disableAbility("com.example.accessibilityxts/AccessibilityExtAbility").then(() => { - console.info(`TargetApp disableAccAbility finish`); - this.isEnable = false; - }); - } - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - .margin({bottom: 10}) - - Row() { - Button('left') - Button('button1') - .margin({ - left: 10, - right: 10 - }) - Button('right') - } - .margin({bottom: 10}) - - Button('button2') - .margin({bottom: 10}) - - Button('button3') - .margin({bottom: 10}) - - Button('disableAbility') - .onClick(() => { - console.info('TargetApp onClick'); - this.disableAccAbility(); - }) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/barrierfree/targetProject/aceTest/entry/src/main/module.json b/barrierfree/targetProject/aceTest/entry/src/main/module.json deleted file mode 100644 index 877b336e03bf70f913b1293690ad0a47fca8c4be..0000000000000000000000000000000000000000 --- a/barrierfree/targetProject/aceTest/entry/src/main/module.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default", - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [{ - "name": "MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [{ - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - }] - }] - } -} \ No newline at end of file diff --git a/barrierfree/targetProject/aceTest/entry/src/main/resources/base/element/string.json b/barrierfree/targetProject/aceTest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 55f553ad5a2ad2352918f898e8984c3872db2939..0000000000000000000000000000000000000000 --- a/barrierfree/targetProject/aceTest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "AceTest" - }, - { - "name": "description_application", - "value": "target app for test" - }, - { - "name": "app_name", - "value": "AceTest" - } - ] -} diff --git a/barrierfree/targetProject/aceTest/entry/src/main/resources/base/media/icon.png b/barrierfree/targetProject/aceTest/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/barrierfree/targetProject/aceTest/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/barrierfree/targetProject/aceTest/entry/src/main/resources/base/profile/main_pages.json b/barrierfree/targetProject/aceTest/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 821ecf2358ec52ffa8b0812267be3793be71896a..0000000000000000000000000000000000000000 --- a/barrierfree/targetProject/aceTest/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "pages/index/index" - ] -} \ No newline at end of file diff --git a/barrierfree/targetProject/aceTest/signature/openharmony_sx.p7b b/barrierfree/targetProject/aceTest/signature/openharmony_sx.p7b deleted file mode 100644 index 7ffcdc78527c5c1aa24520ab7e913c5f47c703f0..0000000000000000000000000000000000000000 Binary files a/barrierfree/targetProject/aceTest/signature/openharmony_sx.p7b and /dev/null differ