From 22308402f81503ce449a47b600e84ca23ca4b83b Mon Sep 17 00:00:00 2001 From: anning Date: Tue, 27 Sep 2022 18:30:15 +0800 Subject: [PATCH] applications Signed-off-by: anning --- applications/BUILD.gn | 17 + .../settingsdata}/BUILD.gn | 0 .../settingsdata}/settings_ets/BUILD.gn | 2 +- .../settingsdata}/settings_ets/Test.json | 38 +- .../settings_ets/entry/src/main/config.json | 198 +- .../entry/src/main/ets/MainAbility/app.ets | 42 +- .../src/main/ets/MainAbility/pages/index.ets | 74 +- .../entry/src/main/ets/TestAbility/app.ets | 62 +- .../src/main/ets/TestAbility/pages/index.ets | 96 +- .../ets/TestRunner/OpenHarmonyTestRunner.ts | 152 +- .../entry/src/main/ets/test/List.test.ets | 36 +- .../main/ets/test/SettingUiJsunit.test.ets | 2374 ++++++++--------- .../main/resources/base/element/string.json | 38 +- .../src/main/resources/base/media/icon.png | Bin .../settings_ets/signature/openharmony_sx.p7b | Bin 0 -> 3534 bytes .../settings_ets/signature/openharmony_sx.p7b | Bin 3437 -> 0 bytes test_packages.gni | 1 + 17 files changed, 1574 insertions(+), 1556 deletions(-) create mode 100644 applications/BUILD.gn rename {settingsdata => applications/settingsdata}/BUILD.gn (100%) mode change 100755 => 100644 rename {settingsdata => applications/settingsdata}/settings_ets/BUILD.gn (99%) rename {settingsdata => applications/settingsdata}/settings_ets/Test.json (96%) rename {settingsdata => applications/settingsdata}/settings_ets/entry/src/main/config.json (95%) rename {settingsdata => applications/settingsdata}/settings_ets/entry/src/main/ets/MainAbility/app.ets (97%) rename {settingsdata => applications/settingsdata}/settings_ets/entry/src/main/ets/MainAbility/pages/index.ets (96%) rename {settingsdata => applications/settingsdata}/settings_ets/entry/src/main/ets/TestAbility/app.ets (97%) rename {settingsdata => applications/settingsdata}/settings_ets/entry/src/main/ets/TestAbility/pages/index.ets (96%) rename {settingsdata => applications/settingsdata}/settings_ets/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts (97%) rename {settingsdata => applications/settingsdata}/settings_ets/entry/src/main/ets/test/List.test.ets (97%) rename {settingsdata => applications/settingsdata}/settings_ets/entry/src/main/ets/test/SettingUiJsunit.test.ets (97%) rename {settingsdata => applications/settingsdata}/settings_ets/entry/src/main/resources/base/element/string.json (94%) rename {settingsdata => applications/settingsdata}/settings_ets/entry/src/main/resources/base/media/icon.png (100%) create mode 100644 applications/settingsdata/settings_ets/signature/openharmony_sx.p7b delete mode 100644 settingsdata/settings_ets/signature/openharmony_sx.p7b diff --git a/applications/BUILD.gn b/applications/BUILD.gn new file mode 100644 index 000000000..7c8653c03 --- /dev/null +++ b/applications/BUILD.gn @@ -0,0 +1,17 @@ +# 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. + +group("applications") { + testonly = true + deps = [ "settingsdata:settingsdata" ] +} diff --git a/settingsdata/BUILD.gn b/applications/settingsdata/BUILD.gn old mode 100755 new mode 100644 similarity index 100% rename from settingsdata/BUILD.gn rename to applications/settingsdata/BUILD.gn diff --git a/settingsdata/settings_ets/BUILD.gn b/applications/settingsdata/settings_ets/BUILD.gn similarity index 99% rename from settingsdata/settings_ets/BUILD.gn rename to applications/settingsdata/settings_ets/BUILD.gn index 2c084b878..c32edc598 100644 --- a/settingsdata/settings_ets/BUILD.gn +++ b/applications/settingsdata/settings_ets/BUILD.gn @@ -9,7 +9,7 @@ # 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. +# limitations under the License. import("//test/xts/tools/build/suite.gni") diff --git a/settingsdata/settings_ets/Test.json b/applications/settingsdata/settings_ets/Test.json similarity index 96% rename from settingsdata/settings_ets/Test.json rename to applications/settingsdata/settings_ets/Test.json index 4ed73b907..648902a80 100644 --- a/settingsdata/settings_ets/Test.json +++ b/applications/settingsdata/settings_ets/Test.json @@ -1,19 +1,19 @@ -{ - "description": "Configuration for settings Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "600000", - "bundle-name": "com.open.harmony.settings", - "package-name": "com.open.harmony.settings", - "shell-timeout": "600000" - }, - "kits": [ - { - "test-file-name": [ - "ActsSettingsEtsTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} +{ + "description": "Configuration for settings Tests", + "driver": { + "type": "OHJSUnitTest", + "test-timeout": "600000", + "bundle-name": "com.open.harmony.settings", + "package-name": "com.open.harmony.settings", + "shell-timeout": "600000" + }, + "kits": [ + { + "test-file-name": [ + "ActsSettingsEtsTest.hap" + ], + "type": "AppInstallKit", + "cleanup-apps": true + } + ] +} diff --git a/settingsdata/settings_ets/entry/src/main/config.json b/applications/settingsdata/settings_ets/entry/src/main/config.json similarity index 95% rename from settingsdata/settings_ets/entry/src/main/config.json rename to applications/settingsdata/settings_ets/entry/src/main/config.json index 1a283dce2..07284c517 100644 --- a/settingsdata/settings_ets/entry/src/main/config.json +++ b/applications/settingsdata/settings_ets/entry/src/main/config.json @@ -1,99 +1,99 @@ -{ - "app": { - "bundleName": "com.open.harmony.settings", - "vendor": "open", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 7, - "releaseType": "Release", - "target": 7 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.open.harmony.settings", - "name": ".MyApplication", - "mainAbility": "com.open.harmony.settings.MainAbility", - "srcPath": "", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_mainability", - "formsEnabled": false, - "label": "$string:entry_MainAbility", - "type": "page", - "launchType": "standard" - }, - { - "orientation": "unspecified", - "visible": true, - "srcPath": "TestAbility", - "name": ".TestAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "formsEnabled": false, - "label": "$string:TestAbility_label", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} +{ + "app": { + "bundleName": "com.open.harmony.settings", + "vendor": "open", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 7, + "releaseType": "Release", + "target": 7 + } + }, + "deviceConfig": {}, + "module": { + "package": "com.open.harmony.settings", + "name": ".MyApplication", + "mainAbility": "com.open.harmony.settings.MainAbility", + "srcPath": "", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry", + "installationFree": false + }, + "abilities": [ + { + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ], + "orientation": "unspecified", + "visible": true, + "srcPath": "MainAbility", + "name": ".MainAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:description_mainability", + "formsEnabled": false, + "label": "$string:entry_MainAbility", + "type": "page", + "launchType": "standard" + }, + { + "orientation": "unspecified", + "visible": true, + "srcPath": "TestAbility", + "name": ".TestAbility", + "srcLanguage": "ets", + "icon": "$media:icon", + "description": "$string:TestAbility_desc", + "formsEnabled": false, + "label": "$string:TestAbility_label", + "type": "page", + "launchType": "standard" + } + ], + "js": [ + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".MainAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + }, + { + "mode": { + "syntax": "ets", + "type": "pageAbility" + }, + "pages": [ + "pages/index" + ], + "name": ".TestAbility", + "window": { + "designWidth": 720, + "autoDesignWidth": false + } + } + ] + } +} diff --git a/settingsdata/settings_ets/entry/src/main/ets/MainAbility/app.ets b/applications/settingsdata/settings_ets/entry/src/main/ets/MainAbility/app.ets similarity index 97% rename from settingsdata/settings_ets/entry/src/main/ets/MainAbility/app.ets rename to applications/settingsdata/settings_ets/entry/src/main/ets/MainAbility/app.ets index 5d603333c..fc86a0485 100644 --- a/settingsdata/settings_ets/entry/src/main/ets/MainAbility/app.ets +++ b/applications/settingsdata/settings_ets/entry/src/main/ets/MainAbility/app.ets @@ -1,22 +1,22 @@ -/** - * 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. - */ -export default { - onCreate() { - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, +/** + * 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. + */ +export default { + onCreate() { + console.info('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, } \ No newline at end of file diff --git a/settingsdata/settings_ets/entry/src/main/ets/MainAbility/pages/index.ets b/applications/settingsdata/settings_ets/entry/src/main/ets/MainAbility/pages/index.ets similarity index 96% rename from settingsdata/settings_ets/entry/src/main/ets/MainAbility/pages/index.ets rename to applications/settingsdata/settings_ets/entry/src/main/ets/MainAbility/pages/index.ets index 54b28ac3d..5e23de1ad 100644 --- a/settingsdata/settings_ets/entry/src/main/ets/MainAbility/pages/index.ets +++ b/applications/settingsdata/settings_ets/entry/src/main/ets/MainAbility/pages/index.ets @@ -1,37 +1,37 @@ -// @ts-nocheck -/** - * 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. - */ - -@Entry -@Component -struct MyComponent { - aboutToAppear() { - } - - build() { - Flex({ - direction: FlexDirection.Column, - alignItems: ItemAlign.Center, - justifyContent: FlexAlign.Center - }) { - Text('Settings ETS TEST') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} - +// @ts-nocheck +/** + * 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. + */ + +@Entry +@Component +struct MyComponent { + aboutToAppear() { + } + + build() { + Flex({ + direction: FlexDirection.Column, + alignItems: ItemAlign.Center, + justifyContent: FlexAlign.Center + }) { + Text('Settings ETS TEST') + .fontSize(50) + .fontWeight(FontWeight.Bold) + } + .width('100%') + .height('100%') + } +} + diff --git a/settingsdata/settings_ets/entry/src/main/ets/TestAbility/app.ets b/applications/settingsdata/settings_ets/entry/src/main/ets/TestAbility/app.ets similarity index 97% rename from settingsdata/settings_ets/entry/src/main/ets/TestAbility/app.ets rename to applications/settingsdata/settings_ets/entry/src/main/ets/TestAbility/app.ets index 9511bef9a..1405dd359 100644 --- a/settingsdata/settings_ets/entry/src/main/ets/TestAbility/app.ets +++ b/applications/settingsdata/settings_ets/entry/src/main/ets/TestAbility/app.ets @@ -1,32 +1,32 @@ -/* - * 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 'hypium/index' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('Application 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.info('Application onDestroy') - }, +/* + * 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 'hypium/index' +import testsuite from '../test/List.test' + +export default { + onCreate() { + console.info('Application 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.info('Application onDestroy') + }, } \ No newline at end of file diff --git a/settingsdata/settings_ets/entry/src/main/ets/TestAbility/pages/index.ets b/applications/settingsdata/settings_ets/entry/src/main/ets/TestAbility/pages/index.ets similarity index 96% rename from settingsdata/settings_ets/entry/src/main/ets/TestAbility/pages/index.ets rename to applications/settingsdata/settings_ets/entry/src/main/ets/TestAbility/pages/index.ets index 011878f2b..52663437c 100644 --- a/settingsdata/settings_ets/entry/src/main/ets/TestAbility/pages/index.ets +++ b/applications/settingsdata/settings_ets/entry/src/main/ets/TestAbility/pages/index.ets @@ -1,49 +1,49 @@ -/* - * 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 '@system.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%') - } +/* + * 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 '@system.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/settingsdata/settings_ets/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/applications/settingsdata/settings_ets/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts similarity index 97% rename from settingsdata/settings_ets/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts rename to applications/settingsdata/settings_ets/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts index 143e3ae5c..14e78a653 100644 --- a/settingsdata/settings_ets/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/applications/settingsdata/settings_ets/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -1,77 +1,77 @@ -/* - * 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 itName', - '-s level', '-s testType', '-s size', '-s timeout', - '-s package' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - 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') - } - - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -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 call abilityDelegator.getAppContext') - var context = abilityDelegator.getAppContext() - console.info('getAppContext : ' + JSON.stringify(context)) - console.info('OpenHarmonyTestRunner onRun end') - } +/* + * 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 itName', + '-s level', '-s testType', '-s size', '-s timeout', + '-s package' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + 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') + } + + onRun() { + console.log('OpenHarmonyTestRunner onRun run') + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -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 call abilityDelegator.getAppContext') + var context = abilityDelegator.getAppContext() + console.info('getAppContext : ' + JSON.stringify(context)) + console.info('OpenHarmonyTestRunner onRun end') + } }; \ No newline at end of file diff --git a/settingsdata/settings_ets/entry/src/main/ets/test/List.test.ets b/applications/settingsdata/settings_ets/entry/src/main/ets/test/List.test.ets similarity index 97% rename from settingsdata/settings_ets/entry/src/main/ets/test/List.test.ets rename to applications/settingsdata/settings_ets/entry/src/main/ets/test/List.test.ets index 1b296eaec..de54e5512 100644 --- a/settingsdata/settings_ets/entry/src/main/ets/test/List.test.ets +++ b/applications/settingsdata/settings_ets/entry/src/main/ets/test/List.test.ets @@ -1,19 +1,19 @@ -/** - * 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 settingUiJsunit from './SettingUiJsunit.test.ets'; - -export default function testsuite() { - settingUiJsunit(); +/** + * 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 settingUiJsunit from './SettingUiJsunit.test.ets'; + +export default function testsuite() { + settingUiJsunit(); } \ No newline at end of file diff --git a/settingsdata/settings_ets/entry/src/main/ets/test/SettingUiJsunit.test.ets b/applications/settingsdata/settings_ets/entry/src/main/ets/test/SettingUiJsunit.test.ets similarity index 97% rename from settingsdata/settings_ets/entry/src/main/ets/test/SettingUiJsunit.test.ets rename to applications/settingsdata/settings_ets/entry/src/main/ets/test/SettingUiJsunit.test.ets index fda8237db..91bda9735 100644 --- a/settingsdata/settings_ets/entry/src/main/ets/test/SettingUiJsunit.test.ets +++ b/applications/settingsdata/settings_ets/entry/src/main/ets/test/SettingUiJsunit.test.ets @@ -1,1187 +1,1187 @@ -// @ts-nocheck -/** - * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; -import settings from '@ohos.settings' -import featureAbility from '@ohos.ability.featureAbility'; - -export default function settingUiJsunit() { - describe('appInfoTest', function () { - console.log("************* settings Test start*************"); - it('settings_uri_test_001', 0,async function (done) { - var name = 'settings.screen.test'; - var uri = settings.getUriSync(name); - console.info("[settings_uri_test_001] uri is: " + uri); - var uri2 = settings.getUriSync(name); - console.info("[settings_uri_test_001] uri2 is: " + uri2); - expect(uri).assertEqual(uri2); - done(); - }); - - it('settings_uri_test_002', 0, async function (done) { - var name = ''; - var uri = settings.getUriSync(name); - console.info("[settings_uri_test_002] uri is: " + uri); - expect(uri).assertEqual('dataability:///com.ohos.settingsdata.DataAbility') - done(); - }); - - it('settings_uri_test_003', 0, async function (done) { - var name = 122.00; - try { - var uri = settings.getUriSync(name); - console.info("[settings_uri_test_003] uri is: " + uri); - } catch (err) { - let errMsg = err; - console.error("[settings_uri_test_003] error = " + errMsg); - expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") - .assertTrue(); - } - done(); - }); - - it('settings_uri_test_004', 0, async function (done) { - var name = 'settings.screen.brightness'; - var uri = settings.getUriSync(name); - console.info("[settings_uri_test_004] uri is: " + uri); - expect(uri).assertEqual('dataability:///com.ohos.settingsdata.DataAbility/settings.screen.brightness') - done(); - }); - - it('settings_get_value_005', 0, async function (done) { - var name = 'settings.screen.brightness20'; - var uri = settings.getUriSync(name); - var helper = featureAbility.acquireDataAbilityHelper(uri); - let value = settings.getValueSync(helper, name, "test getValueSync"); - console.info("[settings_get_value_005] value is: " + value); - expect(value).assertEqual("test getValueSync"); - done(); - }); - - it('settings_get_value_006', 0, async function (done) { - var name = 'settings.screen.brightness2'; - var uri = settings.getUriSync(name); - console.info("[settings_get_value_006] uri is: " + uri); - var helper = featureAbility.acquireDataAbilityHelper(uri); - let obj = { - aa: "aa" - } - try { - let value = settings.getValueSync(helper, name, obj); - console.info("[settings_get_value_006] value is: " + value); - expect(value).assertEqual("test getValueSync"); - } catch (err) { - console.error("[settings_get_value_006] error = " + err); - expect(err == "Error: assertion (valueType == napi_string) failed: Wrong argument[2] type. String expected.") - .assertTrue(); - } - done(); - }); - - it('settings_get_value_007', 0, async function (done) { - var name = 'settings.screen.brightness3'; - var uri = settings.getUriSync(name); - console.info("[settings_get_value_007] uri is: " + uri); - var helper = featureAbility.acquireDataAbilityHelper(uri); - let obj = ''; - try { - let value = settings.getValueSync(helper, name, obj); - console.info("[settings_get_value_007] value is: " + value); - expect(value).assertEqual(''); - } catch (err) { - console.error("[settings_get_value_007] error = " + err); - expect(err == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") - .assertTrue(); - } - done(); - }); - - it('settings_get_value_008', 0, async function (done) { - var name = 'settings.screen.brightness4'; - var uri = settings.getUriSync(name); - console.info("[settings_get_value_008] uri is: " + uri); - var helper = featureAbility.acquireDataAbilityHelper(uri); - let obj = null; - try { - let value = settings.getValueSync(helper, name, obj); - console.info("[settings_get_value_008] value is: " + value); - } catch (err) { - console.error("[settings_get_value_008] error = " + err); - expect(err == "Error: assertion (valueType == napi_string) failed: Wrong argument[2] type. String expected.") - .assertTrue(); - } - done(); - }); - - it('settings_get_value_009', 0, async function (done) { - var name = 'settings.screen.brightness5'; - var uri = settings.getUriSync(name); - console.info("[settings_get_value_009] uri is: " + uri); - var helper = "helper"; - try { - let value = settings.getValueSync(helper, name, "test getValueSync"); - console.info("[settings_get_value_009] value is: " + value); - } catch (err) { - console.error("[settings_get_value_009] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_get_value_010', 0, async function (done) { - var name = 'settings.screen.brightness6'; - var uri = settings.getUriSync(name); - console.info("[settings_get_value_010] uri is: " + uri); - var helper = null; - try { - let value = settings.getValueSync(helper, name, "test getValueSync"); - console.info("[settings_get_value_010] value is: " + value); - } catch (err) { - console.error("[settings_get_value_010] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_get_value_0011', 0, async function (done) { - var name = 'settings.screen.brightness7'; - var uri = settings.getUriSync(name); - console.info("[settings_get_value_0011] uri is: " + uri); - var helper = "helper"; - let obj = 121; - try { - let value = settings.getValueSync(helper, name, obj); - console.info("[settings_get_value_0011] value is: " + value); - } catch (err) { - console.error("[settings_get_value_0011] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_get_value_0012', 0, async function (done) { - var name = 'settings.screen.brightness8'; - var uri = settings.getUriSync(name); - console.info("[settings_get_value_0012] uri is: " + uri); - var helper = null; - let obj = null; - try { - let value = settings.getValueSync(helper, name, obj); - console.info("[settings_get_value_0012] value is: " + value); - } catch (err) { - console.error("[settings_get_value_0012] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_get_value_013', 0, async function (done) { - var name = 1322.00; - try { - var uri = settings.getUriSync(name); - console.info("[settings_get_value_013] uri is: " + uri); - } catch (err) { - let errMsg = err; - console.error("[settings_get_value_013] error = " + errMsg); - expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") - .assertTrue(); - } - var helper = featureAbility.acquireDataAbilityHelper(uri); - try { - let value = settings.getValueSync(helper, name, "test getValueSync"); - console.info("[settings_get_value_013] value is: " + value); - } catch (err) { - console.error("[settings_get_value_013] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_get_value_014', 0, async function (done) { - let name = null; - try { - var uri = settings.getUriSync(name); - console.info("[settings_get_value_014] uri is: " + uri); - } catch (err) { - let errMsg = err; - console.error("[settings_get_value_014] error = " + errMsg); - expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") - .assertTrue(); - } - var helper = featureAbility.acquireDataAbilityHelper(uri); - try { - let value = settings.getValueSync(helper, name, "test getValueSync"); - console.info("[settings_get_value_014] value is: " + value); - } catch (err) { - console.error("[settings_get_value_014] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_get_value_0015', 0, async function (done) { - let name = 1332; - try { - var uri = settings.getUriSync(name); - console.info("[settings_get_value_0015] uri is: " + uri); - } catch (err) { - let errMsg = err; - console.error("[settings_get_value_0015] error = " + errMsg); - expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") - .assertTrue(); - } - var helper = featureAbility.acquireDataAbilityHelper(uri); - let obj = 22223; - try { - let value = settings.getValueSync(helper, name, obj); - console.info("[settings_get_value_0015] value is: " + value); - } catch (err) { - console.error("[settings_get_value_0015] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_get_value_0016', 0, async function (done) { - let name = 1332; - try { - var uri = settings.getUriSync(name); - console.info("[settings_get_value_0016] uri is: " + uri); - } catch (err) { - let errMsg = err; - console.error("[settings_get_value_0016] error = " + errMsg); - expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") - .assertTrue(); - } - var helper = "helper"; - try { - let value = settings.getValueSync(helper, name, "test getValueSync"); - console.info("[settings_get_value_0016] value is: " + value); - } catch (err) { - console.error("[settings_get_value_0016] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_get_value_0017', 0, async function (done) { - let name = 1332; - try { - var uri = settings.getUriSync(name); - console.info("[settings_get_value_0017] uri is: " + uri); - } catch (err) { - let errMsg = err; - console.error("[settings_get_value_0017] error = " + errMsg); - expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") - .assertTrue(); - } - var helper = "helper"; - let obj = 221323; - try { - let value = settings.getValueSync(helper, name, obj); - console.info("[settings_get_value_0017] value is: " + value); - } catch (err) { - console.error("[settings_get_value_0017] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_set_value_018', 0, async function (done) { - let name = 'settings.screen.brightness10'; - var uri = settings.getUriSync(name); - var helper = featureAbility.acquireDataAbilityHelper(uri); - let value = settings.setValueSync(helper, name, "test getValueSync"); - expect(value).assertEqual(true); - done(); - }); - - it('settings_set_value_019', 0, async function (done) { - let name = 'settings.screen.brightness11'; - var uri = settings.getUriSync(name); - var helper = featureAbility.acquireDataAbilityHelper(uri); - let obj = 32344.00; - try { - let value = settings.setValueSync(helper, name, obj); - console.info("[settings_set_value_019] value is: " + value); - expect(value).assertEqual(true); - } catch (err) { - console.error("[settings_set_value_019] error = " + err); - expect(err == "Error: assertion (valueType == napi_string) failed: Wrong argument[2] type. String expected.") - .assertTrue(); - } - done(); - }); - - it('settings_set_value_020', 0, async function (done) { - let name = 'settings.screen.brightness12'; - var uri = settings.getUriSync(name); - var helper = featureAbility.acquireDataAbilityHelper(uri); - let obj = null; - try { - let value = settings.setValueSync(helper, name, obj); - console.info("[settings_set_value_020] value is: " + value); - expect(value).assertEqual(true); - } catch (err) { - console.error("[settings_set_value_020] error = " + err); - expect(err == "Error: assertion (valueType == napi_string) failed: Wrong argument[2] type. String expected.") - .assertTrue(); - } - done(); - }); - - it('settings_set_value_021', 0, async function (done) { - let name = 'settings.screen.brightness13'; - var helper = "helper"; - try { - let value = settings.setValueSync(helper, name, "test getValueSync"); - expect(value).assertEqual(true); - } catch (err) { - console.error("[settings_set_value_021] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_set_value_022', 0, async function (done) { - let name = 'settings.screen.brightness13'; - var helper = null; - try { - let value = settings.setValueSync(helper, name, "test getValueSync"); - expect(value).assertEqual(true); - } catch (err) { - console.error("[settings_set_value_022] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_set_value_023', 0, async function (done) { - let name = 'settings.screen.brightness14'; - var helper = "helper"; - let obj = 343434.00; - try { - let value = settings.setValueSync(helper, name, obj); - expect(value).assertEqual(true); - } catch (err) { - console.error("[settings_set_value_023] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_set_value_024', 0, async function (done) { - let name = 'settings.screen.brightness14'; - var helper = "helper"; - let obj = null; - try { - let value = settings.setValueSync(helper, name, obj); - expect(value).assertEqual(true); - } catch (err) { - console.error("[settings_set_value_024] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_set_value_025', 0, async function (done) { - let name = 'settings.screen.brightness14'; - var helper = null; - let obj = 2323.00; - try { - let value = settings.setValueSync(helper, name, obj); - expect(value).assertEqual(true); - } catch (err) { - console.error("[settings_set_value_025] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_set_value_026', 0, async function (done) { - let name = 1332; - try { - var uri = settings.getUriSync(name); - console.info("[settings_set_value_026] uri is: " + uri); - } catch (err) { - let errMsg = err; - console.error("[settings_set_value_026] error = " + errMsg); - expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") - .assertTrue(); - } - var helper = featureAbility.acquireDataAbilityHelper(uri); - try { - let value = settings.setValueSync(helper, name, "test getValueSync"); - expect(value).assertEqual(true); - } catch (err) { - console.error("[settings_set_value_026] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_set_value_027', 0, async function (done) { - let name = null; - try { - var uri = settings.getUriSync(name); - console.info("[settings_set_value_027] uri is: " + uri); - } catch (err) { - let errMsg = err; - console.error("[settings_set_value_027] error = " + errMsg); - expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") - .assertTrue(); - } - var helper = featureAbility.acquireDataAbilityHelper(uri); - try { - let value = settings.setValueSync(helper, name, "test getValueSync"); - expect(value).assertEqual(true); - } catch (err) { - console.error("[settings_set_value_027] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_set_value_028', 0, async function (done) { - let name = 2323; - try { - var uri = settings.getUriSync(name); - console.info("[settings_set_value_028] uri is: " + uri); - } catch (err) { - let errMsg = err; - console.error("[settings_set_value_028] error = " + errMsg); - expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") - .assertTrue(); - } - var helper = featureAbility.acquireDataAbilityHelper(uri); - let obj = 232.00; - try { - let value = settings.setValueSync(helper, name, obj); - expect(value).assertEqual(true); - } catch (err) { - console.error("[settings_set_value_028] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_set_value_029', 0, async function (done) { - let name = 2323; - try { - var uri = settings.getUriSync(name); - console.info("[settings_set_value_029] uri is: " + uri); - } catch (err) { - let errMsg = err; - console.error("[settings_set_value_029] error = " + errMsg); - expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") - .assertTrue(); - } - var helper = featureAbility.acquireDataAbilityHelper(uri); - let obj = null; - try { - let value = settings.setValueSync(helper, name, obj); - expect(value).assertEqual(true); - } catch (err) { - console.error("[settings_set_value_029] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_set_value_030', 0, async function (done) { - let name = 2323; - try { - var uri = settings.getUriSync(name); - console.info("[settings_set_value_030] uri is: " + uri); - } catch (err) { - let errMsg = err; - console.error("[settings_set_value_030] error = " + errMsg); - expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") - .assertTrue(); - } - var helper = "helper"; - try { - let value = settings.setValueSync(helper, name, "text value"); - expect(value).assertEqual(true); - } catch (err) { - console.error("[settings_set_value_030] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_set_value_031', 0, async function (done) { - let name = 2323; - try { - var uri = settings.getUriSync(name); - console.info("[settings_set_value_031] uri is: " + uri); - } catch (err) { - let errMsg = err; - console.error("[settings_set_value_031] error = " + errMsg); - expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") - .assertTrue(); - } - var helper = null; - try { - let value = settings.setValueSync(helper, name, "text value"); - expect(value).assertEqual(true); - } catch (err) { - console.error("[settings_set_value_031] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_set_value_032', 0, async function (done) { - let name = 2323; - try { - var uri = settings.getUriSync(name); - console.info("[settings_set_value_032] uri is: " + uri); - } catch (err) { - let errMsg = err; - console.error("[settings_set_value_032] error = " + errMsg); - expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") - .assertTrue(); - } - var helper = "helper"; - let obj = 2323; - try { - let value = settings.setValueSync(helper, name, obj); - expect(value).assertEqual(true); - } catch (err) { - console.error("[settings_set_value_032] error = " + err); - expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") - .assertTrue(); - } - done(); - }); - - it('settings_get_value_033', 0, async function (done){ - let uri = 'dataability:///com.ohos.settingsdata.DataAbility'; - let helper = featureAbility.acquireDataAbilityHelper(uri); - - let name = 'settings.screen.brightness33'; - let value = 'brightness33' - try{ - settings.setValueSync(helper, name, value); - settings.getValue(helper, name, ret =>{ - console.info("[settings_get_value_033] value is: " + ret); - expect(ret).assertEqual(value); - done(); - }) - } catch(err){ - console.info("[settings_get_value_033] error is: " + toString(error)); - expect(true).assertTrue(); - done(); - return; - } - }); - - it('settings_get_value_034', 0, async function (done){ - let uri = 'dataability:///com.ohos.settingsdata.DataAbility'; - let helper = featureAbility.acquireDataAbilityHelper(uri); - - let name = 'settings.screen.brightness34'; - let value = 'brightness34' - - try{ - settings.setValueSync(helper, name, value); - settings.getValue(helper, name).then(ret =>{ - console.info("[settings_get_value_034] value is: " + ret); - expect(ret).assertEqual(value); - done(); - }) - } catch(err){ - console.info("[settings_get_value_034] error is: " + toString(error)); - expect(true).assertTrue(); - done(); - return; - } - }); - - it('settings_get_value_035', 0, async function (done){ - var name = 'settings.screen.brightness35'; - let uriPrefix = 'dataability:///com.ohos.settingsdata.DataAbility' - let expectValue = uriPrefix + '/' + name; - try{ - settings.getURI(name).then(data => { - console.info("[settings_get_uri_035] uri is: " + data); - expect(data).assertEqual(expectValue); - done(); - }) - } catch(err){ - console.info("[settings_get_uri_035] error is: " + toString(error)); - expect(true).assertTrue(); - done(); - return; - } - }); - - it('settings_get_value_036', 0, async function (done){ - var name = 'settings.screen.brightness36'; - let uriPrefix = 'dataability:///com.ohos.settingsdata.DataAbility' - let expectValue = uriPrefix + '/' + name; - try{ - settings.getURI(name, (data) =>{ - console.info("[settings_get_uri_036] uri is: " + data); - expect(data).assertEqual(expectValue); - done(); - }) - }catch(err){ - console.info("[settings_get_uri_036] error is: " + toString(error)); - expect(true).assertTrue(); - done(); - return; - } - }); - - it('settings_get_value_037',0,async function (done) { - var str ="settings.date.date_format" - expect(str).assertEqual(settings.date.DATE_FORMAT); - done(); - }); - - it('settings_get_value_038',0,async function (done) { - var str ="settings.date.time_format" - expect(str).assertEqual(settings.date.TIME_FORMAT); - done(); - }); - - it('settings_get_value_039',0,async function (done) { - var str ="settings.date.auto_gain_time" - expect(str).assertEqual(settings.date.AUTO_GAIN_TIME); - done(); - }); - - it('settings_get_value_040',0,async function (done) { - var str ="settings.date.auto_gain_time_zone" - expect(str).assertEqual(settings.date.AUTO_GAIN_TIME_ZONE); - done(); - }); - - it('settings_get_value_041',0,async function (done) { - var str ="settings.display.font_scale" - expect(str).assertEqual(settings.display.FONT_SCALE); - done(); - }); - - it('settings_get_value_042',0,async function (done) { - var str ="settings.display.screen_brightness_status" - expect(str).assertEqual(settings.display.SCREEN_BRIGHTNESS_STATUS); - done(); - }); - - it('settings_get_value_043',0,async function (done) { - var str ="settings.display.auto_screen_brightness" - expect(str).assertEqual(settings.display.AUTO_SCREEN_BRIGHTNESS); - done(); - }); - - it('settings_get_value_044',0,async function (done) { - var int = 1 - expect(int).assertEqual(settings.display.AUTO_SCREEN_BRIGHTNESS_MODE); - done(); - }); - - it('settings_get_value_045',0,async function (done) { - var int = 0 - expect(int).assertEqual(settings.display.MANUAL_SCREEN_BRIGHTNESS_MODE); - done(); - }); - - it('settings_get_value_046',0,async function (done) { - var str ="settings.display.screen_off_timeout" - expect(str).assertEqual(settings.display.SCREEN_OFF_TIMEOUT); - done(); - }); - - it('settings_get_value_047',0,async function (done) { - var str ="settings.display.default_screen_rotation" - expect(str).assertEqual(settings.display.DEFAULT_SCREEN_ROTATION); - done(); - }); - - it('settings_get_value_048',0,async function (done) { - var str ="settings.display.animator_duration_scale" - expect(str).assertEqual(settings.display.ANIMATOR_DURATION_SCALE); - done(); - }); - - it('settings_get_value_049',0,async function (done) { - var str ="settings.display.transition_animation_scale" - expect(str).assertEqual(settings.display.TRANSITION_ANIMATION_SCALE); - done(); - }); - - it('settings_get_value_050',0,async function (done) { - var str ="settings.display.window_animation_scale" - expect(str).assertEqual(settings.display.WINDOW_ANIMATION_SCALE); - done(); - }); - - it('settings_get_value_051',0,async function (done) { - var str = "settings.display.display_inversion_status" - expect(str).assertEqual(settings.display.DISPLAY_INVERSION_STATUS); - done(); - }); - - it('settings_get_value_052',0,async function (done) { - var str = "settings.general.setup_wizard_finished" - expect(str).assertEqual(settings.general.SETUP_WIZARD_FINISHED); - done(); - }); - - it('settings_get_value_053',0,async function (done) { - var str = "settings.general.end_button_action" - expect(str).assertEqual(settings.general.END_BUTTON_ACTION); - done(); - }); - - it('settings_get_value_054',0,async function (done) { - var str = "settings.general.airplane_mode_status" - expect(str).assertEqual(settings.general.AIRPLANE_MODE_STATUS); - done(); - }); - - it('settings_get_value_055',0,async function (done) { - var str = "settings.general.accelerometer_rotation_status" - expect(str).assertEqual(settings.general.ACCELEROMETER_ROTATION_STATUS); - done(); - }); - - it('settings_get_value_056',0,async function (done) { - var str = "settings.general.device_provision_status" - expect(str).assertEqual(settings.general.DEVICE_PROVISION_STATUS); - done(); - }); - - it('settings_get_value_057',0,async function (done) { - var str = "settings.general.hdc_status" - expect(str).assertEqual(settings.general.HDC_STATUS); - done(); - }); - - - - it('settings_get_value_058',0,async function (done) { - var str = "settings.general.boot_counting" - expect(str).assertEqual(settings.general.BOOT_COUNTING); - done(); - }); - - it('settings_get_value_059',0,async function (done) { - var str = "settings.general.contact_metadata_sync_status" - expect(str).assertEqual(settings.general.CONTACT_METADATA_SYNC_STATUS); - done(); - }); - - it('settings_get_value_060',0,async function (done) { - var str = "settings.general.development_settings_status" - expect(str).assertEqual(settings.general.DEVELOPMENT_SETTINGS_STATUS); - done(); - }); - - it('settings_get_value_061',0,async function (done) { - var str = "settings.general.device_name" - expect(str).assertEqual(settings.general.DEVICE_NAME); - done(); - }); - - it('settings_get_value_062',0,async function (done) { - var str = "settings.general.usb_storage_status" - expect(str).assertEqual(settings.general.USB_STORAGE_STATUS); - done(); - }); - - it('settings_get_value_063',0,async function (done) { - var str = "settings.general.debugger_waiting" - expect(str).assertEqual(settings.general.DEBUGGER_WAITING); - done(); - }); - - it('settings_get_value_064',0,async function (done) { - var str = "settings.general.debug_app_package" - expect(str).assertEqual(settings.general.DEBUG_APP_PACKAGE); - done(); - }); - - it('settings_get_value_065',0,async function (done) { - var str = "settings.general.accessibility_status" - expect(str).assertEqual(settings.general.ACCESSIBILITY_STATUS); - done(); - }); - - it('settings_get_value_066',0,async function (done) { - var str = "settings.general.activated_accessibility_services" - expect(str).assertEqual(settings.general.ACTIVATED_ACCESSIBILITY_SERVICES); - done(); - }); - - it('settings_get_value_067',0,async function (done) { - var str = "settings.general.geolocation_origins_allowed" - expect(str).assertEqual(settings.general.GEOLOCATION_ORIGINS_ALLOWED); - done(); - }); - - it('settings_get_value_068',0,async function (done) { - var str = "settings.general.skip_use_hints" - expect(str).assertEqual(settings.general.SKIP_USE_HINTS); - done(); - }); - - it('settings_get_value_069',0,async function (done) { - var str = "settings.general.touch_exploration_status" - expect(str).assertEqual(settings.general.TOUCH_EXPLORATION_STATUS); - done(); - }); - - it('settings_get_value_070',0,async function (done) { - var str = "settings.input.default_input_method" - expect(str).assertEqual(settings.input.DEFAULT_INPUT_METHOD); - done(); - }); - - it('settings_get_value_071',0,async function (done){ - var str = "settings.input.activated_input_method_submode" - let expectValue:string=settings.input.ACTIVATED_INPUT_METHOD_SUB_MODE; - expect(str).assertEqual(expectValue); - done(); - }); - - - it('settings_get_value_072',0,async function (done){ - var str = "settings.input.activated_input_methods" - expect(str).assertEqual(settings.input.ACTIVATED_INPUT_METHODS); - done(); - }); - - - it('settings_get_value_073',0,async function (done){ - var str = "settings.input.selector_visibility_for_input_method" - expect(str).assertEqual(settings.input.SELECTOR_VISIBILITY_FOR_INPUT_METHOD); - done(); - }); - - - it('settings_get_value_074',0,async function (done){ - var str = "settings.input.auto_caps_text_input" - expect(str).assertEqual(settings.input.AUTO_CAPS_TEXT_INPUT); - done(); - }); - - - it('settings_get_value_075',0,async function (done){ - var str = "settings.input.auto_punctuate_text_input" - expect(str).assertEqual(settings.input.AUTO_PUNCTUATE_TEXT_INPUT); - done(); - }); - - - it('settings_get_value_076',0,async function (done){ - var str = "settings.input.auto_replace_text_input" - expect(str).assertEqual(settings.input.AUTO_REPLACE_TEXT_INPUT); - done(); - }); - - - it('settings_get_value_077',0,async function (done){ - var str = "settings.input.show_password_text_input" - expect(str).assertEqual(settings.input.SHOW_PASSWORD_TEXT_INPUT); - done(); - }); - - - it('settings_get_value_078',0,async function (done){ - var str = "settings.network.data_roaming_status" - expect(str).assertEqual(settings.network.DATA_ROAMING_STATUS); - done(); - }); - - - it('settings_get_value_079',0,async function (done){ - var str = "settings.network.http_proxy_cfg" - expect(str).assertEqual(settings.network.HTTP_PROXY_CFG); - done(); - }); - - - it('settings_get_value_080',0,async function (done){ - var str = "settings.network.network_preference_usage" - expect(str).assertEqual(settings.network.NETWORK_PREFERENCE_USAGE); - done(); - }); - - - it('settings_get_value_081',0,async function (done){ - var str = "settings.phone.rtt_calling_status" - expect(str).assertEqual(settings.phone.RTT_CALLING_STATUS); - done(); - }); - - - it('settings_get_value_082',0,async function (done){ - var str = "settings.sound.vibrate_while_ringing" - expect(str).assertEqual(settings.sound.VIBRATE_WHILE_RINGING); - done(); - }); - - - it('settings_get_value_083',0,async function (done){ - var str = "settings.sound.default_alarm_alert" - expect(str).assertEqual(settings.sound.DEFAULT_ALARM_ALERT); - done(); - }); - - - it('settings_get_value_084',0,async function (done){ - var str = "settings.sound.dtmf_tone_type_while_dialing" - expect(str).assertEqual(settings.sound.DTMF_TONE_TYPE_WHILE_DIALING); - done(); - }); - - - it('settings_get_value_085',0,async function (done){ - var str = "settings.sound.dtmf_tone_while_dialing" - expect(str).assertEqual(settings.sound.DTMF_TONE_WHILE_DIALING); - done(); - }); - - - it('settings_get_value_086',0,async function (done){ - var str = "settings.sound.haptic_feedback_status" - expect(str).assertEqual(settings.sound.HAPTIC_FEEDBACK_STATUS); - done(); - }); - - - it('settings_get_value_087',0,async function (done){ - var str = "settings.sound.affected_mode_ringer_streams" - expect(str).assertEqual(settings.sound.AFFECTED_MODE_RINGER_STREAMS); - done(); - }); - - - it('settings_get_value_088',0,async function (done){ - var str = "settings.sound.affected_mute_streams" - expect(str).assertEqual(settings.sound.AFFECTED_MUTE_STREAMS); - done(); - }); - - - it('settings_get_value_089',0,async function (done){ - var str = "settings.sound.default_notification_sound" - expect(str).assertEqual(settings.sound.DEFAULT_NOTIFICATION_SOUND); - done(); - }); - - - it('settings_get_value_090',0,async function (done){ - var str = "settings.sound.default_ringtone" - expect(str).assertEqual(settings.sound.DEFAULT_RINGTONE); - done(); - }); - - it('settings_get_value_091',0,async function (done) { - var str ="settings.sound.sound_effects_status" - expect(str).assertEqual(settings.sound.SOUND_EFFECTS_STATUS); - done(); - }); - - it('settings_get_value_092',0,async function (done) { - var str ="settings.sound.vibrate_status" - expect(str).assertEqual(settings.sound.VIBRATE_STATUS); - done(); - }); - - it('settings_get_value_093',0,async function (done) { - var str ="settings.tts.default_tts_pitch" - expect(str).assertEqual(settings.tts.DEFAULT_TTS_PITCH); - done(); - }); - - it('settings_get_value_094',0,async function (done) { - var str ="settings.tts.default_tts_rate" - expect(str).assertEqual(settings.tts.DEFAULT_TTS_RATE); - done(); - }); - - it('settings_get_value_095',0,async function (done) { - var str ="settings.tts.default_tts_synth" - expect(str).assertEqual(settings.tts.DEFAULT_TTS_SYNTH); - done(); - }); - - it('settings_get_value_096',0,async function (done) { - var str ="settings.tts.enabled_tts_plugins" - expect(str).assertEqual(settings.tts.ENABLED_TTS_PLUGINS); - done(); - }); - - it('settings_get_value_097',0,async function (done) { - var str ="settings.wireless.bluetooth_radio" - expect(str).assertEqual(settings.wireless.BLUETOOTH_RADIO); - done(); - }); - - it('settings_get_value_098',0,async function (done) { - var str ="settings.wireless.cell_radio" - expect(str).assertEqual(settings.wireless.CELL_RADIO); - done(); - }); - - it('settings_get_value_099',0,async function (done) { - var str ="settings.wireless.nfc_radio" - expect(str).assertEqual(settings.wireless.NFC_RADIO); - done(); - }); - - it('settings_get_value_100',0,async function (done) { - var str ="settings.wireless.airplane_mode_radios" - expect(str).assertEqual(settings.wireless.AIRPLANE_MODE_RADIOS); - done(); - }); - - it('settings_get_value_101',0,async function (done) { - var str ="settings.wireless.bluetooth_status" - expect(str).assertEqual(settings.wireless.BLUETOOTH_STATUS); - done(); - }); - - it('settings_get_value_102',0,async function (done) { - var str ="settings.wireless.bluetooth_discoverability_status" - expect(str).assertEqual(settings.wireless.BLUETOOTH_DISCOVER_ABILITY_STATUS); - done(); - }); - - it('settings_get_value_103',0,async function (done) { - var str ="settings.wireless.bluetooth_discover_timeout" - expect(str).assertEqual(settings.wireless.BLUETOOTH_DISCOVER_TIMEOUT); - done(); - }); - - it('settings_get_value_104',0,async function (done) { - var str ="settings.wireless.wifi_dhcp_max_retry_count" - expect(str).assertEqual(settings.wireless.WIFI_DHCP_MAX_RETRY_COUNT); - done(); - }); - - it('settings_get_value_105',0,async function (done) { - var str ="settings.wireless.wifi_to_mobile_data_awake_timeout" - expect(str).assertEqual(settings.wireless.WIFI_TO_MOBILE_DATA_AWAKE_TIMEOUT); - done(); - }); - - it('settings_get_value_106',0,async function (done) { - var str ="settings.wireless.wifi_status" - expect(str).assertEqual(settings.wireless.WIFI_STATUS); - done(); - }); - - it('settings_get_value_107',0,async function (done) { - var str ="settings.wireless.wifi_watchdog_status" - expect(str).assertEqual(settings.wireless.WIFI_WATCHDOG_STATUS); - done(); - }); - - it('settings_get_value_108',0,async function (done) { - var str ="settings.wireless.wifi_radio" - expect(str).assertEqual(settings.wireless.WIFI_RADIO); - done(); - }); - - it('settings_get_value_109',0,async function (done) { - var str ="settings.wireless.owner_lockdown_wifi_cfg" - expect(str).assertEqual(settings.wireless.OWNER_LOCKDOWN_WIFI_CFG); - done(); - }); - - it('settings_get_value_110',0,async function (done) { - var str ="settings.wireless.owner_lockdown_wifi_cfg" - expect(str).assertEqual(settings.wireless.OWNER_LOCKDOWN_WIFI_CFG); - done(); - }); - - it('settings_get_value_111',0,async function (done) { - let uri = 'dataability:///com.ohos.settingsdata.DataAbility'; - let helper = featureAbility.acquireDataAbilityHelper(uri); - let name = 'settings.screen.brightness111';//关键字 - let value = 'brightness111'//值 - try{ - settings.setValue(helper, name, value,(data)=>{ - console.info("[settings_get_value_111] value is:" + data); - settings.getValue(helper, name).then(ret => { - console.info("[settings_get_value_111] value is:" + ret); - expect(ret).assertEqual(value); - done(); - }) - }); - }catch(err){ - console.info("[settings_get_value_111] error is:" + toString(error)); - expect(true).assertTrue(); - done(); - return; - } - }); - - it('settings_get_value_112',0,async function (done) { - let uri = 'dataability:///com.ohos.settingsdata.DataAbility'; - let helper = featureAbility.acquireDataAbilityHelper(uri); - let name = 'settings.screen.brightness112';//关键字 - let value = 'brightness112'//值 - try{ - settings.setValue(helper, name, value) - .then((data)=>{ - console.info("[settings_get_value_112] value is:" + data); - settings.getValue(helper, name).then(ret => { - console.info("[settings_get_value_112] value is:" + ret); - expect(ret).assertEqual(value); - done(); - }) - }) - .catch((err)=>{ - console.info("[settings_get_value_112] error is:" + toString(error)); - expect(true).assertTrue(); - done(); - return; - }) - }catch(err){ - console.info("[settings_get_value_112] error is:" + toString(error)); - expect(true).assertTrue(); - done(); - return; - } - }); - }) -} +// @ts-nocheck +/** + * 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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "hypium/index"; +import settings from '@ohos.settings' +import featureAbility from '@ohos.ability.featureAbility'; + +export default function settingUiJsunit() { + describe('appInfoTest', function () { + console.log("************* settings Test start*************"); + it('settings_uri_test_001', 0,async function (done) { + var name = 'settings.screen.test'; + var uri = settings.getUriSync(name); + console.info("[settings_uri_test_001] uri is: " + uri); + var uri2 = settings.getUriSync(name); + console.info("[settings_uri_test_001] uri2 is: " + uri2); + expect(uri).assertEqual(uri2); + done(); + }); + + it('settings_uri_test_002', 0, async function (done) { + var name = ''; + var uri = settings.getUriSync(name); + console.info("[settings_uri_test_002] uri is: " + uri); + expect(uri).assertEqual('dataability:///com.ohos.settingsdata.DataAbility') + done(); + }); + + it('settings_uri_test_003', 0, async function (done) { + var name = 122.00; + try { + var uri = settings.getUriSync(name); + console.info("[settings_uri_test_003] uri is: " + uri); + } catch (err) { + let errMsg = err; + console.error("[settings_uri_test_003] error = " + errMsg); + expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") + .assertTrue(); + } + done(); + }); + + it('settings_uri_test_004', 0, async function (done) { + var name = 'settings.screen.brightness'; + var uri = settings.getUriSync(name); + console.info("[settings_uri_test_004] uri is: " + uri); + expect(uri).assertEqual('dataability:///com.ohos.settingsdata.DataAbility/settings.screen.brightness') + done(); + }); + + it('settings_get_value_005', 0, async function (done) { + var name = 'settings.screen.brightness20'; + var uri = settings.getUriSync(name); + var helper = featureAbility.acquireDataAbilityHelper(uri); + let value = settings.getValueSync(helper, name, "test getValueSync"); + console.info("[settings_get_value_005] value is: " + value); + expect(value).assertEqual("test getValueSync"); + done(); + }); + + it('settings_get_value_006', 0, async function (done) { + var name = 'settings.screen.brightness2'; + var uri = settings.getUriSync(name); + console.info("[settings_get_value_006] uri is: " + uri); + var helper = featureAbility.acquireDataAbilityHelper(uri); + let obj = { + aa: "aa" + } + try { + let value = settings.getValueSync(helper, name, obj); + console.info("[settings_get_value_006] value is: " + value); + expect(value).assertEqual("test getValueSync"); + } catch (err) { + console.error("[settings_get_value_006] error = " + err); + expect(err == "Error: assertion (valueType == napi_string) failed: Wrong argument[2] type. String expected.") + .assertTrue(); + } + done(); + }); + + it('settings_get_value_007', 0, async function (done) { + var name = 'settings.screen.brightness3'; + var uri = settings.getUriSync(name); + console.info("[settings_get_value_007] uri is: " + uri); + var helper = featureAbility.acquireDataAbilityHelper(uri); + let obj = ''; + try { + let value = settings.getValueSync(helper, name, obj); + console.info("[settings_get_value_007] value is: " + value); + expect(value).assertEqual(''); + } catch (err) { + console.error("[settings_get_value_007] error = " + err); + expect(err == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") + .assertTrue(); + } + done(); + }); + + it('settings_get_value_008', 0, async function (done) { + var name = 'settings.screen.brightness4'; + var uri = settings.getUriSync(name); + console.info("[settings_get_value_008] uri is: " + uri); + var helper = featureAbility.acquireDataAbilityHelper(uri); + let obj = null; + try { + let value = settings.getValueSync(helper, name, obj); + console.info("[settings_get_value_008] value is: " + value); + } catch (err) { + console.error("[settings_get_value_008] error = " + err); + expect(err == "Error: assertion (valueType == napi_string) failed: Wrong argument[2] type. String expected.") + .assertTrue(); + } + done(); + }); + + it('settings_get_value_009', 0, async function (done) { + var name = 'settings.screen.brightness5'; + var uri = settings.getUriSync(name); + console.info("[settings_get_value_009] uri is: " + uri); + var helper = "helper"; + try { + let value = settings.getValueSync(helper, name, "test getValueSync"); + console.info("[settings_get_value_009] value is: " + value); + } catch (err) { + console.error("[settings_get_value_009] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_get_value_010', 0, async function (done) { + var name = 'settings.screen.brightness6'; + var uri = settings.getUriSync(name); + console.info("[settings_get_value_010] uri is: " + uri); + var helper = null; + try { + let value = settings.getValueSync(helper, name, "test getValueSync"); + console.info("[settings_get_value_010] value is: " + value); + } catch (err) { + console.error("[settings_get_value_010] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_get_value_0011', 0, async function (done) { + var name = 'settings.screen.brightness7'; + var uri = settings.getUriSync(name); + console.info("[settings_get_value_0011] uri is: " + uri); + var helper = "helper"; + let obj = 121; + try { + let value = settings.getValueSync(helper, name, obj); + console.info("[settings_get_value_0011] value is: " + value); + } catch (err) { + console.error("[settings_get_value_0011] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_get_value_0012', 0, async function (done) { + var name = 'settings.screen.brightness8'; + var uri = settings.getUriSync(name); + console.info("[settings_get_value_0012] uri is: " + uri); + var helper = null; + let obj = null; + try { + let value = settings.getValueSync(helper, name, obj); + console.info("[settings_get_value_0012] value is: " + value); + } catch (err) { + console.error("[settings_get_value_0012] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_get_value_013', 0, async function (done) { + var name = 1322.00; + try { + var uri = settings.getUriSync(name); + console.info("[settings_get_value_013] uri is: " + uri); + } catch (err) { + let errMsg = err; + console.error("[settings_get_value_013] error = " + errMsg); + expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") + .assertTrue(); + } + var helper = featureAbility.acquireDataAbilityHelper(uri); + try { + let value = settings.getValueSync(helper, name, "test getValueSync"); + console.info("[settings_get_value_013] value is: " + value); + } catch (err) { + console.error("[settings_get_value_013] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_get_value_014', 0, async function (done) { + let name = null; + try { + var uri = settings.getUriSync(name); + console.info("[settings_get_value_014] uri is: " + uri); + } catch (err) { + let errMsg = err; + console.error("[settings_get_value_014] error = " + errMsg); + expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") + .assertTrue(); + } + var helper = featureAbility.acquireDataAbilityHelper(uri); + try { + let value = settings.getValueSync(helper, name, "test getValueSync"); + console.info("[settings_get_value_014] value is: " + value); + } catch (err) { + console.error("[settings_get_value_014] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_get_value_0015', 0, async function (done) { + let name = 1332; + try { + var uri = settings.getUriSync(name); + console.info("[settings_get_value_0015] uri is: " + uri); + } catch (err) { + let errMsg = err; + console.error("[settings_get_value_0015] error = " + errMsg); + expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") + .assertTrue(); + } + var helper = featureAbility.acquireDataAbilityHelper(uri); + let obj = 22223; + try { + let value = settings.getValueSync(helper, name, obj); + console.info("[settings_get_value_0015] value is: " + value); + } catch (err) { + console.error("[settings_get_value_0015] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_get_value_0016', 0, async function (done) { + let name = 1332; + try { + var uri = settings.getUriSync(name); + console.info("[settings_get_value_0016] uri is: " + uri); + } catch (err) { + let errMsg = err; + console.error("[settings_get_value_0016] error = " + errMsg); + expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") + .assertTrue(); + } + var helper = "helper"; + try { + let value = settings.getValueSync(helper, name, "test getValueSync"); + console.info("[settings_get_value_0016] value is: " + value); + } catch (err) { + console.error("[settings_get_value_0016] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_get_value_0017', 0, async function (done) { + let name = 1332; + try { + var uri = settings.getUriSync(name); + console.info("[settings_get_value_0017] uri is: " + uri); + } catch (err) { + let errMsg = err; + console.error("[settings_get_value_0017] error = " + errMsg); + expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") + .assertTrue(); + } + var helper = "helper"; + let obj = 221323; + try { + let value = settings.getValueSync(helper, name, obj); + console.info("[settings_get_value_0017] value is: " + value); + } catch (err) { + console.error("[settings_get_value_0017] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_set_value_018', 0, async function (done) { + let name = 'settings.screen.brightness10'; + var uri = settings.getUriSync(name); + var helper = featureAbility.acquireDataAbilityHelper(uri); + let value = settings.setValueSync(helper, name, "test getValueSync"); + expect(value).assertEqual(true); + done(); + }); + + it('settings_set_value_019', 0, async function (done) { + let name = 'settings.screen.brightness11'; + var uri = settings.getUriSync(name); + var helper = featureAbility.acquireDataAbilityHelper(uri); + let obj = 32344.00; + try { + let value = settings.setValueSync(helper, name, obj); + console.info("[settings_set_value_019] value is: " + value); + expect(value).assertEqual(true); + } catch (err) { + console.error("[settings_set_value_019] error = " + err); + expect(err == "Error: assertion (valueType == napi_string) failed: Wrong argument[2] type. String expected.") + .assertTrue(); + } + done(); + }); + + it('settings_set_value_020', 0, async function (done) { + let name = 'settings.screen.brightness12'; + var uri = settings.getUriSync(name); + var helper = featureAbility.acquireDataAbilityHelper(uri); + let obj = null; + try { + let value = settings.setValueSync(helper, name, obj); + console.info("[settings_set_value_020] value is: " + value); + expect(value).assertEqual(true); + } catch (err) { + console.error("[settings_set_value_020] error = " + err); + expect(err == "Error: assertion (valueType == napi_string) failed: Wrong argument[2] type. String expected.") + .assertTrue(); + } + done(); + }); + + it('settings_set_value_021', 0, async function (done) { + let name = 'settings.screen.brightness13'; + var helper = "helper"; + try { + let value = settings.setValueSync(helper, name, "test getValueSync"); + expect(value).assertEqual(true); + } catch (err) { + console.error("[settings_set_value_021] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_set_value_022', 0, async function (done) { + let name = 'settings.screen.brightness13'; + var helper = null; + try { + let value = settings.setValueSync(helper, name, "test getValueSync"); + expect(value).assertEqual(true); + } catch (err) { + console.error("[settings_set_value_022] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_set_value_023', 0, async function (done) { + let name = 'settings.screen.brightness14'; + var helper = "helper"; + let obj = 343434.00; + try { + let value = settings.setValueSync(helper, name, obj); + expect(value).assertEqual(true); + } catch (err) { + console.error("[settings_set_value_023] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_set_value_024', 0, async function (done) { + let name = 'settings.screen.brightness14'; + var helper = "helper"; + let obj = null; + try { + let value = settings.setValueSync(helper, name, obj); + expect(value).assertEqual(true); + } catch (err) { + console.error("[settings_set_value_024] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_set_value_025', 0, async function (done) { + let name = 'settings.screen.brightness14'; + var helper = null; + let obj = 2323.00; + try { + let value = settings.setValueSync(helper, name, obj); + expect(value).assertEqual(true); + } catch (err) { + console.error("[settings_set_value_025] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_set_value_026', 0, async function (done) { + let name = 1332; + try { + var uri = settings.getUriSync(name); + console.info("[settings_set_value_026] uri is: " + uri); + } catch (err) { + let errMsg = err; + console.error("[settings_set_value_026] error = " + errMsg); + expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") + .assertTrue(); + } + var helper = featureAbility.acquireDataAbilityHelper(uri); + try { + let value = settings.setValueSync(helper, name, "test getValueSync"); + expect(value).assertEqual(true); + } catch (err) { + console.error("[settings_set_value_026] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_set_value_027', 0, async function (done) { + let name = null; + try { + var uri = settings.getUriSync(name); + console.info("[settings_set_value_027] uri is: " + uri); + } catch (err) { + let errMsg = err; + console.error("[settings_set_value_027] error = " + errMsg); + expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") + .assertTrue(); + } + var helper = featureAbility.acquireDataAbilityHelper(uri); + try { + let value = settings.setValueSync(helper, name, "test getValueSync"); + expect(value).assertEqual(true); + } catch (err) { + console.error("[settings_set_value_027] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_set_value_028', 0, async function (done) { + let name = 2323; + try { + var uri = settings.getUriSync(name); + console.info("[settings_set_value_028] uri is: " + uri); + } catch (err) { + let errMsg = err; + console.error("[settings_set_value_028] error = " + errMsg); + expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") + .assertTrue(); + } + var helper = featureAbility.acquireDataAbilityHelper(uri); + let obj = 232.00; + try { + let value = settings.setValueSync(helper, name, obj); + expect(value).assertEqual(true); + } catch (err) { + console.error("[settings_set_value_028] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_set_value_029', 0, async function (done) { + let name = 2323; + try { + var uri = settings.getUriSync(name); + console.info("[settings_set_value_029] uri is: " + uri); + } catch (err) { + let errMsg = err; + console.error("[settings_set_value_029] error = " + errMsg); + expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") + .assertTrue(); + } + var helper = featureAbility.acquireDataAbilityHelper(uri); + let obj = null; + try { + let value = settings.setValueSync(helper, name, obj); + expect(value).assertEqual(true); + } catch (err) { + console.error("[settings_set_value_029] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_set_value_030', 0, async function (done) { + let name = 2323; + try { + var uri = settings.getUriSync(name); + console.info("[settings_set_value_030] uri is: " + uri); + } catch (err) { + let errMsg = err; + console.error("[settings_set_value_030] error = " + errMsg); + expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") + .assertTrue(); + } + var helper = "helper"; + try { + let value = settings.setValueSync(helper, name, "text value"); + expect(value).assertEqual(true); + } catch (err) { + console.error("[settings_set_value_030] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_set_value_031', 0, async function (done) { + let name = 2323; + try { + var uri = settings.getUriSync(name); + console.info("[settings_set_value_031] uri is: " + uri); + } catch (err) { + let errMsg = err; + console.error("[settings_set_value_031] error = " + errMsg); + expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") + .assertTrue(); + } + var helper = null; + try { + let value = settings.setValueSync(helper, name, "text value"); + expect(value).assertEqual(true); + } catch (err) { + console.error("[settings_set_value_031] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_set_value_032', 0, async function (done) { + let name = 2323; + try { + var uri = settings.getUriSync(name); + console.info("[settings_set_value_032] uri is: " + uri); + } catch (err) { + let errMsg = err; + console.error("[settings_set_value_032] error = " + errMsg); + expect(errMsg == "Error: assertion (valueType == napi_string) failed: Wrong argument type. String expected.") + .assertTrue(); + } + var helper = "helper"; + let obj = 2323; + try { + let value = settings.setValueSync(helper, name, obj); + expect(value).assertEqual(true); + } catch (err) { + console.error("[settings_set_value_032] error = " + err); + expect(err == "Error: assertion (valueType == napi_object) failed: Wrong argument[0] type. Object expected.") + .assertTrue(); + } + done(); + }); + + it('settings_get_value_033', 0, async function (done){ + let uri = 'dataability:///com.ohos.settingsdata.DataAbility'; + let helper = featureAbility.acquireDataAbilityHelper(uri); + + let name = 'settings.screen.brightness33'; + let value = 'brightness33' + try{ + settings.setValueSync(helper, name, value); + settings.getValue(helper, name, ret =>{ + console.info("[settings_get_value_033] value is: " + ret); + expect(ret).assertEqual(value); + done(); + }) + } catch(err){ + console.info("[settings_get_value_033] error is: " + toString(error)); + expect(true).assertTrue(); + done(); + return; + } + }); + + it('settings_get_value_034', 0, async function (done){ + let uri = 'dataability:///com.ohos.settingsdata.DataAbility'; + let helper = featureAbility.acquireDataAbilityHelper(uri); + + let name = 'settings.screen.brightness34'; + let value = 'brightness34' + + try{ + settings.setValueSync(helper, name, value); + settings.getValue(helper, name).then(ret =>{ + console.info("[settings_get_value_034] value is: " + ret); + expect(ret).assertEqual(value); + done(); + }) + } catch(err){ + console.info("[settings_get_value_034] error is: " + toString(error)); + expect(true).assertTrue(); + done(); + return; + } + }); + + it('settings_get_value_035', 0, async function (done){ + var name = 'settings.screen.brightness35'; + let uriPrefix = 'dataability:///com.ohos.settingsdata.DataAbility' + let expectValue = uriPrefix + '/' + name; + try{ + settings.getURI(name).then(data => { + console.info("[settings_get_uri_035] uri is: " + data); + expect(data).assertEqual(expectValue); + done(); + }) + } catch(err){ + console.info("[settings_get_uri_035] error is: " + toString(error)); + expect(true).assertTrue(); + done(); + return; + } + }); + + it('settings_get_value_036', 0, async function (done){ + var name = 'settings.screen.brightness36'; + let uriPrefix = 'dataability:///com.ohos.settingsdata.DataAbility' + let expectValue = uriPrefix + '/' + name; + try{ + settings.getURI(name, (data) =>{ + console.info("[settings_get_uri_036] uri is: " + data); + expect(data).assertEqual(expectValue); + done(); + }) + }catch(err){ + console.info("[settings_get_uri_036] error is: " + toString(error)); + expect(true).assertTrue(); + done(); + return; + } + }); + + it('settings_get_value_037',0,async function (done) { + var str ="settings.date.date_format" + expect(str).assertEqual(settings.date.DATE_FORMAT); + done(); + }); + + it('settings_get_value_038',0,async function (done) { + var str ="settings.date.time_format" + expect(str).assertEqual(settings.date.TIME_FORMAT); + done(); + }); + + it('settings_get_value_039',0,async function (done) { + var str ="settings.date.auto_gain_time" + expect(str).assertEqual(settings.date.AUTO_GAIN_TIME); + done(); + }); + + it('settings_get_value_040',0,async function (done) { + var str ="settings.date.auto_gain_time_zone" + expect(str).assertEqual(settings.date.AUTO_GAIN_TIME_ZONE); + done(); + }); + + it('settings_get_value_041',0,async function (done) { + var str ="settings.display.font_scale" + expect(str).assertEqual(settings.display.FONT_SCALE); + done(); + }); + + it('settings_get_value_042',0,async function (done) { + var str ="settings.display.screen_brightness_status" + expect(str).assertEqual(settings.display.SCREEN_BRIGHTNESS_STATUS); + done(); + }); + + it('settings_get_value_043',0,async function (done) { + var str ="settings.display.auto_screen_brightness" + expect(str).assertEqual(settings.display.AUTO_SCREEN_BRIGHTNESS); + done(); + }); + + it('settings_get_value_044',0,async function (done) { + var int = 1 + expect(int).assertEqual(settings.display.AUTO_SCREEN_BRIGHTNESS_MODE); + done(); + }); + + it('settings_get_value_045',0,async function (done) { + var int = 0 + expect(int).assertEqual(settings.display.MANUAL_SCREEN_BRIGHTNESS_MODE); + done(); + }); + + it('settings_get_value_046',0,async function (done) { + var str ="settings.display.screen_off_timeout" + expect(str).assertEqual(settings.display.SCREEN_OFF_TIMEOUT); + done(); + }); + + it('settings_get_value_047',0,async function (done) { + var str ="settings.display.default_screen_rotation" + expect(str).assertEqual(settings.display.DEFAULT_SCREEN_ROTATION); + done(); + }); + + it('settings_get_value_048',0,async function (done) { + var str ="settings.display.animator_duration_scale" + expect(str).assertEqual(settings.display.ANIMATOR_DURATION_SCALE); + done(); + }); + + it('settings_get_value_049',0,async function (done) { + var str ="settings.display.transition_animation_scale" + expect(str).assertEqual(settings.display.TRANSITION_ANIMATION_SCALE); + done(); + }); + + it('settings_get_value_050',0,async function (done) { + var str ="settings.display.window_animation_scale" + expect(str).assertEqual(settings.display.WINDOW_ANIMATION_SCALE); + done(); + }); + + it('settings_get_value_051',0,async function (done) { + var str = "settings.display.display_inversion_status" + expect(str).assertEqual(settings.display.DISPLAY_INVERSION_STATUS); + done(); + }); + + it('settings_get_value_052',0,async function (done) { + var str = "settings.general.setup_wizard_finished" + expect(str).assertEqual(settings.general.SETUP_WIZARD_FINISHED); + done(); + }); + + it('settings_get_value_053',0,async function (done) { + var str = "settings.general.end_button_action" + expect(str).assertEqual(settings.general.END_BUTTON_ACTION); + done(); + }); + + it('settings_get_value_054',0,async function (done) { + var str = "settings.general.airplane_mode_status" + expect(str).assertEqual(settings.general.AIRPLANE_MODE_STATUS); + done(); + }); + + it('settings_get_value_055',0,async function (done) { + var str = "settings.general.accelerometer_rotation_status" + expect(str).assertEqual(settings.general.ACCELEROMETER_ROTATION_STATUS); + done(); + }); + + it('settings_get_value_056',0,async function (done) { + var str = "settings.general.device_provision_status" + expect(str).assertEqual(settings.general.DEVICE_PROVISION_STATUS); + done(); + }); + + it('settings_get_value_057',0,async function (done) { + var str = "settings.general.hdc_status" + expect(str).assertEqual(settings.general.HDC_STATUS); + done(); + }); + + + + it('settings_get_value_058',0,async function (done) { + var str = "settings.general.boot_counting" + expect(str).assertEqual(settings.general.BOOT_COUNTING); + done(); + }); + + it('settings_get_value_059',0,async function (done) { + var str = "settings.general.contact_metadata_sync_status" + expect(str).assertEqual(settings.general.CONTACT_METADATA_SYNC_STATUS); + done(); + }); + + it('settings_get_value_060',0,async function (done) { + var str = "settings.general.development_settings_status" + expect(str).assertEqual(settings.general.DEVELOPMENT_SETTINGS_STATUS); + done(); + }); + + it('settings_get_value_061',0,async function (done) { + var str = "settings.general.device_name" + expect(str).assertEqual(settings.general.DEVICE_NAME); + done(); + }); + + it('settings_get_value_062',0,async function (done) { + var str = "settings.general.usb_storage_status" + expect(str).assertEqual(settings.general.USB_STORAGE_STATUS); + done(); + }); + + it('settings_get_value_063',0,async function (done) { + var str = "settings.general.debugger_waiting" + expect(str).assertEqual(settings.general.DEBUGGER_WAITING); + done(); + }); + + it('settings_get_value_064',0,async function (done) { + var str = "settings.general.debug_app_package" + expect(str).assertEqual(settings.general.DEBUG_APP_PACKAGE); + done(); + }); + + it('settings_get_value_065',0,async function (done) { + var str = "settings.general.accessibility_status" + expect(str).assertEqual(settings.general.ACCESSIBILITY_STATUS); + done(); + }); + + it('settings_get_value_066',0,async function (done) { + var str = "settings.general.activated_accessibility_services" + expect(str).assertEqual(settings.general.ACTIVATED_ACCESSIBILITY_SERVICES); + done(); + }); + + it('settings_get_value_067',0,async function (done) { + var str = "settings.general.geolocation_origins_allowed" + expect(str).assertEqual(settings.general.GEOLOCATION_ORIGINS_ALLOWED); + done(); + }); + + it('settings_get_value_068',0,async function (done) { + var str = "settings.general.skip_use_hints" + expect(str).assertEqual(settings.general.SKIP_USE_HINTS); + done(); + }); + + it('settings_get_value_069',0,async function (done) { + var str = "settings.general.touch_exploration_status" + expect(str).assertEqual(settings.general.TOUCH_EXPLORATION_STATUS); + done(); + }); + + it('settings_get_value_070',0,async function (done) { + var str = "settings.input.default_input_method" + expect(str).assertEqual(settings.input.DEFAULT_INPUT_METHOD); + done(); + }); + + it('settings_get_value_071',0,async function (done){ + var str = "settings.input.activated_input_method_submode" + let expectValue:string=settings.input.ACTIVATED_INPUT_METHOD_SUB_MODE; + expect(str).assertEqual(expectValue); + done(); + }); + + + it('settings_get_value_072',0,async function (done){ + var str = "settings.input.activated_input_methods" + expect(str).assertEqual(settings.input.ACTIVATED_INPUT_METHODS); + done(); + }); + + + it('settings_get_value_073',0,async function (done){ + var str = "settings.input.selector_visibility_for_input_method" + expect(str).assertEqual(settings.input.SELECTOR_VISIBILITY_FOR_INPUT_METHOD); + done(); + }); + + + it('settings_get_value_074',0,async function (done){ + var str = "settings.input.auto_caps_text_input" + expect(str).assertEqual(settings.input.AUTO_CAPS_TEXT_INPUT); + done(); + }); + + + it('settings_get_value_075',0,async function (done){ + var str = "settings.input.auto_punctuate_text_input" + expect(str).assertEqual(settings.input.AUTO_PUNCTUATE_TEXT_INPUT); + done(); + }); + + + it('settings_get_value_076',0,async function (done){ + var str = "settings.input.auto_replace_text_input" + expect(str).assertEqual(settings.input.AUTO_REPLACE_TEXT_INPUT); + done(); + }); + + + it('settings_get_value_077',0,async function (done){ + var str = "settings.input.show_password_text_input" + expect(str).assertEqual(settings.input.SHOW_PASSWORD_TEXT_INPUT); + done(); + }); + + + it('settings_get_value_078',0,async function (done){ + var str = "settings.network.data_roaming_status" + expect(str).assertEqual(settings.network.DATA_ROAMING_STATUS); + done(); + }); + + + it('settings_get_value_079',0,async function (done){ + var str = "settings.network.http_proxy_cfg" + expect(str).assertEqual(settings.network.HTTP_PROXY_CFG); + done(); + }); + + + it('settings_get_value_080',0,async function (done){ + var str = "settings.network.network_preference_usage" + expect(str).assertEqual(settings.network.NETWORK_PREFERENCE_USAGE); + done(); + }); + + + it('settings_get_value_081',0,async function (done){ + var str = "settings.phone.rtt_calling_status" + expect(str).assertEqual(settings.phone.RTT_CALLING_STATUS); + done(); + }); + + + it('settings_get_value_082',0,async function (done){ + var str = "settings.sound.vibrate_while_ringing" + expect(str).assertEqual(settings.sound.VIBRATE_WHILE_RINGING); + done(); + }); + + + it('settings_get_value_083',0,async function (done){ + var str = "settings.sound.default_alarm_alert" + expect(str).assertEqual(settings.sound.DEFAULT_ALARM_ALERT); + done(); + }); + + + it('settings_get_value_084',0,async function (done){ + var str = "settings.sound.dtmf_tone_type_while_dialing" + expect(str).assertEqual(settings.sound.DTMF_TONE_TYPE_WHILE_DIALING); + done(); + }); + + + it('settings_get_value_085',0,async function (done){ + var str = "settings.sound.dtmf_tone_while_dialing" + expect(str).assertEqual(settings.sound.DTMF_TONE_WHILE_DIALING); + done(); + }); + + + it('settings_get_value_086',0,async function (done){ + var str = "settings.sound.haptic_feedback_status" + expect(str).assertEqual(settings.sound.HAPTIC_FEEDBACK_STATUS); + done(); + }); + + + it('settings_get_value_087',0,async function (done){ + var str = "settings.sound.affected_mode_ringer_streams" + expect(str).assertEqual(settings.sound.AFFECTED_MODE_RINGER_STREAMS); + done(); + }); + + + it('settings_get_value_088',0,async function (done){ + var str = "settings.sound.affected_mute_streams" + expect(str).assertEqual(settings.sound.AFFECTED_MUTE_STREAMS); + done(); + }); + + + it('settings_get_value_089',0,async function (done){ + var str = "settings.sound.default_notification_sound" + expect(str).assertEqual(settings.sound.DEFAULT_NOTIFICATION_SOUND); + done(); + }); + + + it('settings_get_value_090',0,async function (done){ + var str = "settings.sound.default_ringtone" + expect(str).assertEqual(settings.sound.DEFAULT_RINGTONE); + done(); + }); + + it('settings_get_value_091',0,async function (done) { + var str ="settings.sound.sound_effects_status" + expect(str).assertEqual(settings.sound.SOUND_EFFECTS_STATUS); + done(); + }); + + it('settings_get_value_092',0,async function (done) { + var str ="settings.sound.vibrate_status" + expect(str).assertEqual(settings.sound.VIBRATE_STATUS); + done(); + }); + + it('settings_get_value_093',0,async function (done) { + var str ="settings.tts.default_tts_pitch" + expect(str).assertEqual(settings.tts.DEFAULT_TTS_PITCH); + done(); + }); + + it('settings_get_value_094',0,async function (done) { + var str ="settings.tts.default_tts_rate" + expect(str).assertEqual(settings.tts.DEFAULT_TTS_RATE); + done(); + }); + + it('settings_get_value_095',0,async function (done) { + var str ="settings.tts.default_tts_synth" + expect(str).assertEqual(settings.tts.DEFAULT_TTS_SYNTH); + done(); + }); + + it('settings_get_value_096',0,async function (done) { + var str ="settings.tts.enabled_tts_plugins" + expect(str).assertEqual(settings.tts.ENABLED_TTS_PLUGINS); + done(); + }); + + it('settings_get_value_097',0,async function (done) { + var str ="settings.wireless.bluetooth_radio" + expect(str).assertEqual(settings.wireless.BLUETOOTH_RADIO); + done(); + }); + + it('settings_get_value_098',0,async function (done) { + var str ="settings.wireless.cell_radio" + expect(str).assertEqual(settings.wireless.CELL_RADIO); + done(); + }); + + it('settings_get_value_099',0,async function (done) { + var str ="settings.wireless.nfc_radio" + expect(str).assertEqual(settings.wireless.NFC_RADIO); + done(); + }); + + it('settings_get_value_100',0,async function (done) { + var str ="settings.wireless.airplane_mode_radios" + expect(str).assertEqual(settings.wireless.AIRPLANE_MODE_RADIOS); + done(); + }); + + it('settings_get_value_101',0,async function (done) { + var str ="settings.wireless.bluetooth_status" + expect(str).assertEqual(settings.wireless.BLUETOOTH_STATUS); + done(); + }); + + it('settings_get_value_102',0,async function (done) { + var str ="settings.wireless.bluetooth_discoverability_status" + expect(str).assertEqual(settings.wireless.BLUETOOTH_DISCOVER_ABILITY_STATUS); + done(); + }); + + it('settings_get_value_103',0,async function (done) { + var str ="settings.wireless.bluetooth_discover_timeout" + expect(str).assertEqual(settings.wireless.BLUETOOTH_DISCOVER_TIMEOUT); + done(); + }); + + it('settings_get_value_104',0,async function (done) { + var str ="settings.wireless.wifi_dhcp_max_retry_count" + expect(str).assertEqual(settings.wireless.WIFI_DHCP_MAX_RETRY_COUNT); + done(); + }); + + it('settings_get_value_105',0,async function (done) { + var str ="settings.wireless.wifi_to_mobile_data_awake_timeout" + expect(str).assertEqual(settings.wireless.WIFI_TO_MOBILE_DATA_AWAKE_TIMEOUT); + done(); + }); + + it('settings_get_value_106',0,async function (done) { + var str ="settings.wireless.wifi_status" + expect(str).assertEqual(settings.wireless.WIFI_STATUS); + done(); + }); + + it('settings_get_value_107',0,async function (done) { + var str ="settings.wireless.wifi_watchdog_status" + expect(str).assertEqual(settings.wireless.WIFI_WATCHDOG_STATUS); + done(); + }); + + it('settings_get_value_108',0,async function (done) { + var str ="settings.wireless.wifi_radio" + expect(str).assertEqual(settings.wireless.WIFI_RADIO); + done(); + }); + + it('settings_get_value_109',0,async function (done) { + var str ="settings.wireless.owner_lockdown_wifi_cfg" + expect(str).assertEqual(settings.wireless.OWNER_LOCKDOWN_WIFI_CFG); + done(); + }); + + it('settings_get_value_110',0,async function (done) { + var str ="settings.wireless.owner_lockdown_wifi_cfg" + expect(str).assertEqual(settings.wireless.OWNER_LOCKDOWN_WIFI_CFG); + done(); + }); + + it('settings_get_value_111',0,async function (done) { + let uri = 'dataability:///com.ohos.settingsdata.DataAbility'; + let helper = featureAbility.acquireDataAbilityHelper(uri); + let name = 'settings.screen.brightness111';//关键字 + let value = 'brightness111'//值 + try{ + settings.setValue(helper, name, value,(data)=>{ + console.info("[settings_get_value_111] value is:" + data); + settings.getValue(helper, name).then(ret => { + console.info("[settings_get_value_111] value is:" + ret); + expect(ret).assertEqual(value); + done(); + }) + }); + }catch(err){ + console.info("[settings_get_value_111] error is:" + toString(error)); + expect(true).assertTrue(); + done(); + return; + } + }); + + it('settings_get_value_112',0,async function (done) { + let uri = 'dataability:///com.ohos.settingsdata.DataAbility'; + let helper = featureAbility.acquireDataAbilityHelper(uri); + let name = 'settings.screen.brightness112';//关键字 + let value = 'brightness112'//值 + try{ + settings.setValue(helper, name, value) + .then((data)=>{ + console.info("[settings_get_value_112] value is:" + data); + settings.getValue(helper, name).then(ret => { + console.info("[settings_get_value_112] value is:" + ret); + expect(ret).assertEqual(value); + done(); + }) + }) + .catch((err)=>{ + console.info("[settings_get_value_112] error is:" + toString(error)); + expect(true).assertTrue(); + done(); + return; + }) + }catch(err){ + console.info("[settings_get_value_112] error is:" + toString(error)); + expect(true).assertTrue(); + done(); + return; + } + }); + }) +} diff --git a/settingsdata/settings_ets/entry/src/main/resources/base/element/string.json b/applications/settingsdata/settings_ets/entry/src/main/resources/base/element/string.json similarity index 94% rename from settingsdata/settings_ets/entry/src/main/resources/base/element/string.json rename to applications/settingsdata/settings_ets/entry/src/main/resources/base/element/string.json index 281be4665..498677efb 100644 --- a/settingsdata/settings_ets/entry/src/main/resources/base/element/string.json +++ b/applications/settingsdata/settings_ets/entry/src/main/resources/base/element/string.json @@ -1,20 +1,20 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "description_mainability", - "value": "ETS_Empty Ability" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] +{ + "string": [ + { + "name": "entry_MainAbility", + "value": "entry_MainAbility" + }, + { + "name": "description_mainability", + "value": "ETS_Empty Ability" + }, + { + "name": "TestAbility_desc", + "value": "description" + }, + { + "name": "TestAbility_label", + "value": "label" + } + ] } \ No newline at end of file diff --git a/settingsdata/settings_ets/entry/src/main/resources/base/media/icon.png b/applications/settingsdata/settings_ets/entry/src/main/resources/base/media/icon.png similarity index 100% rename from settingsdata/settings_ets/entry/src/main/resources/base/media/icon.png rename to applications/settingsdata/settings_ets/entry/src/main/resources/base/media/icon.png diff --git a/applications/settingsdata/settings_ets/signature/openharmony_sx.p7b b/applications/settingsdata/settings_ets/signature/openharmony_sx.p7b new file mode 100644 index 0000000000000000000000000000000000000000..5111110cf2b932e65f2e898499e8a6f1fd81c93a GIT binary patch literal 3534 zcmcgvZFCb=8g4#XtTj+AQs{y$L1|Y=dnZjwQe|N#nIw~Tl1`emNeR|TGWlqyGt*?! zNrOl?9J_WA)K!5M(DG5xBj1ZumR)h(qo^P(3$m+j@q?|ptVebM1+DJxOxuN)qd)fS zIpjy?yzhPHzR%qIyw5!sWK?hE%Od#O_29yR0lyu)i0OHAQi~V$-TeZCZiNe zxeR2olh=T<-b{8_naK_;QFl=BM2uxLK{iCGtD(796AalVCe%SQt&5<@-E z&I=fgltv#G|8!OQkjAJ71`TPX092_9hbhP)qWMlvdO1$f6q%sJ1j%ulP%Od6V}T?u z)f+{yiRKu?Q;|3+Wkp~INykDlzEfSjM9r|gCP0PRxWr6v)ETPuTD@WJaGnhFR9s9~ z8H~Dlm1277Ty-GHglI|=W5TTTdWh+COAMvU;#tm2!@hQQ$^Yg<47dZ9&K%L z))9mm7CbO+#Z#seanZg;kg74mZ6g@m?PqM@ zIuvRVg4Pu0(^>#2t_5bX(*f~&gIbT!=!V@$BsjXd7$U8-pBY(e96C$i1!-IAkPvES6BZZN1X13$l+%~4xB3~ofQJ*dsK;XjsDZ|S z+v{s$9BmOCO0XTt07bOJZWh7>j~Nb2%x(2JYBj@+5yTyc#)C0GW8poutS4DnS>G@( z8AdH(660NI*g1?Q3VGjwxruN#T zk#%?)A|wtAR+FjST950D;@f6~fXyTf3rz%;g6%vB>If~TGh@jLF5zct@ldVF93k`` z8$<&{S7(hPG#&}XwCS*cX*DJ|GK~^g1@JlqF3cMU7!z#uNm$!R(G9T**3YD2+5!w_ zCSZ>{oxGDF+Vz6XSx1|Fh|bA-(oUaUoF>Tfag?#A>}hKvTH$AgTLN{Mzo$*a4jb*p zQ6CAiZRKJwGUd^c7A#LtJRf5s2@y$hwAglu&IC`jH3!H4enfBu%pd71E5vi`1+LEf<@ z3T`gQ8)I6~G*BpI^9u6EWJ}x>*#^x5Go>L#LDASDnB!>4)Wl^dF~Q)DLX{Q*TA+or zkg*bKDpcu=khT&U4MFt(BvA%tkB}(-Arh{U^8oljLC%EX&zH+a*Fhnhpg^*e@8AF7 zW5`nnmcBc6`WfRP^m10moH)GMH(|^DW`%dU6bGM?pIHFCvRg-|G-^K4*WBF=_ZX8Oq2kV zWU_xNl?wTUE-*uiCn~2XCl9sn{ETYPuiL$bYkzvh!S_^zw`lxcDWX|`l0#YRn*MO9 zYFpPE2fv}`9L7<9#|*`Gv;)? z8|iDP`0Qvddh(S|>8FoXpWKG*EcaLSG#&+rOu@^tMFN8_Pu5m_^yV zIVzh;9~oARr*b29jAi-jwWEU!W3?lNH;_pO$iJqY>^VPGW~mi{EG1qw(D`_)YWe!} zD*NmIDr3J0!fiE64rub$cl`F8&v#Q(9Nx*0tPfq;Grgr31}F?ya{> z90)%A=%1~(ZhlC0=B2((L(R7j%`RRMA1L|p3?kvf9-KG9`j5>BSO_LbIw_EJlMNK& zW4w@LIb(!WSe?J|g=r5AW;wT?SX;VxZIdwZ?eV*(h-86~90*N9DfISb;kloz*>Kvs z@6ny5TW?-@{Faxh58Uxk*WLQGzi;Do%`>N7W0kXFzEXaj9NhWBoj+q2Z=W^6HF?X* zOTCW(`+`pM*GY7c+tRUN{Uxxb-T8Ru>1~Cl=4?G?o!Xr(>WCC|G&riGJE&LYk7sfN zcWdiLT;ez|Gqb2(q_ zIA2e#H>KuU+yz3|0REZ+3qXV z(dOq5S3Ps~<^02^3(hVL=Q{^&o)3DurbYX)3#ZQY-~PvQr*9SQ?e&{j;rZ(LMpyrA z&CrY9?XRs~o&PF*&%l(-^zR-%<5(FVTt%MceEiDDTe@fOd9NJG$QFtsyH~t=fYuwb zjiU$Y*jr9-3{1Ux%gI$h;@E%hMlvw{YLJ@^O%l&SEih`UAUy>1x+YL@ZBz-Vl_j61 zk1rtae5z*0ip|Jl-)-tCgA}trccxxlcBlr4bQko1o39?=a-{{B$o$WH*5sWI@Bd^{cuyGj$xDiAJ~?*u=)kwBIlnl5bb$g8MY4FF(5FQyMT=#m||qU)nQ9cId-MBB-<-lvSdq&snM}IENNF>t+bK| zgowuF2vC|SxSZxNN5eHhV%(WPpbeB9Fc3;JDMtzMBv1-XAc2N~c2_tCXW&OCGw6qQ z-s9VS-tT?h=bI0tMS+~WDXqHJyCPmLzdbE-fV8Nd&*MRZfG8(#POFZG3xs@Lb{0ry z=R8j3wWo!5g=yjKx#BoZMFS)uA)H}cTp@-^K`9VV?RC3J59@}eik*>n|pRKOLZ zxdn7G!Yv@9O#y<&eUy{)vMXb;fQR)ffVAADQsEMXm;IBMDLfLD0w^U;6%HVo-0Q_5 zCHEa?DBuauNpZzoF+tK27w#n~?u%toS-DhR4k@Q*{7x^8Q=D6&kd^_~J#VVG2LXkL zaAy=}U*?Jto)9hx5MGjdp9hcQAu@tfk_;l!PeyxPY<8b&+&D!CyaBh9=8BSVKLpk4 z4Ml3yY|&Th)vyK4cpC{!uU8v2YBlVV`d~(nz&<@{G1oe*DHub1z7~J5*;s2bX<)_* zV_GbsPQg`(&rpxRb_*Od7}++3+liSw-$!1 zs5*g}EHWhI3i|!-FcfzYL0`SL-rq>LENC;PMl)G(0(1U2%Va|smp0UFx0xd@soZA* zD5LYc4OlbE7@ARt#h}rr3>K@bf%B#^-c+xz8Hr)0D5ExIFltezN@Hn8>o5d~bSfYtkc+_Z&kI#-N5_GhCg*V-^TSO=!G~ z(fXy{n2XV+k}6w_W`dTOP2a4u0ly;ANZ>4OxSKAzFB!yBzdo`gX zO?o|H@WiAw$y6l?=^3jA_Hy0S)nTYs12;4hKE&ekQ|>?|ZLJ}#F`2BczC7kdE4@xV zZBD_)Otwjhz+NSaz?d45!;FsGSu-#qh#hStD%B}f!mCT!KqzSo>I`NGH_9Dea$1Qi zg29Ydt!~lQVR99_T7#Hije~(12drl-P)SV?QR*9sus`8th-8^OQ7@xI$(Yp|^;bL1 zR50O$mDXw6P>i7B(TJ)ciPzTE>XY%X6HAa)b#OBRXv&~%Bw|J#Y><i4=e%95bjtw|cJp=#P#Pf#*luqI_wR;fISDCJhAqSG6R%xItn%~QtZ@m%&u zjGGLX;t6Ls62eQvNmf@v+}J%54^CygxRZ`?8X#r|wkev7(s;Ou4T#y1XNNf)h;o7z z8a^Lfq<1uH`E{G9E z*(=)Css_LSk=>E9jr)s5^2-!+MN=Ds}>1hRma4`uCIz9%p3O77839E{xf z4c_I?**|1`K2tg4!Hvyrou4BsJQuv*UfF)<%CelYIS>D^o?X)3+MK%la6kooW8&G@BU)Y0hT`+mOm$Z_%rB=a%o>I z!2c6lHyKQN)VjiFwa!eE^p8jc$sy$vB+8i25lI~6KPFFh$!o$avA~rj#L6xvR|Z83 z*WD6T9e+5Pyy=F+)pNTf{ny3cy>7Rkd3o*TS?TZJ`NS^NF2%HMkyS{?uJ$`!P4_L^ z1`NFDUbNyg_qREifgktnp1_v{Jbb`7m}2PTyUdOmtJj~m z9bB=ecw4_^rw1IW=of+>nrW5=d3k`3qHCxsIN_F{T1A545};;+fsyC&qChi+YV zr~M63H8ZLCPYmsjY>ls9cL%I)F|JIW-#+48$+lD4k*(P*kDM%zx_fvu4u5ZYUnI}5 zdrycFq>xFU)&X3p@pP2u%$o}}YcRn(MhJ&B2o?KS@cIVz>Ye%o^xV?CB{_Qhu z;}_q1bvO^g{8<3!gYbo4Di{8qzV+(9 zdlmksohQmRTs@qB;(Wo?dER_ux6XQb@q$tQPW?CMu6GVQd;R=iR;-S{Kr%Zks7>b1 zNs{|-+jhObYE}NR&`TGGr^h^4bjh%c>R#@=8nM&Md>_a+zVulsl;){flFekV1t9ob z+SqfV_Pv3$2f)bQ8%Ul2>fdYR^1zs0BQF~olsOj5AodC&Q_7SMFzsz2 z9newxE&jodk~tNHwl%LBMMDbrk=(^b diff --git a/test_packages.gni b/test_packages.gni index 8ecd65e73..de2920221 100644 --- a/test_packages.gni +++ b/test_packages.gni @@ -47,6 +47,7 @@ _all_test_packages = [ "${ACTS_ROOT}/barrierfree:barrierfree", "${ACTS_ROOT}/customization:customization", "${ACTS_ROOT}/distributedschedule:systemabilitymgr", + "${ACTS_ROOT}/applications:applications", ] _all_test_packages_ivi = [ -- GitLab