diff --git a/notification/ans_standard/BUILD.gn b/notification/ans_standard/BUILD.gn index 67c1bb7cabb87ea666cfdba2eab1a80996fab049..983edd21c1d2532d454c75aea5556c6079815705 100644 --- a/notification/ans_standard/BUILD.gn +++ b/notification/ans_standard/BUILD.gn @@ -16,12 +16,9 @@ group("ans_standard") { testonly = true if (is_standard_system) { deps = [ - #"actsansnotificationcancel:ActsAnsNotificationCancelTest", "actsNotificationSlotTest:ActsNotificationSlotTest", "actsNotificationWantAgentTest:ActsNotificationWantAgentTest", - "actsansslottest:ActsAnsSlotTest", "actsnotificationshow:ActsNotificationShowTest", - "publish_test:publish_test", ] } } diff --git a/notification/ans_standard/actsansnotificationcancel/BUILD.gn b/notification/ans_standard/actsansnotificationcancel/BUILD.gn deleted file mode 100644 index e3f194b5fd2c052b1a1548acf7cf954c582a9655..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansnotificationcancel/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsNotificationCancelTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsNotificationCancelTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/actsansnotificationcancel/Test.json b/notification/ans_standard/actsansnotificationcancel/Test.json deleted file mode 100644 index 44c55948aa67cf7c8743f673c3cf54d3a94c21c8..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansnotificationcancel/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "shell-timeout": "180000", - "bundle-name": "com.example.actsansnotificationcancel", - "package-name": "com.example.actsansnotificationcancel" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsNotificationCancelTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansnotificationcancel/signature/openharmony_sx.p7b b/notification/ans_standard/actsansnotificationcancel/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansnotificationcancel/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/actsansnotificationcancel/src/main/config.json b/notification/ans_standard/actsansnotificationcancel/src/main/config.json deleted file mode 100644 index d10b9283b82a0e5a93e69aa029cbcf7db94465ec..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansnotificationcancel/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansnotificationcancel", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansnotificationcancel", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansnotificationcancel/src/main/js/MainAbility/app.js b/notification/ans_standard/actsansnotificationcancel/src/main/js/MainAbility/app.js deleted file mode 100644 index 4f1747a95c4acbb66db5351e826c31584356e11c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansnotificationcancel/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/actsansnotificationcancel/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/actsansnotificationcancel/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansnotificationcancel/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansnotificationcancel/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/actsansnotificationcancel/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansnotificationcancel/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansnotificationcancel/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/actsansnotificationcancel/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansnotificationcancel/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/actsansnotificationcancel/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/actsansnotificationcancel/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index db0b4b27222b9b0154df7df937c231d5fe52ab42..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansnotificationcancel/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - ActsAnsNotificationCancel - -
diff --git a/notification/ans_standard/actsansnotificationcancel/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/actsansnotificationcancel/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansnotificationcancel/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/actsansnotificationcancel/src/main/js/TestAbility/app.js b/notification/ans_standard/actsansnotificationcancel/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansnotificationcancel/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/actsansnotificationcancel/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/actsansnotificationcancel/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansnotificationcancel/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansnotificationcancel/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/actsansnotificationcancel/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansnotificationcancel/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansnotificationcancel/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/actsansnotificationcancel/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansnotificationcancel/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansnotificationcancel/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/actsansnotificationcancel/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansnotificationcancel/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/actsansnotificationcancel/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/actsansnotificationcancel/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansnotificationcancel/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/actsansnotificationcancel/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/actsansnotificationcancel/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansnotificationcancel/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/actsansnotificationcancel/src/main/js/test/ActsAnsNotificationCancel.test.js b/notification/ans_standard/actsansnotificationcancel/src/main/js/test/ActsAnsNotificationCancel.test.js deleted file mode 100644 index 5b5d91957743124e917fbfa1907bc7733515a51f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansnotificationcancel/src/main/js/test/ActsAnsNotificationCancel.test.js +++ /dev/null @@ -1,2110 +0,0 @@ -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -let timeout = 500; -export default function ActsAnsNotificationCancel() { -describe('ActsAnsNotificationCancel', function () { - console.info('===========ActsAnsNotificationCancel start====================>'); - let timesOfOnConsume - function onConsumeCancelAll(data) { - console.info('================ANS_Cancel_0100 onConsume start=======================>'); - console.info('================ANS_Cancel_0100 onConsume data:=================>' + JSON.stringify(data)); - timesOfOnConsume = timesOfOnConsume + 1 - if (timesOfOnConsume == 2){ - notify.cancelAll(cancelAllCallBack); - console.info('================ANS_Cancel_0100 onConsume cancelAll=======================>'); - } - console.info('================ANS_Cancel_0100 onConsume end=======================>'); - } - let timesOfOnCancel - function onCancelCancelAll(data) { - console.info('================ANS_Cancel_0100 onCancel start===============>'); - console.info('================ANS_Cancel_0100 onCancel data:===============>' + JSON.stringify(data)); - timesOfOnCancel = timesOfOnCancel + 1 - if (timesOfOnCancel == 1){ - expect(data.request.id).assertEqual(1); - } else if (timesOfOnCancel == 2){ - expect(data.request.id).assertEqual(2); - } - console.info('================ANS_Cancel_0100 onCancel end=======================>'); - } - function cancelAllCallBack(err, data){ - console.info('========ANS_Cancel_0100 cancelAllCallBack start==============>'); - console.info('========ANS_Cancel_0100 cancelAllCallBack data===============>' + JSON.stringify(data)); - console.info('========ANS_Cancel_0100 cancelAllCallBack err================>' + JSON.stringify(err)); - console.info('========ANS_Cancel_0100 cancelAllCallBack end================>'); - } - - /* - * @tc.number: ANS_Cancel_0100 - * @tc.name: cancelAll(callback: AsyncCallback): void; - * @tc.desc: Verify that the application successfully cancels all its published notifications by calling the - cancelAll(callback: AsyncCallback) interface - */ - it('ANS_Cancel_0100', 0, async function (done) { - console.info('==================ANS_Cancel_0100 start==================>'); - timesOfOnConsume = 0 - timesOfOnCancel = 0 - let subscriber ={ - onConsume:onConsumeCancelAll, - onCancel:onCancelCancelAll, - } - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 1, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '0100_1', - badgeIconStyle: 1, - showDeliveryTime: true, - } - let notificationRequest1 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 2, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '0100_2', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.subscribe(subscriber); - console.info('===========ANS_Cancel_0100 subscribe promise=======>'); - await notify.publish(notificationRequest); - console.info('===========ANS_Cancel_0100 publish1 promise=======>'); - await notify.publish(notificationRequest1); - console.info('===========ANS_Cancel_0100 publish2 promise=======>'); - setTimeout((async function(){ - console.info('======ANS_Cancel_0100 setTimeout==================>'); - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_0100 setTimeout unsubscribe==================>'); - done(); - }),timeout); - }) - - - function onConsumeCancelAllPromise(data) { - timesOfOnConsume = timesOfOnConsume + 1 - console.info('================ANS_Cancel_0200 onConsume start===========>'); - console.info('================ANS_Cancel_0200 onConsume data:============>' + JSON.stringify(data)); - if (timesOfOnConsume == 2){ - notify.cancelAll(); - console.info('==========ANS_Cancel_0200 onConsume cancelAll promise==========>'); - } - console.info('================ANS_Cancel_0200 onConsume end===============>'); - } - - function onCancelCancelAllPromise(data) { - timesOfOnCancel = timesOfOnCancel + 1 - console.info('=========ANS_Cancel_0200 onCancel start==========>'); - console.info('=========ANS_Cancel_0200 onCancel data:==========>' + JSON.stringify(data)); - if (timesOfOnCancel == 1){ - expect(data.request.id).assertEqual(1); - } else if (timesOfOnCancel == 2){ - expect(data.request.id).assertEqual(2); - } - console.info('==========ANS_Cancel_0200 onCancel end=======================>'); - } - - /* - * @tc.number: ANS_Cancel_0200 - * @tc.name: cancelAll(): Promise; - * @tc.desc: Verify that the application successfully cancels all its published notifications by - calling the cancelAll(): Promise interface - */ - it('ANS_Cancel_0200', 0, async function (done) { - console.info('===============ANS_Cancel_0200 start==========================>'); - timesOfOnConsume = 0 - timesOfOnCancel = 0 - let subscriber ={ - onConsume:onConsumeCancelAllPromise, - onCancel:onCancelCancelAllPromise, - } - await notify.subscribe(subscriber); - console.info('==================ANS_Cancel_0200 subscribe promise==================>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 1, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '0200', - badgeIconStyle: 1, - showDeliveryTime: true, - } - let notificationRequest1 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 2, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '0200', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('==========ANS_Cancel_0200 publish1 promise==================>'); - await notify.publish(notificationRequest1); - console.info('==========ANS_Cancel_0200 publish2 promise==================>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_0200 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - function onConsumeCancelAllNoNotify(data) { - console.info('================ANS_Cancel_0300 onConsume start========>'); - console.info('================ANS_Cancel_0300 onConsume data:========>' + JSON.stringify(data)); - expect().assertFail(); - console.info('================ANS_Cancel_0300 onConsume end=======================>'); - } - function onCancelCancelAllNoNotify(data) { - console.info('=================ANS_Cancel_0300 onCancel start=============>'); - expect().assertFail(); - console.info('================ANS_Cancel_0300 onCancel data:==============>' + JSON.stringify(data)); - console.info('================ANS_Cancel_0300 onCancel end================>'); - } - function cancelAllCallBackNoNotify(err, data){ - console.info('==========ANS_Cancel_0300 cancelAllCallBack start=============>'); - console.info('==========ANS_Cancel_0300 cancelAllCallBack data:=============>' + JSON.stringify(data)); - console.info('==========ANS_Cancel_0300 cancelAllCallBack err:=============>' + JSON.stringify(err)); - console.info('==========ANS_Cancel_0300 cancelAllCallBack end===============>'); - } - - /* - * @tc.number: ANS_Cancel_0300 - * @tc.name: cancelAll(callback: AsyncCallback): void - * @tc.desc: Verify that when there is no notification in the notification list, - call the cancelAll(callback: AsyncCallback): void interface, - and the application cancels all its published notifications. - At this time, no notification information is cancelled, - and there is no OnCancel notification(Callback mode) - */ - it('ANS_Cancel_0300', 0, async function (done) { - console.info('===============ANS_Cancel_0300 start==========================>'); - let subscriber ={ - onConsume:onConsumeCancelAllNoNotify, - onCancel:onCancelCancelAllNoNotify, - } - await notify.subscribe(subscriber); - console.info('===============ANS_Cancel_0300 subscribe promise===============>'); - await notify.cancelAll(cancelAllCallBackNoNotify); - console.info('===============ANS_Cancel_0300 cancelAll promise===============>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_0300 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - function onConsumeCancelAllNoNotifyPromise(data) { - console.info('================ANS_Cancel_0400 onConsume===============>'); - console.info('================ANS_Cancel_0400 onConsume data:===========>' + JSON.stringify(data)); - expect().assertFail(); - console.info('================ANS_Cancel_0400 onConsume end===========>'); - } - function onCancelCancelAllNoNotifyPromise(data) { - console.info('===============ANS_Cancel_0400 onCancel ==================>'); - console.info('===============ANS_Cancel_0400 onCancel data==============>' + JSON.stringify(data)); - expect().assertFail(); - console.info('===============ANS_Cancel_0400 onCancel end===============>'); - } - - /* - * @tc.number: ANS_Cancel_0400 - * @tc.name: cancelAll(): Promise; - * @tc.desc: Verify that when there is no notification in the notification list, - call the cancelAll(callback: AsyncCallback): void interface, - and the application cancels all its published notifications. - At this time, no notification information is cancelled, - and there is no OnCancel notification( Callback mode) - */ - it('ANS_Cancel_0400', 0, async function (done) { - console.info('===============ANS_Cancel_0400 start==========================>'); - let subscriber ={ - onConsume:onConsumeCancelAllNoNotifyPromise, - onCancel:onCancelCancelAllNoNotifyPromise, - } - await notify.subscribe(subscriber); - console.info('================ANS_Cancel_0400 subscribe promise=============>'); - await notify.cancelAll(); - console.info('================ANS_Cancel_0400 cancelAll promise=============>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_0400 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - - }) - - function onConsumeCancelAll2Times(data) { - console.info('==========ANS_Cancel_0500 onConsume start==============>'); - console.info('==========ANS_Cancel_0500 onConsume data:==============>' + JSON.stringify(data)); - notify.cancelAll(cancelAllCallBack2Times1); - console.info('==========ANS_Cancel_0500 onConsume cancelAll=================>'); - console.info('==========ANS_Cancel_0500 onConsume end=======================>'); - } - - function onCancelCancelAll2Times(data) { - console.info('=========ANS_Cancel_0500 onCancel start===============>'); - console.info('=========ANS_Cancel_0500 onCancel data:===============>' + JSON.stringify(data)); - timesOfOnCancel = timesOfOnCancel + 1 - if (timesOfOnCancel == 1){ - expect(data.request.id).assertEqual(5); - } else if (timesOfOnCancel){ - expect(data.request.id).assertEqual(0); - } - console.info('==========ANS_Cancel_0500 onCancel end===============>'); - } - function cancelAllCallBack2Times1(err){ - console.info('==========ANS_Cancel_0500 cancelAllCallBack1 start==========>'); - console.info('==========ANS_Cancel_0500 cancelAllCallBack1 err:===========>' + JSON.stringify(err)); - notify.cancelAll(cancelAllCallBack2Times2); - console.info('==========ANS_Cancel_0500 cancelAllCallBack1 cancelAll======>'); - console.info('==========ANS_Cancel_0500 cancelAllCallBack1 end===========>'); - } - function cancelAllCallBack2Times2(err){ - console.info('==========ANS_Cancel_0500 cancelAllCallBack2 start=============>'); - console.info('==========ANS_Cancel_0500 cancelAllCallBack2 err:==============>' + JSON.stringify(err)); - console.info('==========ANS_Cancel_0500 cancelAllCallBack2 end===============>'); - } - - /* - * @tc.number: ANS_Cancel_0500 - * @tc.name: cancelAll(callback: AsyncCallback): void - * @tc.desc: Verify that all notifications are cancelled successfully - by calling the cancelAll(callback: AsyncCallback): void interface, - and then cancel the notification again - */ - it('ANS_Cancel_0500', 0, async function (done) { - console.info('============ANS_Cancel_0500 start==================>'); - timesOfOnCancel = 0 - let subscriber ={ - onConsume:onConsumeCancelAll2Times, - onCancel:onCancelCancelAll2Times, - } - await notify.subscribe(subscriber); - console.info('============ANS_Cancel_0500 subscribe promise======>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 5, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '0500', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('==============ANS_Cancel_0500 publish promise end==============>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_0500 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - function onConsumeCancelAll2TimesPromise(data) { - console.info('==========ANS_Cancel_0600 onConsume start============>'); - console.info('==========ANS_Cancel_0600 onConsume data=============>' + JSON.stringify(data)); - notify.cancelAll(); - console.info('==========ANS_Cancel_0600 onConsume cancelAll 2times1 end======>'); - notify.cancelAll(); - console.info('==========ANS_Cancel_0600 onConsume cancelAll 2times2 end======>'); - console.info('==========ANS_Cancel_0600 onConsume end========>'); - } - function onCancelCancelAll2TimesPromise(data) { - timesOfOnCancel = timesOfOnCancel + 1 - console.info('==========ANS_Cancel_0600 onCancel===================>'); - console.info('==========ANS_Cancel_0600 onCancel data:============>' + JSON.stringify(data)); - if (timesOfOnCancel == 1){ - expect(data.request.id).assertEqual(6); - } else if (timesOfOnCancel == 2){ - expect().assertFail(); - } - console.info('==========ANS_Cancel_0600 onCancel end=============>'); - } - - /* - * @tc.number: ANS_Cancel_0600 - * @tc.name: cancelAll(): Promise; - * @tc.desc: Verify that all notifications are cancelled successfully by calling the - cancelAll(): Promise interface, and then cancel the notification again - */ - it('ANS_Cancel_0600', 0, async function (done) { - console.info('===============ANS_Cancel_0600 start==========================>'); - timesOfOnCancel = 0 - let subscriber ={ - onConsume:onConsumeCancelAll2TimesPromise, - onCancel:onCancelCancelAll2TimesPromise, - } - await notify.subscribe(subscriber); - console.info('==================ANS_Cancel_0600 subscribe promise==================>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 6, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '0600', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('==================ANS_Cancel_0600 publish promise==================>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_0600 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - function onConsumeCancelAllIsUnremovable(data) { - console.info('========ANS_Cancel_0700 onConsume start===========>'); - console.info('========ANS_Cancel_0700 onConsume data: ===========>' + JSON.stringify(data)); - notify.cancelAll(cancelAllCallBackIsUnremovable); - console.info('========ANS_Cancel_0700 onConsume cancelAll===========>'); - console.info('========ANS_Cancel_0700 onConsume end============>'); - } - function onCancelCancelAllIsUnremovable(data) { - console.info('================ANS_Cancel_0700 onCancel start=======================>'); - console.info('================ANS_Cancel_0700 onCancel data:====================>' + JSON.stringify(data)); - expect(data.request.id).assertEqual(7); - console.info('================ANS_Cancel_0700 onCancel end=======================>'); - } - function cancelAllCallBackIsUnremovable(err, data){ - console.info('===========ANS_Cancel_0700 cancelAllCallBack start==========>'); - console.info('===========ANS_Cancel_0700 cancelAllCallBack err:===========>' + JSON.stringify(err)); - console.info('===========ANS_Cancel_0700 cancelAllCallBack data:==========>' + JSON.stringify(data)); - console.info('===========ANS_Cancel_0700 cancelAllCallBack end=======================>'); - } - - /* - * @tc.number: ANS_Cancel_0700 - * @tc.name: cancelAll(callback: AsyncCallback): void; - * @tc.desc: Verify that by calling the cancelAll(callback: AsyncCallback): void; - interface, the application successfully cancels all the notifications - that isUnremovable is true that it has published - */ - it('ANS_Cancel_0700', 0, async function (done) { - console.info('===============ANS_Cancel_0700 start==========================>'); - let subscriber ={ - onConsume:onConsumeCancelAllIsUnremovable, - onCancel:onCancelCancelAllIsUnremovable, - } - await notify.subscribe(subscriber); - console.info('========ANS_Cancel_0700 subscribe promise==================>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 7, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : true, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '0700', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('===========ANS_Cancel_0700 publish promise==================>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_0700 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - function onConsumeCancelAllIsUnremovablPromise(data) { - console.info('================ANS_Cancel_0800 onConsume start=============>'); - console.info('================ANS_Cancel_0800 onConsume data:=============>' + JSON.stringify(data)); - notify.cancelAll(); - console.info('================ANS_Cancel_0800 cancelAll==========>'); - console.info('================ANS_Cancel_0800 onConsume end===============>'); - } - function onCancelCancelAllIsUnremovablePromise(data) { - console.info('================ANS_Cancel_0800 onCancel start================>'); - console.info('================ANS_Cancel_0800 onCancel data :===============>' + JSON.stringify(data)); - expect(data.request.id).assertEqual(8); - console.info('================ANS_Cancel_0800 onCancel end================>'); - } - - /* - * @tc.number: ANS_Cancel_0800 - * @tc.name: cancelAll(): Promise; - * @tc.desc: Verify that by calling the cancelAll(): Promise interface, - the application successfully cancels all the notifications - that isUnremovable is true that it has published - */ - it('ANS_Cancel_0800', 0, async function (done) { - console.info('===============ANS_Cancel_0800 start==========================>'); - let subscriber ={ - onConsume:onConsumeCancelAllIsUnremovablPromise, - onCancel:onCancelCancelAllIsUnremovablePromise, - } - await notify.subscribe(subscriber); - console.info('==================ANS_Cancel_0800 subscribe promsie==================>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 8, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : true, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '0800', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('=========ANS_Cancel_0800 publish promise==================>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_0800 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - function onConsumeCancel(data) { - console.info('=========ANS_Cancel_0900 onConsume start================>'); - console.info('=========ANS_Cancel_0900 onConsume data:================>' + JSON.stringify(data)); - notify.cancel(data.request.id,cancelCallBackCancel); - console.info('=========ANS_Cancel_0900 onConsume cancel=============>'); - console.info('=========ANS_Cancel_0900 onConsume end================>'); - } - function onCancelCancel(data) { - console.info('=========ANS_Cancel_0900 onCancel start================>'); - console.info('=========ANS_Cancel_0900 onCancel data:================>' + JSON.stringify(data)); - expect(data.request.id).assertEqual(9); - console.info('=========ANS_Cancel_0900 onCancel end================>'); - } - function cancelCallBackCancel(err){ - console.info('===========ANS_Cancel_0900 cancelCallBack start================>'); - console.info('===========ANS_Cancel_0900 cancelCallBack err:=================>' + JSON.stringify(err)); - console.info('===========ANS_Cancel_0900 cancelCallBack end==================>'); - } - - /* - * @tc.number: ANS_Cancel_0900 - * @tc.name: cancel(id: number, callback: AsyncCallback): void; - * @tc.desc: Verify that the specific ID notification is cancelled successfully by calling - the cancel(id: number, callback: AsyncCallback): void; interface - */ - it('ANS_Cancel_0900', 0, async function (done) { - console.info('===============ANS_Cancel_0900 start==========================>'); - let subscriber ={ - onConsume:onConsumeCancel, - onCancel:onCancelCancel, - } - await notify.subscribe(subscriber); - console.info('==================ANS_Cancel_0900 subscribe promise==================>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 9, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('==================ANS_Cancel_0900 publish promise==================>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_0900 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - function onConsumeCancelWrongId(data) { - console.info('========ANS_Cancel_1000 onConsume start==============>'); - console.info('========ANS_Cancel_1000 onConsume data:==============>' + JSON.stringify(data)); - console.info('========ANS_Cancel_1000 onConsume label:=============>' + data.request.label); - console.info('========ANS_Cancel_1000 onConsume id:================>' + data.request.id); - notify.cancel(9999,cancelCallBackCancelWrongId); - console.info('========ANS_Cancel_1000 onConsume cancel==========>'); - console.info('========ANS_Cancel_1000 onConsume end============>'); - } - function onCancelCancelWrongId(data) { - console.info('================ANS_Cancel_1000 onCancel start=============>'); - console.info('================ANS_Cancel_1000 onCancel data:=============>' + JSON.stringify(data)); - expect().assertFail(); - console.info('================ANS_Cancel_1000 onCancel end===============>'); - } - function cancelCallBackCancelWrongId(err){ - console.info('==============ANS_Cancel_1000 cancelCallBack start===============>'); - console.info('==============ANS_Cancel_1000 cancelCallBack err:================>' + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info('==============ANS_Cancel_1000 cancelCallBack end=================>'); - } - - /* - * @tc.number: ANS_Cancel_1000 - * @tc.name: cancel(id: number, callback: AsyncCallback): void; - * @tc.desc: Verify that when the cancel(id: number, callback: AsyncCallback): void - interface is called, when the id is wrong, no notification information is cancelled at this time - */ - it('ANS_Cancel_1000', 0, async function (done) { - console.info('===============ANS_Cancel_1000 start==========================>'); - let subscriber ={ - onConsume:onConsumeCancelWrongId, - onCancel:onCancelCancelWrongId, - } - await notify.subscribe(subscriber); - console.info('================ANS_Cancel_1000 subscribe promise==================>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 10, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '1000', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('===========ANS_Cancel_1000 publish promise==================>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_1000 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - function onConsumeCancelIsUnremovable(data) { - console.info('============ANS_Cancel_1100 onConsume start===============>'); - console.info('============ANS_Cancel_1100 onConsume data:===============>' + JSON.stringify(data)); - console.info('============ANS_Cancel_1100 onConsume label:==============>' + data.request.label); - console.info('============ANS_Cancel_1100 onConsume id: =======================>' + data.request.id); - notify.cancel(data.request.id,cancelCallBackCancelIsUnremovable); - console.info('============ANS_Cancel_1100 onConsume cancel=======================>'); - console.info('============ANS_Cancel_1100 onConsume end=======================>'); - } - function onCancelCancelIsUnremovable(data) { - console.info('============ANS_Cancel_1100 onCancel start================>'); - console.info('============ANS_Cancel_1100 onCancel data:================>' + JSON.stringify(data)); - console.info('============ANS_Cancel_1100 onCancel id:================>' + data.request.id); - expect(data.request.id).assertEqual(11); - console.info('============ANS_Cancel_1100 onCancel end=======================>'); - } - function cancelCallBackCancelIsUnremovable(err){ - console.info('============ANS_Cancel_1100 cancelCallBack start=================>'); - console.info('============ANS_Cancel_1100 cancelCallBack err:==================>' + JSON.stringify(err)); - console.info('============ANS_Cancel_1100 cancelCallBack end===================>'); - } - - /* - * @tc.number: ANS_Cancel_1100 - * @tc.name: cancel(id: number, callback: AsyncCallback): void; - * @tc.desc: Verify the success of canceling the notification with the notification attribute isUnremovable - being true by calling the cancel(id: number, callback: AsyncCallback): void interface - */ - it('ANS_Cancel_1100', 0, async function (done) { - console.info('===============ANS_Cancel_1100 start==========================>'); - let subscriber ={ - onConsume:onConsumeCancelIsUnremovable, - onCancel:onCancelCancelIsUnremovable, - } - await notify.subscribe(subscriber); - console.info('===============ANS_Cancel_1100 subscribe promise=============>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 11, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : true, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('============ANS_Cancel_1100 publish promise===========>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_1100 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - let id1200 - function onConsumeCancel2Times(data) { - console.info('=========ANS_Cancel_1200 onConsume start=====================>'); - console.info('=========ANS_Cancel_1200 onConsume data:=====================>' + JSON.stringify(data)); - console.info('=========ANS_Cancel_1200 onConsume label:====================>' + data.request.label); - console.info('=========ANS_Cancel_1200 onConsume id:=======================>' + data.request.id); - id1200 = data.request.id - notify.cancel(id1200, cancelCallBackCancel2Times1); - console.info('=========ANS_Cancel_1200 onConsume cancel====================>'); - console.info('=========ANS_Cancel_1200 onConsume end=======================>'); - } - function onCancelCancel2Times(data) { - timesOfOnCancel = timesOfOnCancel + 1 - console.info('=========ANS_Cancel_1200 onCancel start======================>'); - console.info('=========ANS_Cancel_1200 onCancel data:===========>' + JSON.stringify(data)); - console.info('=========ANS_Cancel_1200 onCancel timesOfOnCancel========>'+timesOfOnCancel); - if (timesOfOnCancel == 1){ - expect(data.request.id).assertEqual(12); - console.info('=========ANS_Cancel_1200 onCancel id:======================>' + data.request.id); - notify.cancel(id1200, cancelCallBackCancel2Times2); - console.info('=========ANS_Cancel_1200 onCancel cancelCallBack_cancel 2Times2===========>'); - }else if(timesOfOnCancel == 2) { - expect().assertFail(); - } - console.info('=========ANS_Cancel_1200 onCancel end=======================>'); - } - function cancelCallBackCancel2Times1(err){ - console.info('===========ANS_Cancel_1200 cancelCallBack1 start================>'); - console.info('===========ANS_Cancel_1200 cancelCallBack1 err:=================>' + JSON.stringify(err)); - console.info('===========ANS_Cancel_1200 cancelCallBack1 end=======================>'); - } - - function cancelCallBackCancel2Times2(err){ - console.info('===========ANS_Cancel_1200 cancelCallBack2 start===========>'); - console.info('===========ANS_Cancel_1200 cancelCallBack2 err:============>' + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info('===========ANS_Cancel_1200 cancelCallBack2 end============>'); - } - - /* - * @tc.number: ANS_Cancel_1200 - * @tc.name: cancel(id: number, callback: AsyncCallback): void; - * @tc.desc: Verify that the cancel(id: number, callback: AsyncCallback): void - interface is called twice in a row to cancel the notification - */ - it('ANS_Cancel_1200', 0, async function (done) { - console.info('=============ANS_Cancel_1200 start==========================>'); - timesOfOnCancel = 0 - let subscriber ={ - onConsume:onConsumeCancel2Times, - onCancel:onCancelCancel2Times, - } - await notify.subscribe(subscriber); - console.info('=============ANS_Cancel_1200 subscribe promise==================>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 12, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('========ANS_Cancel_1200 publish promise=================>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_1200 setTimeout unsubscribe end==================>'); - done(); - }),1500); - }) - - function onConsumeCancelLabel(data) { - console.info('============ANS_Cancel_1300 onConsume start=============>'); - console.info('============ANS_Cancel_1300 onConsume data:=============>' + JSON.stringify(data)); - console.info('============ANS_Cancel_1300 onConsume label: ===========>' + data.request.label); - console.info('============ANS_Cancel_1300 onConsume id: ==============>' + data.request.id); - notify.cancel(data.request.id, data.request.label, cancelCallBackCancelLabel); - console.info('============ANS_Cancel_1300 onConsume cance=============>'); - console.info('============ANS_Cancel_1300 onConsume end===============>'); - } - function onCancelCancelLabel(data) { - console.info('=========ANS_Cancel_1300 onCancel start============>'); - console.info('=========ANS_Cancel_1300 onCancel data:============>' + JSON.stringify(data)); - expect(data.request.id).assertEqual(13); - console.info('=========ANS_Cancel_1300 onCancel id:============>' + data.request.id); - expect(data.request.label).assertEqual('1300'); - console.info('=========ANS_Cancel_1300 onCancel label:============>' + data.request.label); - console.info('=========ANS_Cancel_1300 onCancel end==============>'); - } - function cancelCallBackCancelLabel(err){ - console.info('=========ANS_Cancel_1300 cancelCallBack start====================>'); - console.info('=========ANS_Cancel_1300 cancelCallBack err:=====================>' + JSON.stringify(err)); - console.info('=========ANS_Cancel_1300 cancelCallBack end=====================>'); - } - - /* - * @tc.number: ANS_Cancel_1300 - * @tc.name: cancel(id: number, label: string, callback: AsyncCallback): void; - * @tc.desc: Verify that the cancel notification is successful by calling the - cancel(id: number, label: string, callback: AsyncCallback): void; interface - */ - let subscriber - it('ANS_Cancel_1300', 0, async function (done) { - console.info('===============ANS_Cancel_1300 start==========================>'); - subscriber ={ - onConsume:onConsumeCancelLabel, - onCancel:onCancelCancelLabel, - } - await notify.subscribe(subscriber); - console.info('================ANS_Cancel_1300 subscribe promise==============>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 13, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '1300', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('===========ANS_Cancel_1300 publish promise==================>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_1300 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - function onConsumeCancelLabelPromise(data) { - console.info('==========ANS_Cancel_1400 onConsume start=================>'); - console.info('==========ANS_Cancel_1400 onConsume data:=================>' + JSON.stringify(data)); - console.info('==========ANS_Cancel_1400 onConsume label:================>' + data.request.label); - console.info('==========ANS_Cancel_1400 onConsume id:===================>' + data.request.id); - notify.cancel(data.request.id, data.request.label); - console.info('==========ANS_Cancel_1400 onConsume cancel==========>'); - console.info('==========ANS_Cancel_1400 onConsume end=============>'); - } - function onCancelCancelLabelPromise(data) { - console.info('==========ANS_Cancel_1400 onCancel start============>'); - console.info('==========ANS_Cancel_1400 onCancel data:============>' + JSON.stringify(data)); - expect(data.request.id).assertEqual(14); - console.info('==========ANS_Cancel_1400 onCancel id:================>' + data.request.id); - expect(data.request.label).assertEqual('1400'); - console.info('==========ANS_Cancel_1400 onCancel label:================>' + data.request.label); - console.info('==========ANS_Cancel_1400 onCancel end==============>'); - } - - /* - * @tc.number: ANS_Cancel_1400 - * @tc.name: cancel(id: number, label?: string): Promise - * @tc.desc: Verify that the cancel notification is successful by calling the - cancel(id: number, label?: string): Promise interface - */ - it('ANS_Cancel_1400', 0, async function (done) { - console.info('===============ANS_Cancel_1400 start==========================>'); - subscriber ={ - onConsume:onConsumeCancelLabelPromise, - onCancel:onCancelCancelLabelPromise, - } - await notify.subscribe(subscriber); - console.info('==========ANS_Cancel_1400 subscribe promise==================>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 14, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '1400', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('===============ANS_Cancel_1400 publish promise==============>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_1400 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - function onConsumeCancelLabelIsUnremoveable(data) { - console.info('========ANS_Cancel_1500 onConsume start=====================>'); - console.info('========ANS_Cancel_1500 onConsume data:=====================>' + JSON.stringify(data)); - console.info('========ANS_Cancel_1500 onConsume label:====================>' + data.request.label); - console.info('========ANS_Cancel_1500 onConsume id:=======================>' + data.request.id); - notify.cancel(data.request.id, data.request.label, cancelCallBackCancelLabelIsUnremoveable); - console.info('========ANS_Cancel_1500 onConsume cancel====================>'); - console.info('========ANS_Cancel_1500 onConsume end=======================>'); - } - function onCancelCancelLabelIsUnremoveable(data) { - console.info('========ANS_Cancel_1500 onCancel start=======================>'); - console.info('========ANS_Cancel_1500 onCancel data : =======================>' + JSON.stringify(data)); - expect(data.request.id).assertEqual(15); - console.info('========ANS_Cancel_1500 onCancel id : =======================>' + data.request.id); - expect(data.request.label).assertEqual('1500'); - console.info('========ANS_Cancel_1500 onCancel label : =======================>' + data.request.label); - console.info('========ANS_Cancel_1500 onCancel end=======================>'); - } - function cancelCallBackCancelLabelIsUnremoveable(err){ - console.info('========ANS_Cancel_1500 cancelCallBack start=========>'); - console.info('========ANS_Cancel_1500 cancelCallBack err:==========>' + JSON.stringify(err)); - console.info('========ANS_Cancel_1500 cancelCallBack end===========>'); - } - - /* - * @tc.number: ANS_Cancel_1500 - * @tc.name: cancel(id: number, label: string, callback: AsyncCallback): void - * @tc.desc: Verify that the notification whose notification property isUnremovable is true is canceled - successfully by calling the cancel(id: number, label: string, callback: AsyncCallback): void interface - */ - it('ANS_Cancel_1500', 0, async function (done) { - console.info('===============ANS_Cancel_1500 start==========================>'); - let subscriber ={ - onConsume:onConsumeCancelLabelIsUnremoveable, - onCancel:onCancelCancelLabelIsUnremoveable, - } - await notify.subscribe(subscriber); - console.info('=======ANS_Cancel_1500 subscribe promise==================>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 15, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : true, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '1500', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('===========ANS_Cancel_1500 publish promise=============>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_1500 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - function onConsumeCancelLabelIsUnremoveablePromise(data) { - console.info('============ANS_Cancel_1600 onConsume start==================>'); - console.info('============ANS_Cancel_1600 onConsume data:==================>' + JSON.stringify(data)); - console.info('============ANS_Cancel_1600 onConsume label:=================>' + data.request.label); - console.info('============ANS_Cancel_1600 onConsume id:====================>' + data.request.id); - notify.cancel(data.request.id, data.request.label) - console.info('============ANS_Cancel_1600 onConsume cancel end==========>'); - console.info('============ANS_Cancel_1600 onConsume end====================>'); - } - function onCancelCancelLabelIsUnremoveablePromise(data) { - console.info('============ANS_Cancel_1600 onCancel start=================>'); - console.info('============ANS_Cancel_1600 onCancel data:=================>' + JSON.stringify(data)); - expect(data.request.id).assertEqual(16); - console.info('============ANS_Cancel_1600 onCancel id : =======================>' + data.request.id); - expect(data.request.label).assertEqual('1600'); - console.info('============ANS_Cancel_1600 onCancel label : =======================>' + data.request.label); - console.info('============ANS_Cancel_1600 onCancel end===================>'); - } - - /* - * @tc.number: ANS_Cancel_1600 - * @tc.name: cancel(id: number, label?: string): Promise - * @tc.desc: Verify that the notification whose notification property isUnremovable is true - is canceled successfully by calling the cancel(id: number, label?: string): Promise interface - */ - it('ANS_Cancel_1600', 0, async function (done) { - console.info('===============ANS_Cancel_1600 start==========================>'); - let subscriber ={ - onConsume:onConsumeCancelLabelIsUnremoveablePromise, - onCancel:onCancelCancelLabelIsUnremoveablePromise, - } - await notify.subscribe(subscriber); - console.info('==============ANS_Cancel_1600 subscribe promise==================>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 16, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : true, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '1600', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('==============ANS_Cancel_1600 publish promise==================>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_1600 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - function onConsumeCancelWrongLabel(data) { - console.info('================ANS_Cancel_1700 onConsume start===============>'); - console.info('================ANS_Cancel_1700 onConsume data:===============>' + JSON.stringify(data)); - console.info('================ANS_Cancel_1700 onConsume label:==============>' + data.request.label); - console.info('================ANS_Cancel_1700 onConsume id:=================>' + data.request.id); - notify.cancel(data.request.id, '9999', cancelCallBackCancelWrongLabel); - console.info('================ANS_Cancel_1700 onConsume cancel=======================>'); - console.info('================ANS_Cancel_1700 onConsume end=======================>'); - } - function onCancelCancelWrongLabel(data) { - console.info('================ANS_Cancel_1700 onCancel start===============>'); - console.info('================ANS_Cancel_1700 onCancel data:===============>' + JSON.stringify(data)); - expect().assertFail(0); - console.info('================ANS_Cancel_1700 onCancel end=================>'); - } - function cancelCallBackCancelWrongLabel(err){ - console.info('================ANS_Cancel_1700 cancelCallBack start=================>'); - console.info('================ANS_Cancel_1700 cancelCallBack err:==================>' + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info('================ANS_Cancel_1700 cancelCallBack end===================>'); - } - - /* - * @tc.number: ANS_Cancel_1700 - * @tc.name: cancel(id: number, label: string, callback: AsyncCallback): void; - * @tc.desc: Verify that the cancel(id: number, label: string, callback: AsyncCallback): void - interface is called, the label is wrong and the ID is correct. - */ - it('ANS_Cancel_1700', 0, async function (done) { - console.info('===============ANS_Cancel_1700 start==========================>'); - let subscriber ={ - onConsume:onConsumeCancelWrongLabel, - onCancel:onCancelCancelWrongLabel, - } - await notify.subscribe(subscriber); - console.info('==============ANS_Cancel_1700 subscribe promise==================>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 17, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '1700', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('==============ANS_Cancel_1700 publish promise==================>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_1700 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - function onConsumeCancelWrongLabelPromise(data) { - console.info('=========ANS_Cancel_1800 onConsume start================>'); - console.info('=========ANS_Cancel_1800 onConsume data:================>' + JSON.stringify(data)); - console.info('=========ANS_Cancel_1800 onConsume label:===============>' + data.request.label); - console.info('=========ANS_Cancel_1800 onConsume id:==================>' + data.request.id); - notify.cancel(data.request.id, '9999').then(()=>{ - console.info('=========ANS_Cancel_1800 onConsume cancel then======>'); - }).catch((err)=>{ - console.info('=========ANS_Cancel_1800 onConsume cancel catch err======>'+JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - }); - console.info('=========ANS_Cancel_1800 onConsume end=======================>'); - } - function onCancelCancelWrongLabelPromise(data) { - console.info('=========ANS_Cancel_1800 onCancel start=======================>'); - console.info('=========ANS_Cancel_1800 onCancel data : =======================>' + JSON.stringify(data)); - expect().assertFail(0); - console.info('=========ANS_Cancel_1800 onCancel end=======================>'); - } - - /* - * @tc.number: ANS_Cancel_1800 - * @tc.name: cancel(id: number, label?: string): Promise - * @tc.desc: Verify that the cancel(id: number, label?: string): Promise interface is called, - the label is wrong and the ID is correct. - */ - it('ANS_Cancel_1800', 0, async function (done) { - console.info('===============ANS_Cancel_1800 start==========================>'); - let subscriber ={ - onConsume:onConsumeCancelWrongLabelPromise, - onCancel:onCancelCancelWrongLabelPromise, - } - await notify.subscribe(subscriber); - console.info('==============ANS_Cancel_1800 subscribe promise==================>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 18, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '1800', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('==============ANS_Cancel_1800 publish promise==================>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_1800 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - function onConsumeCancelLabelNullCharacter(data) { - console.info('===========ANS_Cancel_1900 onConsume start==================>'); - console.info('===========ANS_Cancel_1900 onConsume data:==================>' + JSON.stringify(data)); - console.info('===========ANS_Cancel_1900 onConsume label:=================>' + data.request.label); - console.info('===========ANS_Cancel_1900 onConsume id:====================>' + data.request.id); - notify.cancel(data.request.id, '', cancelCallBackCancelNullCharacter); - console.info('===========ANS_Cancel_1900 onConsume cancel=======================>'); - console.info('===========ANS_Cancel_1900 onConsume end=======================>'); - } - function onCancelCancelLabelNullCharacter(data) { - console.info('===========ANS_Cancel_1900 onCancel start================>'); - console.info('===========ANS_Cancel_1900 onCancel data:================>' + JSON.stringify(data)); - expect().assertFail(0); - console.info('===========ANS_Cancel_1900 onCancel end=======================>'); - } - function cancelCallBackCancelNullCharacter(err){ - console.info('===========ANS_Cancel_1900 cancelCallBack start=================>'); - console.info('===========ANS_Cancel_1900 cancelCallBack err:==================>' + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info('===========ANS_Cancel_1900 cancelCallBack end===================>'); - } - - /* - * @tc.number: ANS_Cancel_1900 - * @tc.name: cancel(id: number, label: string, callback: AsyncCallback): void; - * @tc.desc: Verify that the cancel(id: number, label: string, callback: AsyncCallback): void - interface is called, and the label uses empty characters - */ - it('ANS_Cancel_1900', 0, async function (done) { - console.info('===============ANS_Cancel_1900 start==========================>'); - let subscriber ={ - onConsume:onConsumeCancelLabelNullCharacter, - onCancel:onCancelCancelLabelNullCharacter, - } - await notify.subscribe(subscriber); - console.info('=============ANS_Cancel_1900 subscribe promise==================>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 19, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '1900', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('==========ANS_Cancel_1900 publish promise==============>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_1900 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - function onConsumeCancelNullCharacter(data) { - console.info('==========ANS_Cancel_2000 onConsume start=================>'); - console.info('==========ANS_Cancel_2000 onConsume data:=================>' + JSON.stringify(data)); - console.info('==========ANS_Cancel_2000 onConsume label:================>' + data.request.label); - console.info('==========ANS_Cancel_2000 onConsume id:===================>' + data.request.id); - notify.cancel(data.request.id, '').then(()=>{ - console.info('=========ANS_Cancel_2000 onConsume cancel then======>'); - }).catch((err)=>{ - console.info('=========ANS_Cancel_2000 onConsume cancel catch err======>'+JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - }); - console.info('==========ANS_Cancel_2000 onConsume cancel end==========>'); - console.info('==========ANS_Cancel_2000 onConsume end=================>'); - } - function onCancelCancelNullCharacter(data) { - console.info('==========ANS_Cancel_2000 onCancel start====================>'); - console.info('==========ANS_Cancel_2000 onCancel data:======================>' + JSON.stringify(data)); - expect().assertFail(0); - console.info('==========ANS_Cancel_2000 onCancel end=======================>'); - } - - /* - * @tc.number: ANS_Cancel_2000 - * @tc.name: cancel(id: number, label?: string): Promise; - * @tc.desc: Verify that the cancel(id: number, label?: string): Promise interface is called, - and the label uses empty characters - */ - it('ANS_Cancel_2000', 0, async function (done) { - console.info('===============ANS_Cancel_2000 start==========================>'); - let subscriber ={ - onConsume:onConsumeCancelNullCharacter, - onCancel:onCancelCancelNullCharacter, - } - await notify.subscribe(subscriber); - console.info('=========ANS_Cancel_2000 subscribe promise==================>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 20, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '2000', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('============ANS_Cancel_2000 publish promise===============>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_2000 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - let id2100 - let label2100 - function onConsumeCancelLabel2Times(data) { - console.info('=========ANS_Cancel_2100 onConsume start==================>'); - console.info('=========ANS_Cancel_2100 onConsume data:==================>' + JSON.stringify(data)); - console.info('=========ANS_Cancel_2100 onConsume label:=================>' + data.request.label); - console.info('=========ANS_Cancel_2100 onConsume id:====================>' + data.request.id); - id2100 = data.request.id - label2100 = data.request.label - notify.cancel(id2100, label2100, cancelCallBackCancelLabel2Times1); - console.info('=========ANS_Cancel_2100 onConsume cancel=======================>'); - console.info('=========ANS_Cancel_2100 onConsume end=======================>'); - } - function onCancelCancelLabel2Times(data) { - timesOfOnCancel = timesOfOnCancel + 1 - console.info('=========ANS_Cancel_2100 onCancel start==========>'); - console.info('=========ANS_Cancel_2100 onCancel data===========>' + JSON.stringify(data)); - if (timesOfOnCancel == 1){ - expect(data.request.id).assertEqual(21); - expect(data.request.label).assertEqual('2100'); - }else if(timesOfOnCancel == 2){ - expect().assertFail(); - } - console.info('=========ANS_Cancel_2100 onCancel end==========>'); - } - function cancelCallBackCancelLabel2Times1(err){ - console.info('=========ANS_Cancel_2100 cancelCallBack 2Times1 start============>'); - console.info('=========ANS_Cancel_2100 cancelCallBack 2Times1 err==============>' + JSON.stringify(err)); - expect(err.code).assertEqual(0); - notify.cancel(id2100, label2100, cancelCallBackCancelLabel2Times2); - console.info('=========ANS_Cancel_2100 cancelCallBack 2Times1 cancel =======================>'); - console.info('=========ANS_Cancel_2100 cancelCallBack 2Times1 end=======================>'); - } - function cancelCallBackCancelLabel2Times2(err){ - console.info('=========ANS_Cancel_2100 cancelCallBack 2Times2 start================>'); - console.info('=========ANS_Cancel_2100 cancelCallBack 2Times2 err:=================>' + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info('=========ANS_Cancel_2100 cancelCallBack 2Times2 end==================>'); - } - - /* - * @tc.number: ANS_Cancel_2100 - * @tc.name: cancel(id: number, label: string, callback: AsyncCallback): void - * @tc.desc: Verify that the cancel(id: number, label: string, callback: AsyncCallback): void - interface is called twice in a row - */ - it('ANS_Cancel_2100', 0, async function (done) { - console.info('===============ANS_Cancel_2100 start==========================>'); - timesOfOnCancel = 0 - let subscriber ={ - onConsume:onConsumeCancelLabel2Times, - onCancel:onCancelCancelLabel2Times, - } - await notify.subscribe(subscriber); - console.info('=============ANS_Cancel_2100 subscribe promise==================>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 21, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '2100', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('=============ANS_Cancel_2100 publish promise================>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_2100 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - let id2200 - let label2200 - function onConsumeCancelLabelPromise2Times(data) { - console.info('===========ANS_Cancel_2200 onConsume start=======================>'); - console.info('===========ANS_Cancel_2200 onConsume data:=========>' + JSON.stringify(data)); - console.info('===========ANS_Cancel_2200 onConsume label:========>' + data.request.label); - console.info('===========ANS_Cancel_2200 onConsume id:===========>' + data.request.id); - id2200 = data.request.id - label2200 = data.request.label - notify.cancel(id2200, label2200); - console.info('===========ANS_Cancel_2200 onConsume cancel1==========>'); - notify.cancel(id2200, label2200).then(()=>{ - console.info('=========ANS_Cancel_2200 onConsume cancel2 then======>'); - }).catch((err)=>{ - console.info('=========ANS_Cancel_2200 onConsume cancel2 catch err======>'+JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - }); - console.info('===========ANS_Cancel_2200 onConsume cancel2==========>'); - console.info('===========ANS_Cancel_2200 onConsume end==============>'); - } - function onCancelCancelLabelPromise2Times(data) { - console.info('===========ANS_Cancel_2200 onCancel start===================>'); - console.info('===========ANS_Cancel_2200 onCancel data:===================>' + JSON.stringify(data)); - timesOfOnCancel = timesOfOnCancel + 1 - if (timesOfOnCancel == 1){ - expect(data.request.id).assertEqual(22); - expect(data.request.label).assertEqual('2200'); - }else if (timesOfOnCancel == 2){ - expect().assertFail(); - } - console.info('===========ANS_Cancel_2200 onCancel end=======================>'); - } - - /* - * @tc.number: ANS_Cancel_2200 - * @tc.name: cancel(id: number, label?: string): Promise - * @tc.desc: Verify that the cancel(id: number, label?: string): Promise - interface is called twice in a row - */ - it('ANS_Cancel_2200', 0, async function (done) { - console.info('===============ANS_Cancel_2200 start==========================>'); - timesOfOnCancel = 0 - let subscriber ={ - onConsume:onConsumeCancelLabelPromise2Times, - onCancel:onCancelCancelLabelPromise2Times, - } - await notify.subscribe(subscriber); - console.info('================ANS_Cancel_2200 subscribe_2200_promise=============>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 22, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '2200', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('================ANS_Cancel_2200 publish promise==================>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_2200 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - function onConsumeCancelRightLabelWrongId(data) { - console.info('============ANS_Cancel_2300 onConsume start=======================>'); - console.info('============ANS_Cancel_2300 onConsume data: =======================>' + JSON.stringify(data)); - console.info('============ANS_Cancel_2300 onConsume label: =======================>' + data.request.label); - console.info('============ANS_Cancel_2300 onConsume id: =======================>' + data.request.id); - notify.cancel(11111, data.request.label, cancelCallBackCancelRightLabelWrongId); - console.info('============ANS_Cancel_2300 onConsume cancel=======================>'); - console.info('============ANS_Cancel_2300 onConsume end=======================>'); - } - function onCancelCancelRightLabelWrongId(data) { - console.info('============ANS_Cancel_2300 onCancel start=======================>'); - console.info('============ANS_Cancel_2300 onCancel data:=======================>' + JSON.stringify(data)); - expect().assertFail(); - console.info('============ANS_Cancel_2300 onCancel end=======================>'); - } - function cancelCallBackCancelRightLabelWrongId(err){ - console.info('============ANS_Cancel_2300 cancelCallBack start=======================>'); - console.info('============ANS_Cancel_2300 cancelCallBack err:===============>' + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info('============ANS_Cancel_2300 cancelCallBack end===================>'); - } - - /* - * @tc.number: ANS_Cancel_2300 - * @tc.name: cancel(id: number, label: string, callback: AsyncCallback): void - * @tc.desc: Verify that the cancel(id: number, label: string, callback: AsyncCallback): - void interface is called, the label is correct and the ID is wrong. - */ - it('ANS_Cancel_2300', 0, async function (done) { - console.info('===============ANS_Cancel_2300 start==========================>'); - let subscriber ={ - onConsume:onConsumeCancelRightLabelWrongId, - onCancel:onCancelCancelRightLabelWrongId, - } - await notify.subscribe(subscriber); - console.info('================ANS_Cancel_2300 promise==================>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 23, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '2300', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('============ANS_Cancel_2300 publish promise==================>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_2300 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - function onConsumeCancelRightLabelWrongIdPromise(data) { - console.info('============ANS_Cancel_2400 onConsume start==============>'); - console.info('============ANS_Cancel_2400 onConsume data:==============>' + JSON.stringify(data)); - console.info('============ANS_Cancel_2400 onConsume label:=============>' + data.request.label); - console.info('============ANS_Cancel_2400 onConsume id:================>' + data.request.id); - notify.cancel(11111, data.request.label).then(()=>{ - console.info('=========ANS_Cancel_2400 onConsume cancel then======>'); - }).catch((err)=>{ - console.info('=========ANS_Cancel_2400 onConsume cancel catch err======>'+JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - }); - console.info('============ANS_Cancel_2400 onConsume cancel==========>'); - console.info('============ANS_Cancel_2400 onConsume end=============>'); - } - function onCancelCancelRightLabelWrongIdPromise(data) { - console.info('============ANS_Cancel_2400 onCancel start:==============>'); - console.info('============ANS_Cancel_2400 onCancel data:===============>' + JSON.stringify(data)); - expect().assertFail(); - console.info('============ANS_Cancel_2400 onCancel end=======================>'); - } - - /* - * @tc.number: ANS_Cancel_2400 - * @tc.name: cancel(id: number, label?: string): Promise - * @tc.desc: Verify that the cancel(id: number, label: string, callback: AsyncCallback): void - interface is called, the label is correct and the ID is correct wrong. - */ - it('ANS_Cancel_2400', 0, async function (done) { - console.info('===============ANS_Cancel_2400 start==========================>'); - let subscriber ={ - onConsume:onConsumeCancelRightLabelWrongIdPromise, - onCancel:onCancelCancelRightLabelWrongIdPromise, - } - await notify.subscribe(subscriber); - console.info('============ANS_Cancel_2400 subscribe promise========>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 24, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '2400', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('============ANS_Cancel_2400 publish promise==================>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_2400 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - function onConsumeCancelWrongLabelWrongId(data) { - console.info('==========ANS_Cancel_2500 onConsume start=======================>'); - console.info('==========ANS_Cancel_2500 onConsume data:=======================>' + JSON.stringify(data)); - console.info('==========ANS_Cancel_2500 onConsume label:======================>' + data.request.label); - console.info('==========ANS_Cancel_2500 onConsume id==========================>' + data.request.id); - notify.cancel(6666, '6666', cancelCallBackCancelWrongLabelWrongId); - console.info('==========ANS_Cancel_2500 onConsume cancel====================>'); - console.info('==========ANS_Cancel_2500 onConsume end=======================>'); - } - function onCancelCancelWrongLabelWrongId(data) { - console.info('==========ANS_Cancel_2500 onCancel start====================>'); - console.info('==========ANS_Cancel_2500 onCancel data:====================>' + JSON.stringify(data)); - expect().assertFail(); - console.info('==========ANS_Cancel_2500 onCancel end======================>'); - } - function cancelCallBackCancelWrongLabelWrongId(err){ - console.info('==========ANS_Cancel_2500 cancelCallBack start=======================>'); - console.info('==========ANS_Cancel_2500 cancelCallBack err:================>' + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info('==========ANS_Cancel_2500 cancelCallBack end=======================>'); - } - - /* - * @tc.number: ANS_Cancel_2500 - * @tc.name: cancel(id: number, label: string, callback: AsyncCallback): void - * @tc.desc: Verify that the cancel(id: number, label: string, callback: AsyncCallback): void -  interface is called, the label is correct and the ID is correct wrong. - */ - it('ANS_Cancel_2500', 0, async function (done) { - console.info('===============ANS_Cancel_2500 start==========================>'); - let subscriber ={ - onConsume:onConsumeCancelWrongLabelWrongId, - onCancel:onCancelCancelWrongLabelWrongId, - } - await notify.subscribe(subscriber); - console.info('================ANS_Cancel_2500 subscribe promise==================>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 25, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '2500', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('==========ANS_Cancel_2500 publish promise==================>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_2500 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - function onConsumeCancelWrongLabelWrongIdPromise(data) { - console.info('========ANS_Cancel_2600 onConsume start:=============>'); - console.info('========ANS_Cancel_2600 onConsume data:==============>' + JSON.stringify(data)); - console.info('========ANS_Cancel_2600 onConsume label:=============>' + data.request.label); - console.info('========ANS_Cancel_2600 onConsume id:================>' + data.request.id); - notify.cancel(6666, '6666').then(()=>{ - console.info('=========ANS_Cancel_2600 onConsume cancel then======>'); - }).catch((err)=>{ - console.info('=========ANS_Cancel_2600 onConsume cancel catch err======>'+JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - }); - console.info('========ANS_Cancel_2600 onConsume end================>'); - console.info('========ANS_Cancel_2600 onConsume end================>'); - } - function onCancelCancelWrongLabelWrongIdPromise(data) { - console.info('========ANS_Cancel_2600 onCancel start=======================>'); - console.info('========ANS_Cancel_2600 onCancel data:=======================>' + JSON.stringify(data)); - expect().assertFail(); - console.info('========ANS_Cancel_2600 onCancel end=======================>'); - } - - /* - * @tc.number: ANS_Cancel_2600 - * @tc.name: cancel(id: number, label?: string): Promise - * @tc.desc: Verify that the cancel(id: number, label?: string): Promise interface is called, -  the label is wrong and the ID is wrong. - */ - it('ANS_Cancel_2600', 0, async function (done) { - console.info('===============ANS_Cancel_2600 start==========================>'); - let subscriber ={ - onConsume:onConsumeCancelWrongLabelWrongIdPromise, - onCancel:onCancelCancelWrongLabelWrongIdPromise, - } - await notify.subscribe(subscriber); - console.info('===============ANS_Cancel_2600 subscribe promise==================>'); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - id: 26, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: 'statusBarText', - isFloatingIcon : true, - label: '2600', - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info('===============ANS_Cancel_2600 publish promise==================>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_2600 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - /* - * @tc.number: ANS_Cancel_2700 - * @tc.name: cancel(id: number, label?: string): Promise - * @tc.desc: add NotificationTemplate extraInfo template badgeNumber - */ - it('ANS_Cancel_2700', 0, async function (done) { - console.info('===============ANS_Cancel_2700 start==========================>'); - let subscriber ={ - onConsume:onConsumeCancelWrongLabelWrongIdPromise, - onCancel:onCancelCancelWrongLabelWrongIdPromise, - } - await notify.subscribe(subscriber); - console.info('===============ANS_Cancel_2700 subscribe promise==================>'); - let NotificationTemplate = { - name:'/system/etc/notification_template/assets/js/downloadTemplate.js', - data:{key3:"789",key4:"111"} - } - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - extraInfo:{ - key1: "1231", - key2:"456" - }, - template:NotificationTemplate, - badgeNumber:1, - } - await notify.publish(notificationRequest); - console.info('===============ANS_Cancel_2700 publish promise==================>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_2700 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) - - /* - * @tc.number: ANS_Cancel_2800 - * @tc.name: cancel(id: number, label?: string): Promise - * @tc.desc: add creatorPid - */ - it('ANS_Cancel_2800', 0, async function (done) { - console.info('===============ANS_Cancel_2800 start==========================>'); - let subscriber ={ - onConsume:onConsumeCancelWrongLabelWrongIdPromise, - onCancel:onCancelCancelWrongLabelWrongIdPromise, - } - await notify.subscribe(subscriber); - console.info('===============ANS_Cancel_2800 subscribe promise==================>'); - - let NotificationTemplate = { - name:'/system/etc/notification_template/assets/js/downloadTemplate.js', - data:{key3:"789",key4:"111"} - } - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'test_title', - text: 'test_text', - additionalText: 'test_additionalText' - }, - }, - extraInfo:{ - key1: "1231", - key2:"456" - }, - template:NotificationTemplate, - creatorPid:1, - } - await notify.publish(notificationRequest); - console.info('===============ANS_Cancel_2800 publish promise==================>'); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info('======ANS_Cancel_2800 setTimeout unsubscribe end==================>'); - done(); - }),timeout); - }) -}) } diff --git a/notification/ans_standard/actsansnotificationcancel/src/main/js/test/List.test.js b/notification/ans_standard/actsansnotificationcancel/src/main/js/test/List.test.js deleted file mode 100644 index 2987240b11b561edef38f8cc535ca6145017e2ff..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansnotificationcancel/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import ActsAnsNotificationCancel from './ActsAnsNotificationCancel.test.js' -export default function testsuite() { -ActsAnsNotificationCancel() -} diff --git a/notification/ans_standard/actsansnotificationcancel/src/main/resources/base/element/string.json b/notification/ans_standard/actsansnotificationcancel/src/main/resources/base/element/string.json deleted file mode 100644 index 35e963197206eb6c56d82195c63adae9f0417de3..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansnotificationcancel/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "cancel" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansnotificationcancel/src/main/resources/base/media/icon.png b/notification/ans_standard/actsansnotificationcancel/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansnotificationcancel/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/actsansslottest/BUILD.gn b/notification/ans_standard/actsansslottest/BUILD.gn deleted file mode 100644 index a30e1a942d6509e6972bec7a76a9304ea3382f27..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/BUILD.gn +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -group("ActsAnsSlotTest") { - testonly = true - if (is_standard_system) { - deps = [ - "actsansgetslotWithoutadd:ActsAnsGetSlotWithoutAddTest", - "actsansgetslottestcallback:ActsAnsGetSlotTestCallbackTest", - "actsansgetslottestpromise:ActsAnsGetSlotTestPromiseTest", - "actsansremoveslottest:ActsAnsRemoveSlotTest", - "actsansremoveslotwithoutadd:ActsAnsRemoveSlotWithoutAddTest", - - #"actsansslotbybundle:ActsAnsSlotByBundleTest", - #"actsansaddslotsystem:ActsAnsAddSlotSystemTest", - #"actsansslotsystemcallback:ActsAnsSlotSystemCallbackTest", - #"actsansslotsystempromise:ActsAnsSlotSystemPromiseTest", - #"actsansslottaddremoveall:ActsAnsSlotAddRemoveAllTest", - ] - } -} diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/BUILD.gn b/notification/ans_standard/actsansslottest/actsansaddslotsystem/BUILD.gn deleted file mode 100644 index a06dca840a62a3f38fd7e224ae7ca270f57b0bf0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansaddslotsystem/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsAddSlotSystemTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsAddSlotSystemTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/Test.json b/notification/ans_standard/actsansslottest/actsansaddslotsystem/Test.json deleted file mode 100644 index b8fa7368c7a5e4ff49909277fe545b40d7e36fef..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansaddslotsystem/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "60000", - "shell-timeout": "60000", - "bundle-name": "com.example.actsansaddslotsystem", - "package-name": "com.example.actsansaddslotsystem" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsAddSlotSystemTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/signature/openharmony_sx.p7b b/notification/ans_standard/actsansslottest/actsansaddslotsystem/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansslottest/actsansaddslotsystem/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/config.json b/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/config.json deleted file mode 100644 index ea585470ff6d36a8a94abc6766caddaadbc9bbfb..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansaddslotsystem", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansaddslotsystem", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/MainAbility/app.js b/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index cc183ba6f171c0a02e11f8a2eecdf4247d8c8bc2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - {{title}} - -
diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index f0ebbb56e9c9e2005c19b0e217bbc45c02128396..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "测试addSlot(slot: NotificationSlot)接口" - }, - onInit() { - this.title = "测试addSlot(slot: NotificationSlot)接口"; - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - }, -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestAbility/app.js b/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/test/ExampleJsunit.test.js deleted file mode 100644 index 5d0258ca1a74182ee4e59c8158385613263d2964..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/test/ExampleJsunit.test.js +++ /dev/null @@ -1,483 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import notification from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' - -const TIMEOUT = 2000; -export default function ActsAnsAddSlotSystem() { -describe('ActsAnsAddSlotSystem', function () { - - /* - * @tc.number : ActsAnsAddSlotSystem_0100 - * @tc.name : addSlot notification - * @tc.desc : Get the added SOCIAL_COMMUNICATION type slot - */ - it('ActsAnsAddSlotSystem_0100', 0, async function (done) { - console.debug("====>ActsAnsAddSlotSystem_0100 start====>"); - function getSlotCallback(err, data) { - console.debug("====>ActsAnsAddSlotSystem_0100 enter====>"); - console.debug("====>getSlot 0100 err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlot 0100 data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data.level).assertEqual(notification.SlotLevel.LEVEL_NONE); - expect(data.desc).assertEqual("slot_SOCIAL_COMMUNICATION_desc"); - expect(data.badgeFlag).assertEqual(false); - expect(data.bypassDnd).assertEqual(true); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual("slot_SOCIAL_COMMUNICATION_sound"); - expect(data.lightEnabled).assertEqual(true); - expect(data.lightColor).assertEqual(1); - notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ - console.debug("====>removeSlot ActsAnsAddSlotSystem_0100 err====>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - done(); - }) - } - console.debug("====>addSlot SOCIAL_COMMUNICATION====>"); - notification.addSlot( - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: notification.SlotLevel.LEVEL_NONE, - desc: "slot_SOCIAL_COMMUNICATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SOCIAL_COMMUNICATION_sound", - lightEnabled: true, - lightColor: 1 - }, - (err)=>{ - console.debug("====>addSlot SOCIAL_COMMUNICATION callback====>"); - expect(err.code).assertEqual(0); - console.debug("====>getSlot SlotType.SOCIAL_COMMUNICATION====>"); - notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION, getSlotCallback); - }) - setTimeout(function(){ - console.debug("====>time out ActsAnsAddSlotSystem_0100====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsAddSlotSystem_0200 - * @tc.name : addSlot notification - * @tc.desc : Get the added SERVICE_INFORMATION type slot - */ - it('ActsAnsAddSlotSystem_0200', 0, async function (done) { - console.debug("====>ActsAnsAddSlotSystem_0200 start====>"); - function getSlotCallback(err, data) { - console.debug("====>ActsAnsAddSlotSystem_0200 enter====>"); - console.debug("====>getSlot 0200 err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlot 0200 data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.SERVICE_INFORMATION); - expect(data.level).assertEqual(notification.SlotLevel.LEVEL_MIN); - expect(data.desc).assertEqual("slot_SERVICE_INFORMATION_desc"); - expect(data.badgeFlag).assertEqual(false); - expect(data.bypassDnd).assertEqual(true); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual("slot_SERVICE_INFORMATION_sound"); - expect(data.lightEnabled).assertEqual(true); - expect(data.lightColor).assertEqual(2); - notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ - console.debug("====>removeSlot ActsAnsAddSlotSystem_0200 err====>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - done(); - }) - } - console.debug("====>addSlot SERVICE_INFORMATION====>"); - notification.addSlot( - { - type: notification.SlotType.SERVICE_INFORMATION, - level: notification.SlotLevel.LEVEL_MIN, - desc: "slot_SERVICE_INFORMATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SERVICE_INFORMATION_sound", - lightEnabled: true, - lightColor: 2 - }, - (err)=>{ - console.debug("====>addSlot SERVICE_INFORMATION callback====>"); - expect(err.code).assertEqual(0); - console.debug("====>getSlot SlotType.SERVICE_INFORMATION====>"); - notification.getSlot(notification.SlotType.SERVICE_INFORMATION, getSlotCallback); - }) - setTimeout(function(){ - console.debug("====>time out ActsAnsAddSlotSystem_0200====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsAddSlotSystem_0300 - * @tc.name : addSlot notification - * @tc.desc : Get the added CONTENT_INFORMATION type slot - */ - it('ActsAnsAddSlotSystem_0300', 0, async function (done) { - console.debug("====>ActsAnsAddSlotSystem_0300 start====>"); - function getSlotCallback(err, data) { - console.debug("====>ActsAnsAddSlotSystem_0300 enter====>"); - console.debug("====>getSlot 0300 err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlot 0300 data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.CONTENT_INFORMATION); - expect(data.level).assertEqual(notification.SlotLevel.LEVEL_LOW); - expect(data.desc).assertEqual("slot_CONTENT_INFORMATION_desc"); - expect(data.badgeFlag).assertEqual(false); - expect(data.bypassDnd).assertEqual(true); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual("slot_CONTENT_INFORMATION_sound"); - expect(data.lightEnabled).assertEqual(true); - expect(data.lightColor).assertEqual(3); - notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ - console.debug("====>removeSlot ActsAnsAddSlotSystem_0300 err====>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - done(); - }) - } - console.debug("====>addSlot CONTENT_INFORMATION====>"); - notification.addSlot( - { - type: notification.SlotType.CONTENT_INFORMATION, - level: notification.SlotLevel.LEVEL_LOW, - desc: "slot_CONTENT_INFORMATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_CONTENT_INFORMATION_sound", - lightEnabled: true, - lightColor: 3 - }, - (err)=>{ - console.debug("====>addSlot CONTENT_INFORMATION callback====>"); - expect(err.code).assertEqual(0); - console.debug("====>getSlot SlotType.CONTENT_INFORMATION====>"); - notification.getSlot(notification.SlotType.CONTENT_INFORMATION, getSlotCallback); - }) - setTimeout(function(){ - console.debug("====>time out ActsAnsAddSlotSystem_0300====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsAddSlotSystem_0400 - * @tc.name : addSlot notification - * @tc.desc : Get the added OTHER_TYPES type slot - */ - it('ActsAnsAddSlotSystem_0400', 0, async function (done) { - console.debug("====>ActsAnsAddSlotSystem_0400 start====>"); - function getSlotCallback(err, data) { - console.debug("====>ActsAnsAddSlotSystem_0400 enter====>"); - console.debug("====>getSlot 0400 err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlot 0400 data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data.level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); - expect(data.desc).assertEqual("slot_OTHER_TYPES_desc"); - expect(data.badgeFlag).assertEqual(false); - expect(data.bypassDnd).assertEqual(true); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual("slot_OTHER_TYPES_sound"); - expect(data.lightEnabled).assertEqual(true); - expect(data.lightColor).assertEqual(4); - notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ - console.debug("====>removeSlot ActsAnsAddSlotSystem_0400 err====>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - done(); - }) - } - console.debug("====>addSlot OTHER_TYPES====>"); - notification.addSlot( - { - type: notification.SlotType.OTHER_TYPES, - level: notification.SlotLevel.LEVEL_DEFAULT, - desc: "slot_OTHER_TYPES_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_OTHER_TYPES_sound", - lightEnabled: true, - lightColor: 4 - }, - (err)=>{ - console.debug("====>addSlot OTHER_TYPES callback====>"); - expect(err.code).assertEqual(0); - notification.getSlot(notification.SlotType.OTHER_TYPES, getSlotCallback); - }) - console.debug("====>getSlot SlotType.OTHER_TYPES====>"); - - setTimeout(function(){ - console.debug("====>time out ActsAnsAddSlotSystem_0400====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsAddSlotSystem_0500 - * @tc.name : addSlot notification - * @tc.desc : Get the added UNKNOWN_TYPE type slot - */ - it('ActsAnsAddSlotSystem_0500', 0, async function (done) { - console.debug("====>ActsAnsAddSlotSystem_0500 start====>"); - function getSlotCallback(err, data) { - console.debug("====>ActsAnsAddSlotSystem_0500 enter====>"); - console.debug("====>getSlot 0500 err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlot 0500 data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data.level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); - expect(data.desc).assertEqual("slot_OTHER_TYPES_desc"); - expect(data.badgeFlag).assertEqual(false); - expect(data.bypassDnd).assertEqual(true); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual("slot_OTHER_TYPES_sound"); - expect(data.lightEnabled).assertEqual(true); - expect(data.lightColor).assertEqual(4); - notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ - console.debug("====>removeSlot ActsAnsAddSlotSystem_0500 err====>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - done(); - }) - } - console.debug("====>addSlot UNKNOWN_TYPE====>"); - await notification.addSlot( - { - type: notification.SlotType.UNKNOWN_TYPE, - level: notification.SlotLevel.LEVEL_DEFAULT, - desc: "slot_OTHER_TYPES_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_OTHER_TYPES_sound", - lightEnabled: true, - lightColor: 4 - }, - (err)=>{ - console.debug("====>addSlot UNKNOWN_TYPE callback====>"); - expect(err.code).assertEqual(0); - console.debug("====>getSlot SlotType.UNKNOWN_TYPE====>"); - notification.getSlot(notification.SlotType.UNKNOWN_TYPE, getSlotCallback); - }) - setTimeout(function(){ - console.debug("====>time out ActsAnsAddSlotSystem_0500====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsAddSlotSystem_0600 - * @tc.name : addSlot notification promise - * @tc.desc : Get the added SOCIAL_COMMUNICATION type slot - */ - it('ActsAnsAddSlotSystem_0600', 0, async function (done) { - console.debug("====>ActsAnsAddSlotSystem_0600 start====>"); - console.debug("====>addSlot SOCIAL_COMMUNICATION====>"); - await notification.addSlot( - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: notification.SlotLevel.LEVEL_NONE, - desc: "slot_SOCIAL_COMMUNICATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SOCIAL_COMMUNICATION_sound", - lightEnabled: true, - lightColor: 1 - }); - console.debug("====>getSlot SlotType.SOCIAL_COMMUNICATION====>"); - var data = await notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION); - console.debug("====>getSlot 0600 data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data.level).assertEqual(notification.SlotLevel.LEVEL_NONE); - expect(data.desc).assertEqual("slot_SOCIAL_COMMUNICATION_desc"); - expect(data.badgeFlag).assertEqual(false); - expect(data.bypassDnd).assertEqual(true); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual("slot_SOCIAL_COMMUNICATION_sound"); - expect(data.lightEnabled).assertEqual(true); - expect(data.lightColor).assertEqual(1); - console.debug("====>removeSlot ActsAnsAddSlotSystem_0600 start====>"); - await notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION); - console.debug("====>ActsAnsAddSlotSystem_0600 end====>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsAnsAddSlotSystem_0600====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsAddSlotSystem_0700 - * @tc.name : addSlot notification promise - * @tc.desc : Get the added SERVICE_INFORMATION type slot - */ - it('ActsAnsAddSlotSystem_0700', 0, async function (done) { - console.debug("====>ActsAnsAddSlotSystem_0700 start====>"); - console.debug("====>addSlot SERVICE_INFORMATION====>"); - await notification.addSlot( - { - type: notification.SlotType.SERVICE_INFORMATION, - level: notification.SlotLevel.LEVEL_MIN, - desc: "slot_SERVICE_INFORMATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SERVICE_INFORMATION_sound", - lightEnabled: true, - lightColor: 2 - }); - console.debug("====>getSlot SlotType.SERVICE_INFORMATION====>"); - var data = await notification.getSlot(notification.SlotType.SERVICE_INFORMATION); - console.debug("====>getSlot 0700 data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.SERVICE_INFORMATION); - expect(data.level).assertEqual(notification.SlotLevel.LEVEL_MIN); - expect(data.desc).assertEqual("slot_SERVICE_INFORMATION_desc"); - expect(data.badgeFlag).assertEqual(false); - expect(data.bypassDnd).assertEqual(true); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual("slot_SERVICE_INFORMATION_sound"); - expect(data.lightEnabled).assertEqual(true); - expect(data.lightColor).assertEqual(2); - console.debug("====>removeSlot ActsAnsAddSlotSystem_0700 start====>"); - await notification.removeSlot(notification.SlotType.SERVICE_INFORMATION); - console.debug("====>ActsAnsAddSlotSystem_0700 end====>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsAnsAddSlotSystem_0700====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsAddSlotSystem_0800 - * @tc.name : addSlot notification promise - * @tc.desc : Get the added CONTENT_INFORMATION type slot - */ - it('ActsAnsAddSlotSystem_0800', 0, async function (done) { - console.debug("====>ActsAnsAddSlotSystem_0800 start====>"); - console.debug("====>addSlot CONTENT_INFORMATION====>"); - await notification.addSlot( - { - type: notification.SlotType.CONTENT_INFORMATION, - level: notification.SlotLevel.LEVEL_LOW, - desc: "slot_CONTENT_INFORMATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_CONTENT_INFORMATION_sound", - lightEnabled: true, - lightColor: 3 - }); - console.debug("====>getSlot SlotType.CONTENT_INFORMATION====>"); - var data = await notification.getSlot(notification.SlotType.CONTENT_INFORMATION); - console.debug("====>getSlot 0800 data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.CONTENT_INFORMATION); - expect(data.level).assertEqual(notification.SlotLevel.LEVEL_LOW); - expect(data.desc).assertEqual("slot_CONTENT_INFORMATION_desc"); - expect(data.badgeFlag).assertEqual(false); - expect(data.bypassDnd).assertEqual(true); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual("slot_CONTENT_INFORMATION_sound"); - expect(data.lightEnabled).assertEqual(true); - expect(data.lightColor).assertEqual(3); - console.debug("====>removeSlot ActsAnsAddSlotSystem_0800 start====>"); - await notification.removeSlot(notification.SlotType.CONTENT_INFORMATION); - console.debug("====>ActsAnsAddSlotSystem_0800 end====>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsAnsAddSlotSystem_0800====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsAddSlotSystem_0900 - * @tc.name : addSlot notification promise - * @tc.desc : Get the added OTHER_TYPES type slot - */ - it('ActsAnsAddSlotSystem_0900', 0, async function (done) { - console.debug("====>ActsAnsAddSlotSystem_0900 start====>"); - console.debug("====>addSlot OTHER_TYPES====>"); - await notification.addSlot( - { - type: notification.SlotType.OTHER_TYPES, - level: notification.SlotLevel.LEVEL_DEFAULT, - desc: "slot_OTHER_TYPES_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_OTHER_TYPES_sound", - lightEnabled: true, - lightColor: 4 - }) - console.debug("====>getSlot SlotType.OTHER_TYPES====>"); - var data = await notification.getSlot(notification.SlotType.OTHER_TYPES); - console.debug("====>getSlot 0900 data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data.level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); - expect(data.desc).assertEqual("slot_OTHER_TYPES_desc"); - expect(data.badgeFlag).assertEqual(false); - expect(data.bypassDnd).assertEqual(true); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual("slot_OTHER_TYPES_sound"); - expect(data.lightEnabled).assertEqual(true); - expect(data.lightColor).assertEqual(4); - console.debug("====>removeSlot ActsAnsAddSlotSystem_0900 start====>"); - await notification.removeSlot(notification.SlotType.OTHER_TYPES); - console.debug("====>ActsAnsAddSlotSystem_0900 end====>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsAnsAddSlotSystem_0900====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsAddSlotSystem_1000 - * @tc.name : addSlot notification promise - * @tc.desc : Get the added UNKNOWN_TYPE type slot - */ - it('ActsAnsAddSlotSystem_1000', 0, async function (done) { - console.debug("====>ActsAnsAddSlotSystem_1000 start====>"); - console.debug("====>addSlot UNKNOWN_TYPE====>"); - await notification.addSlot( - { - type: notification.SlotType.UNKNOWN_TYPE, - level: notification.SlotLevel.LEVEL_DEFAULT, - desc: "slot_OTHER_TYPES_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_OTHER_TYPES_sound", - lightEnabled: true, - lightColor: 4 - }); - console.debug("====>getSlot SlotType.UNKNOWN_TYPE====>"); - var data = await notification.getSlot(notification.SlotType.UNKNOWN_TYPE); - console.debug("====>getSlot enter====>"); - console.debug("====>getSlot data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data.level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); - expect(data.desc).assertEqual("slot_OTHER_TYPES_desc"); - expect(data.badgeFlag).assertEqual(false); - expect(data.bypassDnd).assertEqual(true); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual("slot_OTHER_TYPES_sound"); - expect(data.lightEnabled).assertEqual(true); - expect(data.lightColor).assertEqual(4); - console.debug("====>removeSlot ActsAnsAddSlotSystem_1000 start====>"); - await notification.removeSlot(notification.SlotType.OTHER_TYPES); - console.debug("====>ActsAnsAddSlotSystem_1000 end====>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsAnsAddSlotSystem_1000====>"); - }, TIMEOUT); - }) -}) } diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/test/List.test.js b/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/test/List.test.js deleted file mode 100644 index dc2da888b55e094987a37fd8fecf5909adbc0041..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsAddSlotSystem from './ExampleJsunit.test.js' -export default function testsuite() { -ActsAnsAddSlotSystem() -} diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/resources/base/element/string.json b/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/resources/base/element/string.json deleted file mode 100644 index 2dcfb5308faba77d2fb41377affca465e5ae746b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ActsAnsSlotSystemCallback" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/resources/base/media/icon.png b/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansslottest/actsansaddslotsystem/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/BUILD.gn b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/BUILD.gn deleted file mode 100644 index c75be1431bc9169d344e36f74dd6bbc1d75f9e3f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsGetSlotWithoutAddTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsGetSlotWithoutAddTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/Test.json b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/Test.json deleted file mode 100644 index 4bd5e35be15bc0260521d127be6ac4261cceb950..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "60000", - "shell-timeout": "60000", - "bundle-name": "com.example.actsansgetslotwithoutadd", - "package-name": "com.example.actsansgetslotwithoutadd" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsGetSlotWithoutAddTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/signature/openharmony_sx.p7b b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/config.json b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/config.json deleted file mode 100644 index 2c4127306e13cdda6b029dd49c86856868b14c98..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansgetslotwithoutadd", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansgetslotwithoutadd", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/MainAbility/app.js b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 95b3afa04dd4bba8c34ad3086534adb6c28cfa3c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - {{title}} - -
diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index cc130bfa4ce4e63743bfec03df97c79f1429cbae..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "测试GetSlot接口" - }, - onInit() { - this.title = "测试GetSlot接口"; - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - }, -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestAbility/app.js b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/test/ExampleJsunit.test.js deleted file mode 100644 index 93e108c6661199416c02c88aee71374071dce108..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/test/ExampleJsunit.test.js +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import notification from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' - -const TIMEOUT = 2000; -export default function ActsAnsGetSlotWithoutAdd() { -describe('ActsAnsGetSlotWithoutAdd', function () { - - /* - * @tc.number : ActsAnsGetSlotWithoutAdd_0100 - * @tc.name : getSlot by type callback - * @tc.desc : Get the SOCIAL_COMMUNICATION type slot without adding - */ - it('ActsAnsGetSlotWithoutAdd_0100', 0, async function (done) { - console.debug("====>ActsAnsGetSlotWithoutAdd_0100 start====>"); - function getSlotCallback(err, data) { - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0100 enter====>"); - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0100 err:" + JSON.stringify(err)); - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0100 data:" + JSON.stringify(data)); - expect(err.code != 0).assertEqual(true); - done(); - } - console.debug("====>getSlot callback SlotType.SOCIAL_COMMUNICATION====>"); - await notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION, getSlotCallback); - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotWithoutAdd_0100====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsGetSlotWithoutAdd_0200 - * @tc.name : getSlot by type callback - * @tc.desc : Get the SERVICE_INFORMATION type slot without adding - */ - it('ActsAnsGetSlotWithoutAdd_0200', 0, async function (done) { - console.debug("====>ActsAnsGetSlotWithoutAdd_0200 start====>"); - function getSlotCallback(err, data) { - console.debug("====>ActsAnsGetSlotWithoutAdd_0200 enter====>"); - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0200 err:" + JSON.stringify(err)); - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0200 data:" + JSON.stringify(data)); - expect(err.code != 0).assertEqual(true); - done(); - } - console.debug("====>getSlot callback SlotType.SERVICE_INFORMATION====>"); - await notification.getSlot(notification.SlotType.SERVICE_INFORMATION, getSlotCallback); - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotWithoutAdd_0200====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsGetSlotWithoutAdd_0300 - * @tc.name : getSlot by type callback - * @tc.desc : Get the CONTENT_INFORMATION type slot without adding - */ - it('ActsAnsGetSlotWithoutAdd_0300', 0, async function (done) { - console.debug("====>ActsAnsGetSlotWithoutAdd_0300 start====>"); - function getSlotCallback(err, data) { - console.debug("====>ActsAnsGetSlotWithoutAdd_0300 enter====>"); - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0300 err:" + JSON.stringify(err)); - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0300 data:" + JSON.stringify(data)); - expect(err.code != 0).assertEqual(true); - done(); - } - console.debug("====>getSlot callback SlotType.CONTENT_INFORMATION====>"); - await notification.getSlot(notification.SlotType.CONTENT_INFORMATION, getSlotCallback); - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotWithoutAdd_0300====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsGetSlotWithoutAdd_0400 - * @tc.name : getSlot by type callback - * @tc.desc : Get the OTHER_TYPES type slot without adding - */ - it('ActsAnsGetSlotWithoutAdd_0400', 0, async function (done) { - console.debug("====>ActsAnsGetSlotWithoutAdd_0400 start====>"); - function getSlotCallback(err, data) { - console.debug("====>ActsAnsGetSlotWithoutAdd_0400 enter====>"); - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0400 err:" + JSON.stringify(err)); - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0400 data:" + JSON.stringify(data)); - expect(err.code != 0).assertEqual(true); - done(); - } - console.debug("====>getSlot callback SlotType.OTHER_TYPES====>"); - await notification.getSlot(notification.SlotType.OTHER_TYPES, getSlotCallback); - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotWithoutAdd_0400====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsGetSlotWithoutAdd_0500 - * @tc.name : getSlot by type callback - * @tc.desc : Get the UNKNOWN_TYPE type slot without adding - */ - it('ActsAnsGetSlotWithoutAdd_0500', 0, async function (done) { - console.debug("====>ActsAnsGetSlotWithoutAdd_0500 start====>"); - function getSlotCallback(err, data) { - console.debug("====>ActsAnsGetSlotWithoutAdd_0500 enter====>"); - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0500 err:" + JSON.stringify(err)); - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0500 data:" + JSON.stringify(data)); - expect(err.code != 0).assertEqual(true); - done(); - } - console.debug("====>getSlot callback SlotType.UNKNOWN_TYPE====>"); - await notification.getSlot(notification.SlotType.UNKNOWN_TYPE, getSlotCallback); - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotWithoutAdd_0500====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsGetSlotWithoutAdd_0600 - * @tc.name : getSlot by type promise - * @tc.desc : Get the SOCIAL_COMMUNICATION type slot without adding - */ - it('ActsAnsGetSlotWithoutAdd_0600', 0, async function (done) { - console.debug("====>ActsAnsGetSlotWithoutAdd_0600 start====>"); - console.debug("====>getSlot SlotType.SOCIAL_COMMUNICATION====>"); - notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION).then((data)=>{ - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0600 enter====>"); - expect().assertFail(); - done(); - }).catch((err)=>{ - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0600 err:" + JSON.stringify(err)); - console.debug("====>ActsAnsGetSlotWithoutAdd_0600 end====>"); - expect(err.code != 0).assertEqual(true); - done(); - }) - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotWithoutAdd_0600====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsGetSlotWithoutAdd_0700 - * @tc.name : getSlot by type promise - * @tc.desc : Get the SERVICE_INFORMATION type slot without adding - */ - it('ActsAnsGetSlotWithoutAdd_0700', 0, async function (done) { - console.debug("====>ActsAnsGetSlotWithoutAdd_0700 start====>"); - console.debug("====>getSlot SlotType.SERVICE_INFORMATION====>"); - notification.getSlot(notification.SlotType.SERVICE_INFORMATION).then((data)=>{ - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0700 enter====>"); - expect().assertFail(); - done(); - }).catch((err)=>{ - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0700 err:" + JSON.stringify(err)); - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0700 end====>"); - expect(err.code != 0).assertEqual(true); - done(); - }) - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotWithoutAdd_0700====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsGetSlotWithoutAdd_0800 - * @tc.name : getSlot by type promise - * @tc.desc : Get the UNKNOWN_TYPE type slot without adding - */ - it('ActsAnsGetSlotWithoutAdd_0800', 0, async function (done) { - console.debug("====>ActsAnsGetSlotWithoutAdd_0800 start====>"); - console.debug("====>getSlot SlotType.UNKNOWN_TYPE====>"); - notification.getSlot(notification.SlotType.UNKNOWN_TYPE).then((data)=>{ - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0800 enter====>"); - expect().assertFail(); - done(); - }).catch((err)=>{ - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0800 err:" + JSON.stringify(err)); - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0800 end====>"); - expect(err.code != 0).assertEqual(true); - done(); - }) - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotWithoutAdd_0800====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsGetSlotWithoutAdd_0900 - * @tc.name : getSlot by type promise - * @tc.desc : Get the OTHER_TYPES type slot without adding - */ - it('ActsAnsGetSlotWithoutAdd_0900', 0, async function (done) { - console.debug("====>ActsAnsGetSlotWithoutAdd_0900 start====>"); - console.debug("====>getSlot SlotType.OTHER_TYPES====>"); - notification.getSlot(notification.SlotType.OTHER_TYPES).then((data)=>{ - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0900 enter====>"); - expect().assertFail(); - done(); - }).catch((err)=>{ - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0900 err:" + JSON.stringify(err)); - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_0900 end====>"); - expect(err.code != 0).assertEqual(true); - done(); - }) - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotWithoutAdd_0900====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsGetSlotWithoutAdd_1000 - * @tc.name : getSlot by type promise - * @tc.desc : Get the CONTENT_INFORMATION type slot without adding - */ - it('ActsAnsGetSlotWithoutAdd_1000', 0, async function (done) { - console.debug("====>ActsAnsGetSlotWithoutAdd_1000 start====>"); - console.debug("====>getSlot SlotType.CONTENT_INFORMATION====>"); - notification.getSlot(notification.SlotType.CONTENT_INFORMATION).then((data)=>{ - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_1000 enter====>"); - expect().assertFail(); - done(); - }).catch((err)=>{ - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_1000 err:" + JSON.stringify(err)); - console.debug("====>getSlot ActsAnsGetSlotWithoutAdd_1000 end====>"); - expect(err.code != 0).assertEqual(true); - done(); - }) - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotWithoutAdd_1000====>"); - }, TIMEOUT); - }) -}) } diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/test/List.test.js b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/test/List.test.js deleted file mode 100644 index a616371fd65724cadf202bf6db048038750ace57..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsGetSlotWithoutAdd from './ExampleJsunit.test.js' -export default function testsuite() { -ActsAnsGetSlotWithoutAdd() -} diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/resources/base/element/string.json b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/resources/base/element/string.json deleted file mode 100644 index 63151edc575cbac002b4a8febea73d6541548cc6..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ActsAnsSlotSystemPromise" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/resources/base/media/icon.png b/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansslottest/actsansgetslotWithoutadd/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/BUILD.gn b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/BUILD.gn deleted file mode 100644 index da23c5d6b94f0ef8028239ea93ae14008a9deecb..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsGetSlotTestCallbackTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsGetSlotTestCallbackTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/Test.json b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/Test.json deleted file mode 100644 index 61354aea5e3f2e30858b03f776e2f2c0a41c7162..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "60000", - "shell-timeout": "60000", - "bundle-name": "com.example.actsansgetslottestcallback", - "package-name": "com.example.actsansgetslottestcallback" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsGetSlotTestCallbackTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/signature/openharmony_sx.p7b b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/config.json b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/config.json deleted file mode 100644 index ef18767a004cb2e9941f79d8fd41cb92f43a98ab..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansgetslottestcallback", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansgetslottestcallback", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/MainAbility/app.js b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index cc183ba6f171c0a02e11f8a2eecdf4247d8c8bc2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - {{title}} - -
diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index fe0d3124a704e40ff8f338eac0fdf99c22ee6879..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "测试GetSlot接口:callback形式" - }, - onInit() { - this.title = "测试GetSlot接口:callback形式"; - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - }, -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestAbility/app.js b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/test/ExampleJsunit.test.js deleted file mode 100644 index 3e9a3e6630fd4413022600e67bbb3b2b2071b50b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/test/ExampleJsunit.test.js +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import notification from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' - -const TIMEOUT = 2000; -const SOUNDURL = "file://system/etc/Light.ogg"; -export default function ActsAnsGetSlotTestCallback() { -describe('ActsAnsGetSlotTestCallback', function () { - - /* - * @tc.number : ActsAnsGetSlotTestCallback_0100 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : Get the SOCIAL_COMMUNICATION type slot after adding - */ - it('ActsAnsGetSlotTestCallback_0100', 0, async function (done) { - console.debug("====>ActsAnsGetSlotTestCallback_0100 start====>"); - console.debug("====>addSlot SlotType.SOCIAL_COMMUNICATION start====>"); - notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ - console.debug("====>addSlot 0100 enter====>"); - console.debug("====>addSlot 0100 err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlot SlotType.SOCIAL_COMMUNICATION start====>"); - notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err, data)=>{ - console.debug("====>getSlot 0100 enter====>"); - console.debug("====>getSlot 0100 err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlot ActsAnsGetSlotTestCallback_0100 data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data.level).assertEqual(4); - expect(data.desc).assertEqual(""); - expect(data.badgeFlag).assertEqual(true); - expect(data.bypassDnd).assertEqual(false); - expect(data.lockscreenVisibility).assertEqual(2); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual(SOUNDURL); - expect(data.lightEnabled).assertEqual(false); - expect(data.lightColor).assertEqual(0); - console.debug("====>getSlot ActsAnsGetSlotTestCallback_0100 finish====>"); - notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ - console.debug("====>removeSlot SOCIAL_COMMUNICATION enter====>"); - expect(err.code).assertEqual(0); - done(); - }) - }); - }); - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotTestCallback_0100====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsGetSlotTestCallback_0200 - * @tc.name : Verify getSlot SERVICE_INFORMATION - * @tc.desc : Get the SERVICE_INFORMATION type slot after adding - */ - it('ActsAnsGetSlotTestCallback_0200', 0, async function (done) { - console.debug("====>ActsAnsGetSlotTestCallback_0200 start====>"); - function getSlotCallbackSecond(err, data) { - console.debug("====>getSlot ActsAnsGetSlotTestCallback_0200 enter====>"); - console.debug("====>getSlot ActsAnsGetSlotTestCallback_0200 err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlot ActsAnsGetSlotTestCallback_0200 data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.SERVICE_INFORMATION); - expect(data.level).assertEqual(3); - expect(data.desc).assertEqual(""); - expect(data.badgeFlag).assertEqual(true); - expect(data.bypassDnd).assertEqual(false); - expect(data.lockscreenVisibility).assertEqual(2); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual(SOUNDURL); - expect(data.lightEnabled).assertEqual(false); - expect(data.lightColor).assertEqual(0); - console.debug("====>getSlot ActsAnsGetSlotTestCallback_0200 finish====>"); - notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ - console.debug("====>removeSlot SERVICE_INFORMATION enter====>"); - expect(err.code).assertEqual(0); - done(); - }) - } - console.debug("====>addSlot SlotType.SERVICE_INFORMATION start====>"); - notification.addSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ - console.debug("====>addSlot ActsAnsGetSlotTestCallback_0200 enter====>"); - console.debug("====>addSlot ActsAnsGetSlotTestCallback_0200 err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlot SlotType.SERVICE_INFORMATION start====>"); - notification.getSlot(notification.SlotType.SERVICE_INFORMATION, getSlotCallbackSecond); - }); - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotTestCallback_0200====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsGetSlotTestCallback_0300 - * @tc.name : Verify getSlot CONTENT_INFORMATION - * @tc.desc : Get the CONTENT_INFORMATION type slot after adding - */ - it('ActsAnsGetSlotTestCallback_0300', 0, async function (done) { - console.debug("====>ActsAnsGetSlotTestCallback_0300 start====>"); - function getSlotCallbackThird(err, data) { - console.debug("====>getSlot ActsAnsGetSlotTestCallback_0300 enter====>"); - console.debug("====>getSlot ActsAnsGetSlotTestCallback_0300 err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlot ActsAnsGetSlotTestCallback_0300 data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.CONTENT_INFORMATION); - expect(data.level).assertEqual(2); - expect(data.desc).assertEqual(""); - expect(data.badgeFlag).assertEqual(true); - expect(data.bypassDnd).assertEqual(false); - expect(data.lockscreenVisibility).assertEqual(3); - expect(data.vibrationEnabled).assertEqual(false); - expect(data.sound).assertEqual(""); - expect(data.lightEnabled).assertEqual(false); - expect(data.lightColor).assertEqual(0); - console.debug("====>getSlot ActsAnsGetSlotTestCallback_0300 finish====>"); - notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ - console.debug("====>removeSlot CONTENT_INFORMATION enter====>"); - expect(err.code).assertEqual(0); - done(); - }) - } - console.debug("====>addSlot SlotType.CONTENT_INFORMATION start====>"); - notification.addSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ - console.debug("====>addSlotActsAnsGetSlotTestCallback_0300 enter====>"); - console.debug("====>addSlotActsAnsGetSlotTestCallback_0300 err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlot SlotType.CONTENT_INFORMATION start====>"); - notification.getSlot(notification.SlotType.CONTENT_INFORMATION, getSlotCallbackThird); - }); - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotTestCallback_0300====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsGetSlotTestCallback_0400 - * @tc.name : Verify getSlot OTHER_TYPES - * @tc.desc : Get the OTHER_TYPES type slot after adding - */ - it('ActsAnsGetSlotTestCallback_0400', 0, async function (done) { - console.debug("====>ActsAnsGetSlotTestCallback_0400 start====>"); - function getSlotCallbackFourth(err, data) { - console.debug("====>getSlot ActsAnsGetSlotTestCallback_0400 enter====>"); - console.debug("====>getSlot ActsAnsGetSlotTestCallback_0400 err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlot ActsAnsGetSlotTestCallback_0400 data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data.level).assertEqual(1); - expect(data.desc).assertEqual(""); - expect(data.badgeFlag).assertEqual(true); - expect(data.bypassDnd).assertEqual(false); - expect(data.lockscreenVisibility).assertEqual(3); - expect(data.vibrationEnabled).assertEqual(false); - expect(data.sound).assertEqual(""); - expect(data.lightEnabled).assertEqual(false); - expect(data.lightColor).assertEqual(0); - console.debug("====>getSlotActsAnsGetSlotTestCallback_0400 finish====>"); - notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ - console.debug("====>removeSlot OTHER_TYPES enter====>"); - expect(err.code).assertEqual(0); - done(); - }) - } - console.debug("====>addSlot SlotType.OTHER_TYPES start====>"); - notification.addSlot(notification.SlotType.OTHER_TYPES, (err)=>{ - console.debug("====>addSlotActsAnsGetSlotTestCallback_0400 enter====>"); - console.debug("====>addSlotActsAnsGetSlotTestCallback_0400 err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlot SlotType.OTHER_TYPES start====>"); - notification.getSlot(notification.SlotType.OTHER_TYPES, getSlotCallbackFourth); - }); - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotTestCallback_0400====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsGetSlotTestCallback_0500 - * @tc.name : Verify getSlot UNKNOWN_TYPE - * @tc.desc : Get the UNKNOWN_TYPE type slot after adding - */ - it('ActsAnsGetSlotTestCallback_0500', 0, async function (done) { - console.debug("====>ActsAnsGetSlotTestCallback_0500 start====>"); - function getSlotCallbackFifth(err, data) { - console.debug("====>getSlot ActsAnsGetSlotTestCallback_0500 enter====>"); - console.debug("====>getSlot ActsAnsGetSlotTestCallback_0500 err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlot ActsAnsGetSlotTestCallback_0500 data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data.level).assertEqual(1); - expect(data.desc).assertEqual(""); - expect(data.badgeFlag).assertEqual(true); - expect(data.bypassDnd).assertEqual(false); - expect(data.lockscreenVisibility).assertEqual(3); - expect(data.vibrationEnabled).assertEqual(false); - expect(data.sound).assertEqual(""); - expect(data.lightEnabled).assertEqual(false); - expect(data.lightColor).assertEqual(0); - console.debug("====>getSlot ActsAnsGetSlotTestCallback_0500 finish====>"); - notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ - console.debug("====>removeSlot OTHER_TYPES enter====>"); - expect(err.code).assertEqual(0); - done(); - }) - } - console.debug("====>addSlot SlotType.UNKNOWN_TYPE start====>"); - notification.addSlot(notification.SlotType.UNKNOWN_TYPE, (err)=>{ - console.debug("====>addSlotActsAnsGetSlotTestCallback_0500 enter====>"); - console.debug("====>addSlotActsAnsGetSlotTestCallback_0500 err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlot SlotType.UNKNOWN_TYPE start====>"); - notification.getSlot(notification.SlotType.UNKNOWN_TYPE, getSlotCallbackFifth); - }); - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotTestCallback_0500====>"); - }, TIMEOUT); - }) -})} diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/test/List.test.js b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/test/List.test.js deleted file mode 100644 index b9bda7c6538393260d74e300991864e7fd818dba..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsGetSlotTestCallback from './ExampleJsunit.test.js' -export default function testsuite() { -ActsAnsGetSlotTestCallback() -} diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/resources/base/element/string.json b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/resources/base/element/string.json deleted file mode 100644 index e91cd0bd494f3b8587a3c812848da90b42e96e64..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ActsAnsGetSlotTestCallback" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/resources/base/media/icon.png b/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansslottest/actsansgetslottestcallback/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/BUILD.gn b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/BUILD.gn deleted file mode 100644 index c5163654f81cd9bb958f309f742c6b1c1bc5be77..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsGetSlotTestPromiseTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsGetSlotTestPromiseTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/Test.json b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/Test.json deleted file mode 100644 index 0fa940ddfeaf12a379cf1beb588358a63e069627..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "shell-timeout": "180000", - "bundle-name": "com.example.actsansgetslottestpromise", - "package-name": "com.example.actsansgetslottestpromise" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsGetSlotTestPromiseTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/signature/openharmony_sx.p7b b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/config.json b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/config.json deleted file mode 100644 index fd2948e32662f32c55a070b4e7e360bf4f9165bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansgetslottestpromise", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansgetslottestpromise", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/MainAbility/app.js b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 09696c297ee9837d996bd113bf8d41b67f236f7b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - .container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 95b3afa04dd4bba8c34ad3086534adb6c28cfa3c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - {{title}} - -
diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index a1f99ecd22a2e35e0242cda542b029f2abcb94d2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "测试GetSlot接口:promise形式" - }, - onInit() { - this.title = "测试GetSlot接口:promise形式"; - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - }, -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestAbility/app.js b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/test/ExampleJsunit.test.js deleted file mode 100644 index 03faf91e7e71d57cdb663cfd961eb8878b4f523a..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/test/ExampleJsunit.test.js +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import notification from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' - -const TIMEOUT = 2000; -const SOUNDURL = "file://system/etc/Light.ogg"; -export default function ActsAnsGetSlotTestPromise() { -describe('ActsAnsGetSlotTestPromise', function () { - - /* - * @tc.number : ActsAnsGetSlotTestPromise_0100 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : Get the SOCIAL_COMMUNICATION type slot after adding - */ - it('ActsAnsGetSlotTestPromise_0100', 0, async function (done) { - console.debug("====>ActsAnsGetSlotTestPromise_0100 start====>"); - console.debug("====>addSlot SlotType.SOCIAL_COMMUNICATION start====>"); - try{ - await notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION); - } - catch(err){ - console.error("====>addSlotActsAnsGetSlotTestPromise_0100 err:" + JSON.stringify(err)); - expect().assertFail(); - done(); - } - console.debug("====>getSlot SlotType.SOCIAL_COMMUNICATION start====>"); - notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION).then((data) => { - console.debug("====>getSlot ActsAnsGetSlotTestPromise_0100 enter====>"); - console.debug("====>getSlot ActsAnsGetSlotTestPromise_0100 data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data.level).assertEqual(4); - expect(data.desc).assertEqual(""); - expect(data.badgeFlag).assertEqual(true); - expect(data.bypassDnd).assertEqual(false); - expect(data.lockscreenVisibility).assertEqual(2); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual(SOUNDURL); - expect(data.lightEnabled).assertEqual(false); - expect(data.lightColor).assertEqual(0); - console.debug("====>getSlot ActsAnsGetSlotTestPromise_0100 finish====>"); - notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ - console.debug("====>removeSlot SOCIAL_COMMUNICATION err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>ActsAnsGetSlotTestPromise_0100 end====>"); - done(); - }) - }) - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotTestPromise_0100====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsGetSlotTestPromise_0200 - * @tc.name : Verify getSlot SERVICE_INFORMATION - * @tc.desc : Get the SERVICE_INFORMATION type slot after adding - */ - it('ActsAnsGetSlotTestPromise_0200', 0, async function (done) { - console.debug("====>ActsAnsGetSlotTestPromise_0200 start====>"); - console.debug("====>addSlot SlotType.SERVICE_INFORMATION start====>"); - try{ - await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); - } - catch(err){ - console.error("====>addSlot ActsAnsGetSlotTestPromise_0200 err:" + JSON.stringify(err)); - expect().assertFail(); - done(); - } - console.debug("====>getSlot SlotType.SERVICE_INFORMATION start====>"); - notification.getSlot(notification.SlotType.SERVICE_INFORMATION).then((data) => { - console.debug("====>getSlot Promise SERVICE_INFORMATION ActsAnsGetSlotTestPromise_0200 enter====>"); - console.debug("====>getSlot Promise ActsAnsGetSlotTestPromise_0200 data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.SERVICE_INFORMATION); - expect(data.level).assertEqual(3); - expect(data.desc).assertEqual(""); - expect(data.badgeFlag).assertEqual(true); - expect(data.bypassDnd).assertEqual(false); - expect(data.lockscreenVisibility).assertEqual(2); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual(SOUNDURL); - expect(data.lightEnabled).assertEqual(false); - expect(data.lightColor).assertEqual(0); - console.debug("====>getSlot Promise SERVICE_INFORMATION ActsAnsGetSlotTestPromise_0200 finish====>"); - notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ - console.debug("====>removeSlot SERVICE_INFORMATION err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>ActsAnsGetSlotTestPromise_0200 end====>"); - done(); - }) - }) - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotTestPromise_0200====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsGetSlotTestPromise_0300 - * @tc.name : Verify getSlot CONTENT_INFORMATION - * @tc.desc : Get the CONTENT_INFORMATION type slot after adding - */ - it('ActsAnsGetSlotTestPromise_0300', 0, async function (done) { - console.debug("====>ActsAnsGetSlotTestPromise_0300 Promise start====>"); - console.debug("====>addSlot SlotType.CONTENT_INFORMATION start====>"); - try{ - await notification.addSlot(notification.SlotType.CONTENT_INFORMATION); - } - catch(err){ - console.error("====>addSlot ActsAnsGetSlotTestPromise_0300 err:" + JSON.stringify(err)); - expect().assertFail(); - done(); - } - console.debug("====>getSlot SlotType.CONTENT_INFORMATION start====>"); - notification.getSlot(notification.SlotType.CONTENT_INFORMATION).then((data) => { - console.debug("====>getSlot Promise CONTENT_INFORMATION ActsAnsGetSlotTestPromise_0300 enter====>"); - console.debug("====>getSlot Promise ActsAnsGetSlotTestPromise_0300 data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.CONTENT_INFORMATION); - expect(data.level).assertEqual(2); - expect(data.desc).assertEqual(""); - expect(data.badgeFlag).assertEqual(true); - expect(data.bypassDnd).assertEqual(false); - expect(data.lockscreenVisibility).assertEqual(3); - expect(data.vibrationEnabled).assertEqual(false); - expect(data.sound).assertEqual(""); - expect(data.lightEnabled).assertEqual(false); - expect(data.lightColor).assertEqual(0); - console.debug("====>getSlot Promise CONTENT_INFORMATION ActsAnsGetSlotTestPromise_0300 finish====>"); - notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ - console.debug("====>removeSlot CONTENT_INFORMATION err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - done(); - }) - }) - console.info("====>ActsAnsGetSlotTestPromise_0300 end====>"); - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotTestPromise_0300====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsGetSlotTestPromise_0400 - * @tc.name : Verify getSlot OTHER_TYPES - * @tc.desc : Get the OTHER_TYPES type slot after adding - */ - it('ActsAnsGetSlotTestPromise_0400', 0, async function (done) { - console.debug("====>ActsAnsGetSlotTestPromise_0400 start====>"); - console.debug("====>addSlot SlotType.OTHER_TYPES start====>"); - try{ - await notification.addSlot(notification.SlotType.OTHER_TYPES); - } - catch(err){ - console.error("====>addSlot ActsAnsGetSlotTestPromise_0400 err:" + JSON.stringify(err)); - expect().assertFail(); - done(); - } - console.debug("====>getSlot SlotType.OTHER_TYPES start====>"); - notification.getSlot(notification.SlotType.OTHER_TYPES).then((data) => { - console.debug("====>getSlot Promise OTHER_TYPES ActsAnsGetSlotTestPromise_0400 enter====>"); - console.debug("====>getSlot Promise ActsAnsGetSlotTestPromise_0400 data====>" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data.level).assertEqual(1); - expect(data.desc).assertEqual(""); - expect(data.badgeFlag).assertEqual(true); - expect(data.bypassDnd).assertEqual(false); - expect(data.lockscreenVisibility).assertEqual(3); - expect(data.vibrationEnabled).assertEqual(false); - expect(data.sound).assertEqual(""); - expect(data.lightEnabled).assertEqual(false); - expect(data.lightColor).assertEqual(0); - console.debug("====>getSlot Promise OTHER_TYPES ActsAnsGetSlotTestPromise_0400 finish====>"); - notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ - console.debug("====>removeSlot OTHER_TYPES err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - done(); - }) - }) - console.debug("====>ActsAnsGetSlotTestPromise_0400 end====>"); - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotTestPromise_0400====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsGetSlotTestPromise_0500 - * @tc.name : Verify getSlot UNKNOWN_TYPE - * @tc.desc : Get the UNKNOWN_TYPE type slot after adding - */ - it('ActsAnsGetSlotTestPromise_0500', 0, async function (done) { - console.debug("====>ActsAnsGetSlotTestPromise_0500 start====>"); - console.debug("====>addSlot SlotType.UNKNOWN_TYPE start====>"); - try{ - await notification.addSlot(notification.SlotType.UNKNOWN_TYPE); - } - catch(err){ - console.error("====>addSlot ActsAnsGetSlotTestPromise_0500 err:" + JSON.stringify(err)); - expect().assertFail(); - done(); - } - console.debug("====>getSlot SlotType.UNKNOWN_TYPE start====>"); - notification.getSlot(notification.SlotType.UNKNOWN_TYPE).then((data) => { - console.debug("====>getSlot Promise UNKNOWN_TYPE ActsAnsGetSlotTestPromise_0500 enter====>"); - console.debug("====>getSlot Promise ActsAnsGetSlotTestPromise_0500 data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data.level).assertEqual(1); - expect(data.desc).assertEqual(""); - expect(data.badgeFlag).assertEqual(true); - expect(data.bypassDnd).assertEqual(false); - expect(data.lockscreenVisibility).assertEqual(3); - expect(data.vibrationEnabled).assertEqual(false); - expect(data.sound).assertEqual(""); - expect(data.lightEnabled).assertEqual(false); - expect(data.lightColor).assertEqual(0); - console.debug("====>getSlotPromise UNKNOWN_TYPE ActsAnsGetSlotTestPromise_0500 finish====>"); - notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ - console.debug("====>removeSlot OTHER_TYPES err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - done(); - }) - }) - console.debug("====>ActsAnsGetSlotTestPromise_0500 end====>"); - setTimeout(function(){ - console.debug("====>time out ActsAnsGetSlotTestPromise_0500====>"); - }, TIMEOUT); - }) -}) } diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/test/List.test.js b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/test/List.test.js deleted file mode 100644 index f1f001b0d5ca40dd8ff09ad8fb9bcfa36a6c8bef..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsGetSlotTestPromise from './ExampleJsunit.test.js' -export default function testsuite() { -ActsAnsGetSlotTestPromise() -} diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/resources/base/element/string.json b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/resources/base/element/string.json deleted file mode 100644 index a9069003e1fe170dbfa2fb6fdedbb7d4a61b820d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ActsAnsGetSlotTestPromise" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/resources/base/media/icon.png b/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansslottest/actsansgetslottestpromise/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/BUILD.gn b/notification/ans_standard/actsansslottest/actsansremoveslottest/BUILD.gn deleted file mode 100644 index 4a73eeb8c6776b82fc66d5577e8e30c80ba9d1af..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsRemoveSlotTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsRemoveSlotTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/Test.json b/notification/ans_standard/actsansslottest/actsansremoveslottest/Test.json deleted file mode 100644 index be2a99652b400634c28425a2f3ddae2ad413bff2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "60000", - "shell-timeout": "60000", - "bundle-name": "com.example.actsansremoveslottest", - "package-name": "com.example.actsansremoveslottest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsRemoveSlotTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/signature/openharmony_sx.p7b b/notification/ans_standard/actsansslottest/actsansremoveslottest/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansslottest/actsansremoveslottest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/config.json b/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/config.json deleted file mode 100644 index d0f7eada95f169933a1484b9ee31214868858c4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansremoveslottest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansremoveslottest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/MainAbility/app.js b/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index cc183ba6f171c0a02e11f8a2eecdf4247d8c8bc2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - {{title}} - -
diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index b6c029140a36fe25eb602dbaeb1fe15b9077e84b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "测试RemoveSlot接口" - }, - onInit() { - this.title = "测试RemoveSlot接口"; - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - }, -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestAbility/app.js b/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/test/ExampleJsunit.test.js deleted file mode 100644 index 0d25d651159055fc06ec66ca00d89a40fea41884..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/test/ExampleJsunit.test.js +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import notification from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' - -const TIMEOUT = 3000; -const SOUNDURL = "file://system/etc/Light.ogg"; -export default function ActsAnsRemoveSlotTest() { -describe('ActsAnsRemoveSlotTest', function () { - - /* - * @tc.number : ActsAnsRemoveSlotTest_0100 - * @tc.name : Verify that the slot is removed twice callback - * @tc.desc : Remove the added SOCIAL_COMMUNICATION slot and then remove it again - */ - it('ActsAnsRemoveSlotTest_0100', 0, async function (done) { - console.debug("====>ActsAnsRemoveSlotTest_0100 start====>"); - console.debug("====>addSlot ActsAnsRemoveSlotTest_0100 start====>"); - await notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION); - console.debug("====>getSlot SlotType.SOCIAL_COMMUNICATION start====>"); - var data = await notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION); - console.debug("====>getSlot ActsAnsRemoveSlotTest_0100 enter====>"); - console.debug("====>getSlot ActsAnsRemoveSlotTest_0100 data====>" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data.level).assertEqual(4); - expect(data.desc).assertEqual(""); - expect(data.badgeFlag).assertEqual(true); - expect(data.bypassDnd).assertEqual(false); - expect(data.lockscreenVisibility).assertEqual(2); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual(SOUNDURL); - expect(data.lightEnabled).assertEqual(false); - expect(data.lightColor).assertEqual(0); - console.debug("====>getSlot ActsAnsRemoveSlotTest_0100 finish====>"); - notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ - console.debug("====>removeSlot first time callback err====>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err, data)=>{ - console.debug("====>getSlot second time enter====>"); - console.debug("====>getSlot second time err:" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.debug("====>getSlot second data:" + JSON.stringify(data)); - notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ - console.debug("====>removeSlot second time callback err:" + JSON.stringify(err)); - console.debug("====>ActsAnsRemoveSlotTest_0100 end====>"); - expect(err.code != 0).assertEqual(true); - done(); - }) - }) - }) - setTimeout(function(){ - console.debug("====>time out ActsAnsRemoveSlotTest_0100====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsRemoveSlotTest_0200 - * @tc.name : Verify that the slot is removed twice - * @tc.desc : Remove the added SERVICE_INFORMATION slot and then remove it again - */ - it('ActsAnsRemoveSlotTest_0200', 0, async function (done) { - console.debug("====>ActsAnsRemoveSlotTest_0200 start====>"); - console.debug("====>addSlot ActsAnsRemoveSlotTest_0200 start====>"); - await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); - console.debug("====>getSlot SlotType.SERVICE_INFORMATION start====>"); - var data = await notification.getSlot(notification.SlotType.SERVICE_INFORMATION); - console.debug("====>getSlot ActsAnsRemoveSlotTest_0200 enter====>"); - console.debug("====>getSlot ActsAnsRemoveSlotTest_0200 data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.SERVICE_INFORMATION); - expect(data.level).assertEqual(3); - expect(data.desc).assertEqual(""); - expect(data.badgeFlag).assertEqual(true); - expect(data.bypassDnd).assertEqual(false); - expect(data.lockscreenVisibility).assertEqual(2); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual(SOUNDURL); - expect(data.lightEnabled).assertEqual(false); - expect(data.lightColor).assertEqual(0); - console.debug("====>getSlot ActsAnsRemoveSlotTest_0200 finish====>"); - console.debug("====>removeSlot first time promise start====>"); - await notification.removeSlot(notification.SlotType.SERVICE_INFORMATION); - notification.getSlot(notification.SlotType.SERVICE_INFORMATION, (err, data)=>{ - console.debug("====>getSlot second time enter====>"); - console.debug("====>getSlot second time err:" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.debug("====>second getSlot data====>" + JSON.stringify(data)); - notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ - console.debug("====>removeSlot second time err:" + JSON.stringify(err)); - console.debug("====>ActsAnsRemoveSlotTest_0200 end====>"); - expect(err.code != 0).assertEqual(true); - done(); - }) - }) - setTimeout(function(){ - console.debug("====>time out ActsAnsRemoveSlotTest_0200====>"); - }, TIMEOUT); - }) -})} diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/test/List.test.js b/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/test/List.test.js deleted file mode 100644 index b19c7e3563978d65328c65f7508181feae09b7c1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsRemoveSlotTest from './ExampleJsunit.test.js' -export default function testsuite() { -ActsAnsRemoveSlotTest() -} diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/resources/base/element/string.json b/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/resources/base/element/string.json deleted file mode 100644 index cd64bca195c122d85c94da46de6691b345f03095..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ActsAnsRemoveSlotTest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/resources/base/media/icon.png b/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansslottest/actsansremoveslottest/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/BUILD.gn b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/BUILD.gn deleted file mode 100644 index 06dc5c14868e9025c2e8d963452e9f2f259dfc35..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsRemoveSlotWithoutAddTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsRemoveSlotWithoutAddTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/Test.json b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/Test.json deleted file mode 100644 index f9118d424c2e5881e91dbb9e3e1b932bc864e3bc..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "60000", - "shell-timeout": "60000", - "bundle-name": "com.example.actsansremoveslotwithoutadd", - "package-name": "com.example.actsansremoveslotwithoutadd" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsRemoveSlotWithoutAddTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/signature/openharmony_sx.p7b b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/config.json b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/config.json deleted file mode 100644 index bf905910d6444cddbc8e561a18e2b7ebbf20b393..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansremoveslotwithoutadd", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansremoveslotwithoutadd", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/MainAbility/app.js b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 09696c297ee9837d996bd113bf8d41b67f236f7b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - .container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index cc183ba6f171c0a02e11f8a2eecdf4247d8c8bc2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - {{title}} - -
diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index b2c0901c29a28b09d6fe437258c2b81bc78ed34c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "测试removeSlot接口" - }, - onInit() { - this.title = "测试removeSlot接口"; - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - }, -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestAbility/app.js b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/test/ExampleJsunit.test.js deleted file mode 100644 index e7b59ac23a947c5ad00b5fba7ee716786e137488..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/test/ExampleJsunit.test.js +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import notification from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' - -const TIMEOUT = 2000; -export default function ActsAnsRemoveSlotWithoutAdd() { -describe('ActsAnsRemoveSlotWithoutAdd', function () { - - /* - * @tc.number : ActsAnsRemoveSlotWithoutAdd_0100 - * @tc.name : removeSlot callback - * @tc.desc : remove the SOCIAL_COMMUNICATION type slot without adding - */ - it('ActsAnsRemoveSlotWithoutAdd_0100', 0, async function (done) { - console.debug("====>ActsAnsRemoveSlotWithoutAdd_0100 start====>"); - function removeSlotCallbck(err) { - console.debug("====>removeSlotActsAnsGetSlotWithoutAdd_0100 enter====>"); - console.debug("====>removeSlot ActsAnsRemoveSlotWithoutAdd_0100 err:" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - done(); - } - console.debug("====>removeSlot callback SlotType.SOCIAL_COMMUNICATION====>"); - await notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, removeSlotCallbck); - setTimeout(function(){ - console.debug("====>time out ActsAnsRemoveSlotWithoutAdd_0100====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsRemoveSlotWithoutAdd_0200 - * @tc.name : removeSlot callback - * @tc.desc : remove the SERVICE_INFORMATION type slot without adding - */ - it('ActsAnsRemoveSlotWithoutAdd_0200', 0, async function (done) { - console.debug("====>ActsAnsRemoveSlotWithoutAdd_0200 start====>"); - function removeSlotCallbck(err) { - console.debug("====>ActsAnsRemoveSlotWithoutAdd_0200 enter====>"); - console.debug("====>removeSlot ActsAnsRemoveSlotWithoutAdd_0200 err:" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - done(); - } - console.debug("====>removeSlot callback SlotType.SERVICE_INFORMATION====>"); - await notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, removeSlotCallbck); - setTimeout(function(){ - console.debug("====>time out ActsAnsRemoveSlotWithoutAdd_0200====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsRemoveSlotWithoutAdd_0300 - * @tc.name : removeSlot callback - * @tc.desc : remove the CONTENT_INFORMATION type slot without adding - */ - it('ActsAnsRemoveSlotWithoutAdd_0300', 0, async function (done) { - console.debug("====>ActsAnsRemoveSlotWithoutAdd_0300 start====>"); - function removeSlotCallbck(err) { - console.debug("====>ActsAnsRemoveSlotWithoutAdd_0300 enter====>"); - console.debug("====>removeSlot ActsAnsRemoveSlotWithoutAdd_0300 err:" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - done(); - } - console.debug("====>removeSlot callback SlotType.CONTENT_INFORMATION====>"); - await notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, removeSlotCallbck); - setTimeout(function(){ - console.debug("====>time out ActsAnsRemoveSlotWithoutAdd_0300====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsRemoveSlotWithoutAdd_0400 - * @tc.name : removeSlot callback - * @tc.desc : remove the OTHER_TYPES type slot without adding - */ - it('ActsAnsRemoveSlotWithoutAdd_0400', 0, async function (done) { - console.debug("====>ActsAnsRemoveSlotWithoutAdd_0400 start====>"); - function removeSlotCallbck(err) { - console.debug("====>ActsAnsRemoveSlotWithoutAdd_0400 enter====>"); - console.debug("====>removeSlot ActsAnsRemoveSlotWithoutAdd_0400 err:" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - done(); - } - console.debug("====>removeSlot callback SlotType.OTHER_TYPES====>"); - await notification.removeSlot(notification.SlotType.OTHER_TYPES, removeSlotCallbck); - setTimeout(function(){ - console.debug("====>time out ActsAnsRemoveSlotWithoutAdd_0400====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsRemoveSlotWithoutAdd_0500 - * @tc.name : removeSlot callback - * @tc.desc : remove the UNKNOWN_TYPE type slot without adding - */ - it('ActsAnsRemoveSlotWithoutAdd_0500', 0, async function (done) { - console.debug("====>ActsAnsRemoveSlotWithoutAdd_0500 start====>"); - function removeSlotCallbck(err) { - console.debug("====>ActsAnsRemoveSlotWithoutAdd_0500 enter====>"); - console.debug("====>removeSlot ActsAnsRemoveSlotWithoutAdd_0500 err:" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - done(); - } - console.debug("====>removeSlot callback SlotType.UNKNOWN_TYPE====>"); - await notification.removeSlot(notification.SlotType.UNKNOWN_TYPE, removeSlotCallbck); - setTimeout(function(){ - console.debug("====>time out ActsAnsRemoveSlotWithoutAdd_0500====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsRemoveSlotWithoutAdd_0600 - * @tc.name : removeSlot promise - * @tc.desc : remove the SOCIAL_COMMUNICATION type slot without adding - */ - it('ActsAnsRemoveSlotWithoutAdd_0600', 0, async function (done) { - console.debug("====>ActsAnsRemoveSlotWithoutAdd_0600 start====>"); - console.debug("====>removeSlot SlotType.SOCIAL_COMMUNICATION====>"); - notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION).then(()=>{ - console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0600 enter====>"); - expect().assertFail(); - done(); - }).catch((err)=>{ - console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0600 err:" + JSON.stringify(err)); - console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0600 end====>"); - expect(err.code != 0).assertEqual(true); - done(); - }) - setTimeout(function(){ - console.debug("====>time out ActsAnsRemoveSlotWithoutAdd_0600====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsRemoveSlotWithoutAdd_0700 - * @tc.name : removeSlot promise - * @tc.desc : remove the SERVICE_INFORMATION type slot without adding - */ - it('ActsAnsRemoveSlotWithoutAdd_0700', 0, async function (done) { - console.debug("====>ActsAnsRemoveSlotWithoutAdd_0700 start====>"); - console.debug("====>removeSlot SlotType.SERVICE_INFORMATION====>"); - notification.removeSlot(notification.SlotType.SERVICE_INFORMATION).then(()=>{ - console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0700 enter====>"); - expect().assertFail(); - done(); - }).catch((err)=>{ - console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0700 err:" + JSON.stringify(err)); - console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0700 end====>"); - expect(err.code != 0).assertEqual(true); - done(); - }) - setTimeout(function(){ - console.debug("====>time out ActsAnsRemoveSlotWithoutAdd_0700====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsRemoveSlotWithoutAdd_0800 - * @tc.name : removeSlot promise - * @tc.desc : remove the CONTENT_INFORMATION type slot without adding - */ - it('ActsAnsRemoveSlotWithoutAdd_0800', 0, async function (done) { - console.debug("====>ActsAnsRemoveSlotWithoutAdd_0800 start====>"); - console.debug("====>removeSlot SlotType.CONTENT_INFORMATION====>"); - notification.removeSlot(notification.SlotType.CONTENT_INFORMATION).then(()=>{ - console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0800 enter====>"); - expect().assertFail(); - done(); - }).catch((err)=>{ - console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0800 err:" + JSON.stringify(err)); - console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0800 end====>"); - expect(err.code != 0).assertEqual(true); - done(); - }) - setTimeout(function(){ - console.debug("====>time out ActsAnsRemoveSlotWithoutAdd_0800====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsRemoveSlotWithoutAdd_0900 - * @tc.name : removeSlot promise - * @tc.desc : remove the OTHER_TYPES type slot without adding - */ - it('ActsAnsRemoveSlotWithoutAdd_0900', 0, async function (done) { - console.debug("====>ActsAnsRemoveSlotWithoutAdd_0900 start====>"); - console.debug("====>removeSlot SlotType.OTHER_TYPES====>"); - notification.removeSlot(notification.SlotType.OTHER_TYPES).then(()=>{ - console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0900 enter====>"); - expect().assertFail(); - done(); - }).catch((err)=>{ - console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0900 err:" + JSON.stringify(err)); - console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_0900 end====>"); - expect(err.code != 0).assertEqual(true); - done(); - }) - setTimeout(function(){ - console.debug("====>time out ActsAnsRemoveSlotWithoutAdd_0900====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsRemoveSlotWithoutAdd_1000 - * @tc.name : removeSlot promise - * @tc.desc : remove the UNKNOWN_TYPE type slot without adding - */ - it('ActsAnsRemoveSlotWithoutAdd_1000', 0, async function (done) { - console.debug("====>ActsAnsRemoveSlotWithoutAdd_1000 start====>"); - console.debug("====>removeSlot SlotType.UNKNOWN_TYPE====>"); - notification.removeSlot(notification.SlotType.UNKNOWN_TYPE).then(()=>{ - console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_1000 enter====>"); - expect().assertFail(); - done(); - }).catch((err)=>{ - console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_1000 err:" + JSON.stringify(err)); - console.debug("====>getSlot ActsAnsRemoveSlotWithoutAdd_1000 end====>"); - expect(err.code != 0).assertEqual(true); - done(); - }) - setTimeout(function(){ - console.debug("====>time out ActsAnsRemoveSlotWithoutAdd_1000====>"); - }, TIMEOUT); - }) -}) } diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/test/List.test.js b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/test/List.test.js deleted file mode 100644 index 003a73483db256fd8883bddda9a418ca0bda7c55..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsRemoveSlotWithoutAdd from './ExampleJsunit.test.js' -export default function testsuite() { -ActsAnsRemoveSlotWithoutAdd() -} diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/resources/base/element/string.json b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/resources/base/element/string.json deleted file mode 100644 index 63151edc575cbac002b4a8febea73d6541548cc6..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ActsAnsSlotSystemPromise" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/resources/base/media/icon.png b/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansslottest/actsansremoveslotwithoutadd/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/BUILD.gn b/notification/ans_standard/actsansslottest/actsansslotbybundle/BUILD.gn deleted file mode 100644 index 9a1bf18a9bce480b29d1aa7ac17ba70b9519eca9..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsSlotByBundleTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsSlotByBundleTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/Test.json b/notification/ans_standard/actsansslottest/actsansslotbybundle/Test.json deleted file mode 100644 index 888a96d1bf48288f3cfb5a37fb3f9e0a3d660dc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "shell-timeout": "180000", - "bundle-name": "com.example.actsansslotbybundle", - "package-name": "com.example.actsansslotbybundle" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsSlotByBundleTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/signature/openharmony_sx.p7b b/notification/ans_standard/actsansslottest/actsansslotbybundle/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansslottest/actsansslotbybundle/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/config.json b/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/config.json deleted file mode 100644 index 2c992ab8fb2f17f28b3625aa73809f2416714ccd..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansslotbybundle", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansslotbybundle", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/MainAbility/app.js b/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 406641d81b4fb36d0b97c49b722528391c7a56a0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 44f4bc0a213133ced33d70b9220c26b66a088726..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - activeButton - -
diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 47f392922bd1864186356d16f91053223b84b8a3..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "测试slotbybundle接口" - }, - onInit() { - this.title = "测试slotbybundle接口"; - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - }, -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestAbility/app.js b/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/test/ExampleJsunit.test.js deleted file mode 100644 index f7bf48478d018aa0845c5d7aeaa78a37ebb9ffce..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/test/ExampleJsunit.test.js +++ /dev/null @@ -1,1861 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import notification from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' - -export default function ActsAnsSlotByBundle() { -describe('ActsAnsSlotByBundle', function () { - /* - * @tc.number : ActsAnsGetSlotsByBundle_0100 - * @tc.name : Verify getSlot SERVICE_INFORMATION - * @tc.desc : After adding slottype to SERVICE_INFORMATION's slot, - * call getsbybundle for information.(promise) - */ - it('ActsAnsGetSlotsByBundle_0100', 0, async function (done) { - console.debug("====>ActsAnsGetSlotsByBundle_0100 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); - await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption).then((data) => { - console.debug("====>ActsAnsGetSlotsByBundle_0100====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(2) - expect(data[0].level).assertEqual(3) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(2) - expect(data[0].vibrationEnabled).assertEqual(true) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ - console.debug("====>removeSlot SERVICE_INFORMATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsGetSlotsByBundle_0200 - * @tc.name : Verify getSlot UNKNOWN_TYPE - * @tc.desc : After adding slottype to UNKNOWN_TYPE's slot, - * call getsbybundle for information.(promise) - */ - it('ActsAnsGetSlotsByBundle_0200', 0, async function (done) { - console.debug("====>ActsAnsGetSlotsByBundle_0200 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - console.debug("====>addSlotByTypePromise UNKNOWN_TYPE enter====>"); - await notification.addSlot(notification.SlotType.UNKNOWN_TYPE); - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption).then((data) => { - console.debug("====>ActsAnsGetSlotsByBundle_0200====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(1) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - notification.removeSlot(notification.SlotType.UNKNOWN_TYPE, (err)=>{ - console.debug("====>removeSlot UNKNOWN_TYPE====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsGetSlotsByBundle_0300 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : After adding slottype to SOCIAL_COMMUNICATION's slot, - * call getsbybundle for information.(promise) - */ - it('ActsAnsGetSlotsByBundle_0300', 0, async function (done) { - console.debug("====>ActsAnsGetSlotsByBundle_0300 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - console.debug("====>addSlotByTypePromise SOCIAL_COMMUNICATION enter====>"); - await notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION); - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption).then((data) => { - console.debug("====>ActsAnsGetSlotsByBundle_0300====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(1) - expect(data[0].level).assertEqual(4) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(2) - expect(data[0].vibrationEnabled).assertEqual(true) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ - console.debug("====>removeSlot SOCIAL_COMMUNICATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - - }) - - /* - * @tc.number : ActsAnsGetSlotsByBundle_0400 - * @tc.name : Verify getSlot CONTENT_INFORMATION - * @tc.desc : After adding slottype to CONTENT_INFORMATION's slot, - * call getsbybundle for information.(promise) - */ - it('ActsAnsGetSlotsByBundle_0400', 0, async function (done) { - console.debug("====>ActsAnsGetSlotsByBundle_0400 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - console.debug("====>addSlotByTypePromise CONTENT_INFORMATION enter====>"); - await notification.addSlot(notification.SlotType.CONTENT_INFORMATION); - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption).then((data) => { - console.debug("====>ActsAnsGetSlotsByBundle_0400====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(3) - expect(data[0].level).assertEqual(2) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>ActsAnsGetSlotsByBundle_0400 finish====>"); - console.debug("====>setSlotByBundle start====>"); - notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ - console.debug("====>removeSlot CONTENT_INFORMATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - - }) - - /* - * @tc.number : ActsAnsGetSlotsByBundle_0500 - * @tc.name : Verify getSlot OTHER_TYPES - * @tc.desc : After adding slottype to OTHER_TYPES's slot, - * call getsbybundle for information.(promise) - */ - it('ActsAnsGetSlotsByBundle_0500', 0, async function (done) { - console.debug("====>ActsAnsGetSlotsByBundle_0500 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - console.debug("====>addSlotByTypePromise OTHER_TYPES enter====>"); - await notification.addSlot(notification.SlotType.OTHER_TYPES); - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption).then((data) => { - console.debug("====>ActsAnsGetSlotsByBundle_0500====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(1) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ - console.debug("====>removeSlot OTHER_TYPES====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - - }) - - /* - * @tc.number : ActsAnsGetSlotsByBundle_0600 - * @tc.name : Verify getSlot SERVICE_INFORMATION - * @tc.desc : After adding slottype to SERVICE_INFORMATION's slot, - * call getsbybundle for information.(callback) - */ - it('ActsAnsGetSlotsByBundle_0600', 0, async function (done) { - console.debug("====>ActsAnsGetSlotsByBundle_0600 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); - await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption, (err, data) => { - console.debug("====>ActsAnsGetSlotsByBundle_0600====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(2) - expect(data[0].level).assertEqual(3) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(2) - expect(data[0].vibrationEnabled).assertEqual(true) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ - console.debug("====>removeSlot SERVICE_INFORMATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsGetSlotsByBundle_0700 - * @tc.name : Verify getSlot UNKNOWN_TYPE - * @tc.desc : After adding slottype to UNKNOWN_TYPE's slot, - * call getsbybundle for information.(callback) - */ - it('ActsAnsGetSlotsByBundle_0700', 0, async function (done) { - console.debug("====>ActsAnsGetSlotsByBundle_0700 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - console.debug("====>addSlotByTypePromise UNKNOWN_TYPE enter====>"); - await notification.addSlot(notification.SlotType.UNKNOWN_TYPE); - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption, (err, data) => { - console.debug("====>ActsAnsGetSlotsByBundle_0700====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(1) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - notification.removeSlot(notification.SlotType.UNKNOWN_TYPE, (err)=>{ - console.debug("====>removeSlot UNKNOWN_TYPE====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsGetSlotsByBundle_0800 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : After adding slottype to SOCIAL_COMMUNICATION's slot, - * call getsbybundle for information.(callback) - */ - it('ActsAnsGetSlotsByBundle_0800', 0, async function (done) { - console.debug("====>ActsAnsGetSlotsByBundle_0800 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - console.debug("====>addSlotByTypePromise SOCIAL_COMMUNICATION enter====>"); - await notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION); - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption, (err, data) => { - console.debug("====>ActsAnsGetSlotsByBundle_0800====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(1) - expect(data[0].level).assertEqual(4) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(2) - expect(data[0].vibrationEnabled).assertEqual(true) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ - console.debug("====>removeSlot SOCIAL_COMMUNICATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsGetSlotsByBundle_0900 - * @tc.name : Verify getSlot CONTENT_INFORMATION - * @tc.desc : After adding slottype to CONTENT_INFORMATION's slot, - * call getsbybundle for information.(callback) - */ - it('ActsAnsGetSlotsByBundle_0900', 0, async function (done) { - console.debug("====>ActsAnsGetSlotsByBundle_0900 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - console.debug("====>addSlotByTypePromise CONTENT_INFORMATION enter====>"); - await notification.addSlot(notification.SlotType.CONTENT_INFORMATION); - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption, (err, data) => { - console.debug("====>ActsAnsGetSlotsByBundle_0900====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(3) - expect(data[0].level).assertEqual(2) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ - console.debug("====>removeSlot CONTENT_INFORMATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsGetSlotsByBundle_1000 - * @tc.name : Verify getSlot OTHER_TYPES - * @tc.desc : After adding slottype to OTHER_TYPES's slot, - * call getsbybundle for information.(callback) - */ - it('ActsAnsGetSlotsByBundle_1000', 0, async function (done) { - console.debug("====>ActsAnsGetSlotsByBundle_1000 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - console.debug("====>addSlotByTypePromise OTHER_TYPES enter====>"); - await notification.addSlot(notification.SlotType.OTHER_TYPES); - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption, (err, data) => { - console.debug("====>ActsAnsGetSlotsByBundle_1000====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(1) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ - console.debug("====>removeSlot OTHER_TYPES====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsGetSlotsByBundle_1100 - * @tc.name : Verify getSlot OTHER_TYPES - * @tc.desc : After adding slottype to OTHER_TYPES's slot, - * call getsbybundle for information.(callback) - */ - it('ActsAnsGetSlotsByBundle_1100', 0, async function (done) { - console.debug("====>ActsAnsGetSlotsByBundle_1100 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - console.debug("====>addSlotByTypePromise OTHER_TYPES enter====>"); - await notification.addSlot(notification.SlotType.OTHER_TYPES); - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption, (err, data) => { - console.debug("====>ActsAnsGetSlotsByBundle_1100====>" + JSON.stringify(data) ); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(1) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].enabled).assertEqual(true) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ - console.debug("====>removeSlot OTHER_TYPES====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_0100 - * @tc.name : Verify getSlot SERVICE_INFORMATION - * @tc.desc : After adding slottype to SERVICE_INFORMATION's slot, - * call getsbybundle for information, and then call setSlotByBundle - * to update the information.(promise) - */ - it('ActsAnsSetSlotByBundle_0100', 0, async function (done) { - console.debug("====>ActsAnsSetSlotByBundle_0100 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot = { - type: notification.SlotType.SERVICE_INFORMATION, - level: 4 - } - console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); - await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); - console.debug("====>getSlotsByBundle1 start====>"); - var data = await notification.getSlotsByBundle(bundleoption) - console.debug("====>ActsAnsSetSlotByBundle_0100====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(2) - expect(data[0].level).assertEqual(3) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(2) - expect(data[0].vibrationEnabled).assertEqual(true) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - console.debug("====>setSlotsByBundle====>") - await notification.setSlotByBundle(bundleoption, notificationslot); - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption).then((data) => { - console.debug("====>ActsAnsSetSlotByBundle_0100.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(2) - expect(data[0].level).assertEqual(4) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(2) - expect(data[0].vibrationEnabled).assertEqual(true) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ - console.debug("====>removeSlot SERVICE_INFORMATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_0200 - * @tc.name : Verify getSlot UNKNOWN_TYPE - * @tc.desc : After adding slottype to UNKNOWN_TYPE's slot, - * call getsbybundle for information, and then call setSlotByBundle - * to update the information.(promise) - */ - it('ActsAnsSetSlotByBundle_0200', 0, async function (done) { - console.debug("====>ActsAnsSetSlotByBundle_0200 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot = { - type: notification.SlotType.UNKNOWN_TYPE, - level: 4 - } - console.debug("====>addSlotByTypePromise UNKNOWN_TYPE enter====>"); - await notification.addSlot(notification.SlotType.UNKNOWN_TYPE); - console.debug("====>getSlotsByBundle1 start====>"); - var data = await notification.getSlotsByBundle(bundleoption) - console.debug("====>ActsAnsSetSlotByBundle_0200====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(1) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - console.debug("====>setSlotsByBundle====>") - await notification.setSlotByBundle(bundleoption, notificationslot); - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption).then((data) => { - console.debug("====>ActsAnsSetSlotByBundle_0200.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(4) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.removeSlot(notification.SlotType.UNKNOWN_TYPE, (err)=>{ - console.debug("====>removeSlot UNKNOWN_TYPE====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_0300 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : After adding slottype to SOCIAL_COMMUNICATION's slot, - * call getsbybundle for information, and then call setSlotByBundle - * to update the information.(promise) - */ - it('ActsAnsSetSlotByBundle_0300', 0, async function (done) { - console.debug("====>ActsAnsSetSlotByBundle_0300 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot = { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: 3 - } - console.debug("====>addSlotByTypePromise SOCIAL_COMMUNICATION enter====>"); - await notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION); - console.debug("====>getSlotsByBundle1 start====>"); - var data = await notification.getSlotsByBundle(bundleoption) - console.debug("====>ActsAnsSetSlotByBundle_0300====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(1) - expect(data[0].level).assertEqual(4) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(2) - expect(data[0].vibrationEnabled).assertEqual(true) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - await notification.setSlotByBundle(bundleoption, notificationslot); - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption).then((data) => { - console.debug("====>ActsAnsSetSlotByBundle_0300.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(1) - expect(data[0].level).assertEqual(3) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(2) - expect(data[0].vibrationEnabled).assertEqual(true) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ - console.debug("====>removeSlot SOCIAL_COMMUNICATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_0400 - * @tc.name : Verify getSlot CONTENT_INFORMATION - * @tc.desc : After adding slottype to CONTENT_INFORMATION's slot, - * call getsbybundle for information, and then call setSlotByBundle - * to update the information.(promise) - */ - it('ActsAnsSetSlotByBundle_0400', 0, async function (done) { - console.debug("====>ActsAnsSetSlotByBundle_0400 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot = { - type: notification.SlotType.CONTENT_INFORMATION, - level: 4 - } - console.debug("====>addSlotByTypePromise CONTENT_INFORMATION enter====>"); - await notification.addSlot(notification.SlotType.CONTENT_INFORMATION); - console.debug("====>getSlotsByBundle1 start====>"); - var data = await notification.getSlotsByBundle(bundleoption) - console.debug("====>ActsAnsSetSlotByBundle_0400====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(3) - expect(data[0].level).assertEqual(2) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - console.debug("====>setSlotsByBundle====>") - await notification.setSlotByBundle(bundleoption, notificationslot); - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption).then((data) => { - console.debug("====>ActsAnsSetSlotByBundle_0400.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(3) - expect(data[0].level).assertEqual(4) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ - console.debug("====>removeSlot CONTENT_INFORMATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_0500 - * @tc.name : Verify getSlot OTHER_TYPES - * @tc.desc : After adding slottype to OTHER_TYPES's slot, - * call getsbybundle for information, and then call setSlotByBundle - * to update the information.(promise) - */ - it('ActsAnsSetSlotByBundle_0500', 0, async function (done) { - console.debug("====>ActsAnsSetSlotByBundle_0500 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot = { - type: notification.SlotType.OTHER_TYPES, - level: 4 - } - console.debug("====>addSlotByTypePromise OTHER_TYPES enter====>"); - await notification.addSlot(notification.SlotType.OTHER_TYPES); - console.debug("====>getSlotsByBundle1 start====>"); - var data = await notification.getSlotsByBundle(bundleoption) - console.debug("====>ActsAnsSetSlotByBundle_0500====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(1) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - console.debug("====>setSlotsByBundle====>") - await notification.setSlotByBundle(bundleoption, notificationslot); - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption).then((data) => { - console.debug("====>ActsAnsSetSlotByBundle_0500.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(4) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ - console.debug("====>removeSlot OTHER_TYPES====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_0600 - * @tc.name : Verify getSlot SERVICE_INFORMATION - * @tc.desc : After adding slottype to SERVICE_INFORMATION's slot, - * call getsbybundle for information, and then call setSlotByBundle - * to update the information.(callback) - */ - it('ActsAnsSetSlotByBundle_0600', 0, async function (done) { - console.debug("====>ActsAnsSetSlotByBundle_0600 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot = { - type: notification.SlotType.SERVICE_INFORMATION, - level: 4 - } - console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); - notification.addSlot(notification.SlotType.SERVICE_INFORMATION,()=>{ - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_0600====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(2) - expect(data[0].level).assertEqual(3) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(2) - expect(data[0].vibrationEnabled).assertEqual(true) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - notification.setSlotByBundle(bundleoption, notificationslot, () => { - console.debug("====>setSlotsByBundle====>") - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_0600.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(2) - expect(data[0].level).assertEqual(4) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(2) - expect(data[0].vibrationEnabled).assertEqual(true) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ - console.debug("====>removeSlot SERVICE_INFORMATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_0700 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : After adding slottype to UNKNOWN_TYPE's slot, - * call getsbybundle for information, and then call setSlotByBundle - * to update the information.(callback) - */ - it('ActsAnsSetSlotByBundle_0700', 0, async function (done) { - console.debug("====>ActsAnsSlotByBundle_0100 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot = { - type: notification.SlotType.UNKNOWN_TYPE, - level: 4 - } - console.debug("====>addSlotByTypePromise UNKNOWN_TYPE enter====>"); - notification.addSlot(notification.SlotType.UNKNOWN_TYPE,() => { - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_0700====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(1) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - notification.setSlotByBundle(bundleoption, notificationslot, () => { - console.debug("====>setSlotsByBundle====>") - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_0700.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(4) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.removeSlot(notification.SlotType.UNKNOWN_TYPE, (err)=>{ - console.debug("====>removeSlot UNKNOWN_TYPE====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_0800 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : After adding slottype to SOCIAL_COMMUNICATION's slot, - * call getsbybundle for information, and then call setSlotByBundle - * to update the information.(callback) - */ - it('ActsAnsSetSlotByBundle_0800', 0, async function (done) { - console.debug("====>ActsAnsSlotByBundle_0100 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot = { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: 3 - } - console.debug("====>addSlotByTypePromise SOCIAL_COMMUNICATION enter====>"); - notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION,() => { - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_0800====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(1) - expect(data[0].level).assertEqual(4) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(2) - expect(data[0].vibrationEnabled).assertEqual(true) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - notification.setSlotByBundle(bundleoption, notificationslot, () => { - console.debug("====>setSlotsByBundle====>") - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_0800.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(1) - expect(data[0].level).assertEqual(3) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(2) - expect(data[0].vibrationEnabled).assertEqual(true) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ - console.debug("====>removeSlot SOCIAL_COMMUNICATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_0900 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : After adding slottype to CONTENT_INFORMATION's slot, - * call getsbybundle for information, and then call setSlotByBundle - * to update the information.(callback) - */ - it('ActsAnsSetSlotByBundle_0900', 0, async function (done) { - console.debug("====>ActsAnsSetSlotByBundle_0900 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot = { - type: notification.SlotType.CONTENT_INFORMATION, - level: 4 - } - console.debug("====>addSlotByTypePromise CONTENT_INFORMATION enter====>"); - notification.addSlot(notification.SlotType.CONTENT_INFORMATION,() => { - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_0900====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(3) - expect(data[0].level).assertEqual(2) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - - notification.setSlotByBundle(bundleoption, notificationslot, () => { - console.debug("====>setSlotsByBundle====>") - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_0900.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(3) - expect(data[0].level).assertEqual(4) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ - console.debug("====>removeSlot CONTENT_INFORMATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_1000 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : After adding slottype to OTHER_TYPES's slot, - * call getsbybundle for information, and then call setSlotByBundle - * to update the information.(callback) - */ - it('ActsAnsSetSlotByBundle_1000', 0, async function (done) { - console.debug("====>ActsAnsSetSlotByBundle_1000 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot = { - type: notification.SlotType.OTHER_TYPES, - level: 4 - } - console.debug("====>addSlotByTypePromise OTHER_TYPES enter====>"); - await notification.addSlot(notification.SlotType.OTHER_TYPES,() => { - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_1000====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(1) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - notification.setSlotByBundle(bundleoption, notificationslot, () => { - console.debug("====>setSlotsByBundle====>") - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_1000.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(4) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ - console.debug("====>removeSlot OTHER_TYPES====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_1100 - * @tc.name : Verify getSlot SERVICE_INFORMATION - * @tc.desc : After adding slottype to SERVICE_INFORMATION's slot, - * call getsbybundle for information, and then call setSlotByBundle - * twice to update the information.(promise) - */ - it('ActsAnsSetSlotByBundle_1100', 0, async function (done) { - console.debug("====>ActsAnsSetSlotByBundle_1100 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot1 = { - type: notification.SlotType.SERVICE_INFORMATION, - level: 4 - } - var notificationslot2 = { - type: notification.SlotType.SERVICE_INFORMATION, - lockscreenVisibility: 1 - } - console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); - await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); - console.debug("====>getSlotsByBundle1 start====>"); - var data = await notification.getSlotsByBundle(bundleoption) - console.debug("====>ActsAnsSetSlotByBundle_1100====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(2) - expect(data[0].level).assertEqual(3) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(2) - expect(data[0].vibrationEnabled).assertEqual(true) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - console.debug("====>setSlotsByBundle1====>") - await notification.setSlotByBundle(bundleoption, notificationslot1); - console.debug("====>setSlotsByBundle2====>") - await notification.setSlotByBundle(bundleoption, notificationslot2); - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption).then((data) => { - console.debug("====>ActsAnsSetSlotByBundle_1100.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(2) - expect(data[0].level).assertEqual(3) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(1) - expect(data[0].vibrationEnabled).assertEqual(true) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ - console.debug("====>removeSlot SERVICE_INFORMATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_1200 - * @tc.name : Verify getSlot UNKNOWN_TYPE - * @tc.desc : After adding slottype to UNKNOWN_TYPE's slot, - * call getsbybundle for information, and then call setSlotByBundle - * twice to update the information.(promise) - */ - it('ActsAnsSetSlotByBundle_1200', 0, async function (done) { - console.debug("====>ActsAnsSetSlotByBundle_1200 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot1 = { - type: notification.SlotType.UNKNOWN_TYPE, - level: 4 - } - var notificationslot2 = { - type: notification.SlotType.UNKNOWN_TYPE, - lockscreenVisibility: 1 - } - console.debug("====>addSlotByTypePromise UNKNOWN_TYPE enter====>"); - await notification.addSlot(notification.SlotType.UNKNOWN_TYPE); - console.debug("====>getSlotsByBundle1 start====>"); - var data = await notification.getSlotsByBundle(bundleoption) - console.debug("====>ActsAnsSetSlotByBundle_1200====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(1) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - console.debug("====>setSlotsByBundle1====>") - await notification.setSlotByBundle(bundleoption, notificationslot1); - console.debug("====>setSlotsByBundle2====>") - await notification.setSlotByBundle(bundleoption, notificationslot2); - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption).then((data) => { - console.debug("====>ActsAnsSetSlotByBundle_1200.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(1) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(1) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.removeSlot(notification.SlotType.UNKNOWN_TYPE, (err)=>{ - console.debug("====>removeSlot UNKNOWN_TYPE====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_1300 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : After adding slottype to SOCIAL_COMMUNICATION's slot, - * call getsbybundle for information, and then call setSlotByBundle - * twice to update the information.(promise) - */ - it('ActsAnsSetSlotByBundle_1300', 0, async function (done) { - console.debug("====>ActsAnsSetSlotByBundle_1300 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot1 = { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: 4 - } - var notificationslot2 = { - type: notification.SlotType.SOCIAL_COMMUNICATION, - lockscreenVisibility: 1 - } - console.debug("====>addSlotByTypePromise SOCIAL_COMMUNICATION enter====>"); - await notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION); - console.debug("====>getSlotsByBundle1 start====>"); - var data = await notification.getSlotsByBundle(bundleoption) - console.debug("====>ActsAnsSetSlotByBundle_1300====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(1) - expect(data[0].level).assertEqual(4) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(2) - expect(data[0].vibrationEnabled).assertEqual(true) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - console.debug("====>setSlotsByBundle1====>") - await notification.setSlotByBundle(bundleoption, notificationslot1); - console.debug("====>setSlotsByBundle2====>") - await notification.setSlotByBundle(bundleoption, notificationslot2); - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption).then((data) => { - console.debug("====>ActsAnsSetSlotByBundle_1300.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(1) - expect(data[0].level).assertEqual(4) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(1) - expect(data[0].vibrationEnabled).assertEqual(true) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ - console.debug("====>removeSlot SOCIAL_COMMUNICATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_1400 - * @tc.name : Verify getSlot CONTENT_INFORMATION - * @tc.desc : After adding slottype to CONTENT_INFORMATION's slot, - * call getsbybundle for information, and then call setSlotByBundle - * twice to update the information.(promise) - */ - it('ActsAnsSetSlotByBundle_1400', 0, async function (done) { - console.debug("====>ActsAnsSlotByBundle_0100 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot1 = { - type: notification.SlotType.CONTENT_INFORMATION, - level: 4 - } - var notificationslot2 = { - type: notification.SlotType.CONTENT_INFORMATION, - lockscreenVisibility: 1 - } - console.debug("====>addSlotByTypePromise CONTENT_INFORMATION enter====>"); - await notification.addSlot(notification.SlotType.CONTENT_INFORMATION); - console.debug("====>getSlotsByBundle1 start====>"); - var data = await notification.getSlotsByBundle(bundleoption) - console.debug("====>ActsAnsSetSlotByBundle_1400====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(3) - expect(data[0].level).assertEqual(2) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - console.debug("====>setSlotsByBundle1====>") - await notification.setSlotByBundle(bundleoption, notificationslot1); - console.debug("====>setSlotsByBundle2====>") - await notification.setSlotByBundle(bundleoption, notificationslot2); - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption).then((data) => { - console.debug("====>ActsAnsSetSlotByBundle_1400.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(3) - expect(data[0].level).assertEqual(2) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(1) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ - console.debug("====>removeSlot CONTENT_INFORMATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_1500 - * @tc.name : Verify getSlot OTHER_TYPES - * @tc.desc : After adding slottype to OTHER_TYPES's slot, - * call getsbybundle for information, and then call setSlotByBundle - * twice to update the information.(promise) - */ - it('ActsAnsSetSlotByBundle_1500', 0, async function (done) { - console.debug("====>ActsAnsSetSlotByBundle_1500 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot1 = { - type: notification.SlotType.OTHER_TYPES, - level: 4 - } - var notificationslot2 = { - type: notification.SlotType.OTHER_TYPES, - lockscreenVisibility: 1 - } - console.debug("====>addSlotByTypePromise OTHER_TYPES enter====>"); - await notification.addSlot(notification.SlotType.OTHER_TYPES); - console.debug("====>getSlotsByBundle1 start====>"); - var data = await notification.getSlotsByBundle(bundleoption) - console.debug("====>ActsAnsSetSlotByBundle_1500====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(1) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - console.debug("====>setSlotsByBundle1====>") - await notification.setSlotByBundle(bundleoption, notificationslot1); - console.debug("====>setSlotsByBundle2====>") - await notification.setSlotByBundle(bundleoption, notificationslot2); - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption).then((data) => { - console.debug("====>ActsAnsSetSlotByBundle_1500.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(1) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(1) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ - console.debug("====>removeSlot OTHER_TYPES====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_1600 - * @tc.name : Verify getSlot SERVICE_INFORMATION - * @tc.desc : After adding slottype to SERVICE_INFORMATION's slot, - * call getsbybundle for information, and then call setSlotByBundle - * twice to update the information.(callback) - */ - it('ActsAnsSetSlotByBundle_1600', 0, async function (done) { - console.debug("====>ActsAnsSetSlotByBundle_1600 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot1 = { - type: notification.SlotType.SERVICE_INFORMATION, - level: 4 - } - var notificationslot2 = { - type: notification.SlotType.SERVICE_INFORMATION, - lockscreenVisibility: 1 - } - console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); - notification.addSlot(notification.SlotType.SERVICE_INFORMATION,() => { - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_1600====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(2) - expect(data[0].level).assertEqual(3) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(2) - expect(data[0].vibrationEnabled).assertEqual(true) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - notification.setSlotByBundle(bundleoption, notificationslot1, () => { - console.debug("====>setSlotsByBundle1====>") - notification.setSlotByBundle(bundleoption, notificationslot2, () => { - console.debug("====>setSlotsByBundle2====>") - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_1600.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(2) - expect(data[0].level).assertEqual(3) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(1) - expect(data[0].vibrationEnabled).assertEqual(true) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ - console.debug("====>removeSlot SERVICE_INFORMATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - }) - }) - }) - }) - - - /* - * @tc.number : ActsAnsSetSlotByBundle_1700 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : After adding slottype to UNKNOWN_TYPE's slot, - * call getsbybundle for information, and then call setSlotByBundle - * twice to update the information.(callback) - */ - it('ActsAnsSetSlotByBundle_1700', 0, async function (done) { - console.debug("====>ActsAnsSetSlotByBundle_1700 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot1 = { - type: notification.SlotType.UNKNOWN_TYPE, - level: 4 - } - var notificationslot2 = { - type: notification.SlotType.UNKNOWN_TYPE, - lockscreenVisibility: 1 - } - console.debug("====>addSlotByTypePromise UNKNOWN_TYPE enter====>"); - notification.addSlot(notification.SlotType.UNKNOWN_TYPE,() => { - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_1700====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(1) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - notification.setSlotByBundle(bundleoption, notificationslot1, () => { - console.debug("====>setSlotsByBundle1====>") - notification.setSlotByBundle(bundleoption, notificationslot2, () => { - console.debug("====>setSlotsByBundle2====>") - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_1700.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(1) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(1) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.removeSlot(notification.SlotType.UNKNOWN_TYPE, (err)=>{ - console.debug("====>removeSlot UNKNOWN_TYPE====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - }) - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_1800 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : After adding slottype to SOCIAL_COMMUNICATION's slot, - * call getsbybundle for information, and then call setSlotByBundle - * twice to update the information.(callback) - */ - it('ActsAnsSetSlotByBundle_1800', 0, async function (done) { - console.debug("====>ActsAnsSetSlotByBundle_1800 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot1 = { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: 4 - } - var notificationslot2 = { - type: notification.SlotType.SOCIAL_COMMUNICATION, - lockscreenVisibility: 1 - } - console.debug("====>addSlotByTypePromise SOCIAL_COMMUNICATION enter====>"); - notification.addSlot(notification.SlotType.SOCIAL_COMMUNICATION,() => { - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_1800====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(1) - expect(data[0].level).assertEqual(4) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(2) - expect(data[0].vibrationEnabled).assertEqual(true) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - notification.setSlotByBundle(bundleoption, notificationslot1, () => { - console.debug("====>setSlotsByBundle1====>") - notification.setSlotByBundle(bundleoption, notificationslot2, () => { - console.debug("====>setSlotsByBundle2====>") - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_1800.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(1) - expect(data[0].level).assertEqual(4) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(1) - expect(data[0].vibrationEnabled).assertEqual(true) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ - console.debug("====>removeSlot SOCIAL_COMMUNICATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - }) - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_1900 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : After adding slottype to CONTENT_INFORMATION's slot, - * call getsbybundle for information, and then call setSlotByBundle - * twice to update the information.(callback) - */ - it('ActsAnsSetSlotByBundle_1900', 0, async function (done) { - console.debug("====>ActsAnsSetSlotByBundle_1900 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot1 = { - type: notification.SlotType.CONTENT_INFORMATION, - level: 4 - } - var notificationslot2 = { - type: notification.SlotType.CONTENT_INFORMATION, - lockscreenVisibility: 1 - } - console.debug("====>addSlotByTypePromise CONTENT_INFORMATION enter====>"); - notification.addSlot(notification.SlotType.CONTENT_INFORMATION,() => { - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_1900====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(3) - expect(data[0].level).assertEqual(2) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - notification.setSlotByBundle(bundleoption, notificationslot1, () => { - console.debug("====>setSlotsByBundle1====>") - notification.setSlotByBundle(bundleoption, notificationslot2, () => { - console.debug("====>setSlotsByBundle2====>") - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_1900.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(3) - expect(data[0].level).assertEqual(2) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(1) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ - console.debug("====>removeSlot CONTENT_INFORMATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - }) - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_2000 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : After adding slottype to OTHER_TYPES's slot, - * call getsbybundle for information, and then call setSlotByBundle - * twice to update the information.(callback) - */ - it('ActsAnsSetSlotByBundle_2000', 0, async function (done) { - console.debug("====>ActsAnsSetSlotByBundle_2000 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot1 = { - type: notification.SlotType.OTHER_TYPES, - level: 4 - } - var notificationslot2 = { - type: notification.SlotType.OTHER_TYPES, - lockscreenVisibility: 1 - } - console.debug("====>addSlotByTypePromise OTHER_TYPES enter====>"); - notification.addSlot(notification.SlotType.OTHER_TYPES,() => { - console.debug("====>getSlotsByBundle1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_2000====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(1) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(3) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1 finish====>"); - console.debug("====>setSlotByBundle start====>"); - notification.setSlotByBundle(bundleoption, notificationslot1, () => { - console.debug("====>setSlotsByBundle1====>") - notification.setSlotByBundle(bundleoption, notificationslot2, () => { - console.debug("====>setSlotsByBundle2====>") - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_2000.1====>" + JSON.stringify(data)); - expect(data[0].type).assertEqual(65535) - expect(data[0].level).assertEqual(1) - expect(data[0].badgeFlag).assertEqual(true) - expect(data[0].bypassDnd).assertEqual(false) - expect(data[0].lockscreenVisibility).assertEqual(1) - expect(data[0].vibrationEnabled).assertEqual(false) - expect(data[0].lightEnabled).assertEqual(false) - expect(data[0].lightColor).assertEqual(0) - console.debug("====>getSlotsByBundle1.1 finish====>"); - notification.removeSlot(notification.SlotType.OTHER_TYPES, (err)=>{ - console.debug("====>removeSlot OTHER_TYPES====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - }) - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_2100 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : Do not call addSlot, call setSlotByBundle directly, - * and then call getSlotsByBundle query results.(callback) - */ - it('ActsAnsSetSlotByBundle_2100', 0, async function (done) { - console.debug("====>ActsAnsSetSlotByBundle_2100 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot = { - type: notification.SlotType.OTHER_TYPES, - level: 4 - } - notification.setSlotByBundle(bundleoption, notificationslot, (err) => { - console.debug("====>setSlotsByBundle1====>") - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption,(err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_2100====>" + JSON.stringify(data)); - expect(typeof(data)).assertEqual("object") - console.debug("====>getSlotsByBundle1.1 finish====>"); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsSetSlotByBundle_2200 - * @tc.name : Verify getSlot OTHER_TYPES - * @tc.desc : Do not call addSlot, call setSlotByBundle directly, - * and then call getSlotsByBundle query results.(promise) - */ - it('ActsAnsSetSlotByBundle_2200', 0, async function (done) { - console.debug("====>ActsAnsSetSlotByBundle_2200 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - var notificationslot = { - type: notification.SlotType.OTHER_TYPES, - level: 4, - - } - notification.setSlotByBundle(bundleoption, notificationslot).then(() => { - }).catch((err)=>{ - console.debug("====>setSlotsByBundle1====>") - console.debug("====>getSlotsByBundle1.1 start====>"); - notification.getSlotsByBundle(bundleoption, (err,data) => { - console.debug("====>ActsAnsSetSlotByBundle_2200====>" + JSON.stringify(data)); - expect(typeof(data)).assertEqual("object") - console.debug("====>getSlotsByBundle1.1 finish====>"); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsGetSlotNumByBundle_0100 - * @tc.name : Verify getSlot SERVICE_INFORMATION - * @tc.desc : After adding slot, call getSlotNumByBundle for information.(callback) - */ - it('ActsAnsGetSlotNumByBundle_0100', 0, async function (done) { - console.debug("====>ActsAnsGetSlotNumByBundle_0600 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); - notification.addSlot(notification.SlotType.SERVICE_INFORMATION,() => { - notification.getSlotNumByBundle(bundleoption, (err, data) => { - console.debug("====>ActsAnsGetSlotNumByBundle_0100====>" + JSON.stringify(data)); - expect(data).assertEqual(1) - notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ - console.debug("====>removeSlot SERVICE_INFORMATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - }) - - /* - * @tc.number : ActsAnsGetSlotNumByBundle_0200 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : After adding slot, call getSlotNumByBundle for information.(promise) - */ - it('ActsAnsGetSlotNumByBundle_0200', 0, async function (done) { - console.debug("====>ActsAnsGetSlotNumByBundle_0200 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); - await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); - notification.getSlotNumByBundle(bundleoption).then((data) => { - console.debug("====>ActsAnsGetSlotNumByBundle_0200====>" + JSON.stringify(data)); - expect(data).assertEqual(1) - notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ - console.debug("====>removeSlot SERVICE_INFORMATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - - - - - /* - * @tc.number : ActsAnsGetSlotNumByBundle_0300 - * @tc.name : Verify getSlot SERVICE_INFORMATION - * @tc.desc : After adding twice different type slot, - * call getSlotNumByBundle for information.(callback) - */ - it('ActsAnsGetSlotNumByBundle_0300', 0, async function (done) { - console.debug("====>ActsAnsGetSlotNumByBundle_0300 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); - notification.addSlot(notification.SlotType.SERVICE_INFORMATION, () => { - console.debug("====>addSlotByTypePromise CONTENT_INFORMATION enter====>"); - notification.addSlot(notification.SlotType.CONTENT_INFORMATION, () => { - notification.getSlotNumByBundle(bundleoption, (err, data) => { - console.debug("====>ActsAnsGetSlotNumByBundle_0300====>" + JSON.stringify(data)); - expect(data).assertEqual(2) - notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ - console.debug("====>removeSlot SERVICE_INFORMATION====>"); - console.debug("====>SERVICE_INFORMATION err.code====>" + JSON.stringify(err.code)); - expect(err.code).assertEqual(0); - notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ - console.debug("====>removeSlot CONTENT_INFORMATION====>"); - console.debug("====>CONTENT_INFORMATION err.code====>" + JSON.stringify(err.code)); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - }) - }) - }) - - /* - * @tc.number : ActsAnsGetSlotNumByBundle_0400 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : After adding twice different type slot, - * call getSlotNumByBundle for information.(promise) - */ - it('ActsAnsGetSlotNumByBundle_0400', 0, async function (done) { - console.debug("====>ActsAnsGetSlotNumByBundle_0400 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); - await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); - console.debug("====>addSlotByTypePromise CONTENT_INFORMATION enter====>"); - await notification.addSlot(notification.SlotType.CONTENT_INFORMATION); - notification.getSlotNumByBundle(bundleoption).then((data) => { - console.debug("====>ActsAnsGetSlotNumByBundle_0400====>" + JSON.stringify(data)); - expect(data).assertEqual(2) - notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ - console.debug("====>removeSlot SERVICE_INFORMATION====>"); - expect(err.code).assertEqual(0); - notification.removeSlot(notification.SlotType.CONTENT_INFORMATION, (err)=>{ - console.debug("====>removeSlot CONTENT_INFORMATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - }) - - /* - * @tc.number : ActsAnsGetSlotNumByBundle_0500 - * @tc.name : Verify getSlot null - * @tc.desc : Call getSlotNumByBundle for information.(callback) - */ - it('ActsAnsGetSlotNumByBundle_0500', 0, async function (done) { - console.debug("====>ActsAnsGetSlotNumByBundle_0700 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - notification.getSlotNumByBundle(bundleoption, (err, data) => { - console.debug("====>ActsAnsGetSlotNumByBundle_0500====>" + JSON.stringify(data)); - expect(data).assertEqual(0) - done(); - }) - }) - - /* - * @tc.number : ActsAnsGetSlotNumByBundle_0600 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : Call getSlotNumByBundle for information.(promise) - */ - it('ActsAnsGetSlotNumByBundle_0600', 0, async function (done) { - console.debug("====>ActsAnsGetSlotNumByBundle_0600 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - notification.getSlotNumByBundle(bundleoption).then((data) => { - console.debug("====>ActsAnsGetSlotNumByBundle_0600====>" + JSON.stringify(data)); - expect(data).assertEqual(0) - done(); - }) - }) - - /* - * @tc.number : ActsAnsGetSlotNumByBundle_0700 - * @tc.name : Verify getSlot SERVICE_INFORMATION - * @tc.desc : After adding twice same type slot, - * call getSlotNumByBundle for information.(callback) - */ - it('ActsAnsGetSlotNumByBundle_0700', 0, async function (done) { - console.debug("====>ActsAnsGetSlotNumByBundle_0700 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); - notification.addSlot(notification.SlotType.SERVICE_INFORMATION, ()=>{ - console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); - notification.addSlot(notification.SlotType.SERVICE_INFORMATION, ()=>{ - notification.getSlotNumByBundle(bundleoption, (err, data) => { - console.debug("====>ActsAnsGetSlotNumByBundle_0700====>" + JSON.stringify(data)); - expect(data).assertEqual(1) - notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ - console.debug("====>removeSlot SERVICE_INFORMATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - }) - }) - - /* - * @tc.number : ActsAnsGetSlotNumByBundle_0800 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : After adding twice same type slot, - * call getSlotNumByBundle for information.(promise) - */ - it('ActsAnsGetSlotNumByBundle_0800', 0, async function (done) { - console.debug("====>ActsAnsGetSlotNumByBundle_0800 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundle" - } - console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); - await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); - console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); - await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); - notification.getSlotNumByBundle(bundleoption).then((data) => { - console.debug("====>ActsAnsGetSlotNumByBundle_0800====>" + JSON.stringify(data)); - expect(data).assertEqual(1) - notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ - console.debug("====>removeSlot SERVICE_INFORMATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - - /* - * @tc.number : ActsAnsGetSlotNumByBundle_0900 - * @tc.name : Verify getSlot SERVICE_INFORMATION - * @tc.desc : Bundlename incorrectly adds slot after calling - * getSlotNumByBundle to get information.(callback) - */ - it('ActsAnsGetSlotNumByBundle_0900', 0, async function (done) { - console.debug("====>ActsAnsGetSlotNumByBundle_0900 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundleerr" - } - console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); - notification.addSlot(notification.SlotType.SERVICE_INFORMATION, ()=>{ - notification.getSlotNumByBundle(bundleoption, (err, data) => { - console.debug("====>ActsAnsGetSlotNumByBundle_0900====>" + JSON.stringify(data)); - expect(data).assertEqual(0) - notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ - console.debug("====>removeSlot SERVICE_INFORMATION====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - }) - }) - - /* - * @tc.number : ActsAnsGetSlotNumByBundle_1000 - * @tc.name : Verify getSlot SOCIAL_COMMUNICATION - * @tc.desc : Bundlename incorrectly adds slot after calling - * getSlotNumByBundle to get information.(promise) - */ - it('ActsAnsGetSlotNumByBundle_1000', 0, async function (done) { - console.debug("====>ActsAnsGetSlotNumByBundle_1000 start====>"); - var bundleoption = { - bundle: "com.example.actsansslotbybundleerr" - } - console.debug("====>addSlotByTypePromise SERVICE_INFORMATION enter====>"); - await notification.addSlot(notification.SlotType.SERVICE_INFORMATION); - notification.getSlotNumByBundle(bundleoption).then((data) => { - }).catch((err)=>{ - expect(err!=0).assertEqual(true) - notification.removeSlot(notification.SlotType.SERVICE_INFORMATION, (err)=>{ - console.debug("====>removeSlot SERVICE_INFORMATION err:" + JSON.stringify(err)); - }) - done(); - }) - }) -}) - -} diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/test/List.test.js b/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/test/List.test.js deleted file mode 100644 index 7df6e8699aa467a2c42250c03235f6d901ab8b4e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsSlotByBundle from './ExampleJsunit.test.js' -export default function testsuite() { -ActsAnsSlotByBundle() -} diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/resources/base/element/string.json b/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/resources/base/element/string.json deleted file mode 100644 index 34cd948c6caff510223ec8ff37d30f3e01160abb..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ActsAnsSlotByBundle" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} diff --git a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/resources/base/media/icon.png b/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansslottest/actsansslotbybundle/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/BUILD.gn b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/BUILD.gn deleted file mode 100644 index 87226e0c68aacbde0b7107d6fb023c57ebc5cbba..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsSlotSystemCallbackTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsSlotSystemCallbackTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/Test.json b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/Test.json deleted file mode 100644 index c7d2d5b5c88760051db03c7fdf8c9798871a93d4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "60000", - "shell-timeout": "60000", - "bundle-name": "com.example.actsansslotsystemcallback", - "package-name": "com.example.actsansslotsystemcallback" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsSlotSystemCallbackTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/signature/openharmony_sx.p7b b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/config.json b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/config.json deleted file mode 100644 index 200c5bee3de086687cf2afcc86aafa6f5993cb3e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansslotsystemcallback", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansslotsystemcallback", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/MainAbility/app.js b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index cc183ba6f171c0a02e11f8a2eecdf4247d8c8bc2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - {{title}} - -
diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 36aff80e2009819826c8e0ad1792fc9f7c91e0f1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "测试slot接口callback形式:系统应用" - }, - onInit() { - this.title = "测试slot接口callback形式:系统应用"; - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - }, -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestAbility/app.js b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/test/ExampleJsunit.test.js deleted file mode 100644 index 50954a8be0133fb742ea572513c2f29848c50f58..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/test/ExampleJsunit.test.js +++ /dev/null @@ -1,217 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import notification from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' - -const TIMEOUT = 2000; -export default function ActsAnsSlotSystemCallback() { -describe('ActsAnsSlotSystemCallback', function () { - - /* - * @tc.number : ActsAnsSlotSystemCallback_0100 - * @tc.name : Verify getSlots after adding slots and removeAllSlots - * @tc.desc : getSlots after adding all type slots and remove all slots - */ - it('ActsAnsSlotSystemCallback_0100', 0, async function (done) { - console.debug("====>ActsAnsSlotSystemCallback_0100 start====>"); - function timeOut(){ - console.debug("====>time out enter ActsAnsSlotSystemCallback_0100====>"); - } - console.debug("====>addSlot SOCIAL_COMMUNICATION====>"); - await notification.addSlot( - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: notification.SlotLevel.LEVEL_NONE, - desc: "slot_SOCIAL_COMMUNICATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SOCIAL_COMMUNICATION_sound", - lightEnabled: true, - lightColor: 1 - }); - console.debug("====>addSlot SERVICE_INFORMATION====>"); - await notification.addSlot( - { - type: notification.SlotType.SERVICE_INFORMATION, - level: notification.SlotLevel.LEVEL_MIN, - desc: "slot_SERVICE_INFORMATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SERVICE_INFORMATION_sound", - lightEnabled: true, - lightColor: 2 - }); - await notification.addSlot( - { - type: notification.SlotType.CONTENT_INFORMATION, - level: notification.SlotLevel.LEVEL_LOW, - desc: "slot_CONTENT_INFORMATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_CONTENT_INFORMATION_sound", - lightEnabled: true, - lightColor: 3 - }); - console.debug("====>addSlot OTHER_TYPES====>"); - await notification.addSlot( - { - type: notification.SlotType.OTHER_TYPES, - level: notification.SlotLevel.LEVEL_DEFAULT, - desc: "slot_OTHER_TYPES_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_OTHER_TYPES_sound", - lightEnabled: true, - lightColor: 4 - }); - console.debug("====>addSlot UNKNOWN_TYPE====>"); - await notification.addSlot( - { - type: notification.SlotType.UNKNOWN_TYPE, - level: notification.SlotLevel.LEVEL_HIGH, - desc: "slot_UNKNOWN_TYPE_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_UNKNOWN_TYPE_sound", - lightEnabled: true, - lightColor: 5 - }); - notification.getSlots((err, data)=>{ - console.debug("====>getSlots enter====>"); - console.debug("====>getSlots data====>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlots data====>" + JSON.stringify(data)); - try{ - expect(data[0].type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data[0].level).assertEqual(notification.SlotLevel.LEVEL_NONE); - expect(data[0].desc).assertEqual("slot_SOCIAL_COMMUNICATION_desc"); - expect(data[0].badgeFlag).assertEqual(false); - expect(data[0].bypassDnd).assertEqual(true); - expect(data[0].vibrationEnabled).assertEqual(true); - expect(data[0].sound).assertEqual("slot_SOCIAL_COMMUNICATION_sound"); - expect(data[0].lightEnabled).assertEqual(true); - expect(data[0].lightColor).assertEqual(1); - - expect(data[1].type).assertEqual(notification.SlotType.SERVICE_INFORMATION); - expect(data[1].level).assertEqual(notification.SlotLevel.LEVEL_MIN); - expect(data[1].desc).assertEqual("slot_SERVICE_INFORMATION_desc"); - expect(data[1].badgeFlag).assertEqual(false); - expect(data[1].bypassDnd).assertEqual(true); - expect(data[1].vibrationEnabled).assertEqual(true); - expect(data[1].sound).assertEqual("slot_SERVICE_INFORMATION_sound"); - expect(data[1].lightEnabled).assertEqual(true); - expect(data[1].lightColor).assertEqual(2); - - expect(data[2].type).assertEqual(notification.SlotType.CONTENT_INFORMATION); - expect(data[2].level).assertEqual(notification.SlotLevel.LEVEL_LOW); - expect(data[2].desc).assertEqual("slot_CONTENT_INFORMATION_desc"); - expect(data[2].badgeFlag).assertEqual(false); - expect(data[2].bypassDnd).assertEqual(true); - expect(data[2].vibrationEnabled).assertEqual(true); - expect(data[2].sound).assertEqual("slot_CONTENT_INFORMATION_sound"); - expect(data[2].lightEnabled).assertEqual(true); - expect(data[2].lightColor).assertEqual(3); - - expect(data[3].type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data[3].level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); - expect(data[3].desc).assertEqual("slot_OTHER_TYPES_desc"); - expect(data[3].badgeFlag).assertEqual(false); - expect(data[3].bypassDnd).assertEqual(true); - expect(data[3].vibrationEnabled).assertEqual(true); - expect(data[3].sound).assertEqual("slot_OTHER_TYPES_sound"); - expect(data[3].lightEnabled).assertEqual(true); - expect(data[3].lightColor).assertEqual(4); - console.debug("====>getSlots end====>"); - notification.removeAllSlots((err)=>{ - console.debug("====>removeAllSlots ActsAnsSlotSystemCallback_0100 err====>" + JSON.stringify(err)); - console.debug("====>ActsAnsSlotSystemCallback_0100 end====>"); - expect(err.code).assertEqual(0); - done(); - }) - }catch(err){ - console.error("====>getSlots catch err====>" + JSON.stringify(err)); - expect().assertFail(); - done(); - } - }) - setTimeout(timeOut, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsSlotSystemPromise_0200 - * @tc.name : Verify that the same type of slot is added repeatedly - * @tc.desc : the same type of slot is added repeatedly, and the obtained slot is added for the first time - */ - it('ActsAnsSlotSystemCallback_0200', 0, async function (done) { - console.debug("====>ActsAnsSlotSystemCallback_0200 start====>"); - async function timeOutTwo(){ - console.debug("====>time out enter ActsAnsSlotSystemCallback_0200====>"); - } - console.debug("====>addSlot SOCIAL_COMMUNICATION====>"); - await notification.addSlot( - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: notification.SlotLevel.LEVEL_NONE, - desc: "slot_SOCIAL_COMMUNICATION_Desc_First", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SOCIAL_COMMUNICATION_Sound_First", - lightEnabled: true, - lightColor: 1 - }); - await notification.addSlot( - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: notification.SlotLevel.LEVEL_DEFAULT, - desc: "slot_SOCIAL_COMMUNICATION_Desc_Second", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SOCIAL_COMMUNICATION_Sound_Second", - lightEnabled: true, - lightColor: 1 - }); - console.debug("====>getSlot SlotType.SOCIAL_COMMUNICATION: ====>"); - notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err, data) => { - console.debug("====>getSlotActsAnsSlotSystemCallback_0200 enter====>"); - console.debug("====>getSlotActsAnsSlotSystemCallback_0200 err====>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlotActsAnsSlotSystemCallback_0200 data====>" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data.level).assertEqual(notification.SlotLevel.LEVEL_NONE); - expect(data.desc).assertEqual("slot_SOCIAL_COMMUNICATION_Desc_First"); - expect(data.badgeFlag).assertEqual(false); - expect(data.bypassDnd).assertEqual(true); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual("slot_SOCIAL_COMMUNICATION_Sound_First"); - expect(data.lightEnabled).assertEqual(true); - expect(data.lightColor).assertEqual(1); - console.debug("====>getSlotActsAnsSlotSystemCallback_0200 finish====>"); - notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION, (err)=>{ - console.debug("====>removeSlot SOCIAL_COMMUNICATION err====>" + JSON.stringify(err)); - console.debug("====>ActsAnsSlotSystemCallback_0200 end====>"); - expect(err.code).assertEqual(0); - done(); - }) - }) - setTimeout(timeOutTwo, TIMEOUT); - }) -}) } diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/test/List.test.js b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/test/List.test.js deleted file mode 100644 index 6fdb97f114ffa38efae43dde3e07ea7f76cb9aea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsSlotSystemCallback from './ExampleJsunit.test.js' -export default function testsuite() { -ActsAnsSlotSystemCallback() -} diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/resources/base/element/string.json b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/resources/base/element/string.json deleted file mode 100644 index 2dcfb5308faba77d2fb41377affca465e5ae746b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ActsAnsSlotSystemCallback" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/resources/base/media/icon.png b/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansslottest/actsansslotsystemcallback/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/BUILD.gn b/notification/ans_standard/actsansslottest/actsansslotsystempromise/BUILD.gn deleted file mode 100644 index f7ad59aadb88b15167e13996a91ccfdc01f8345e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsSlotSystemPromiseTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsSlotSystemPromiseTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/Test.json b/notification/ans_standard/actsansslottest/actsansslotsystempromise/Test.json deleted file mode 100644 index 3db51ee188271b91d2509a848cc24710a5a54042..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "60000", - "shell-timeout": "60000", - "bundle-name": "com.example.actsansslotsystempromise", - "package-name": "com.example.actsansslotsystempromise" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsSlotSystemPromiseTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/signature/openharmony_sx.p7b b/notification/ans_standard/actsansslottest/actsansslotsystempromise/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansslottest/actsansslotsystempromise/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/config.json b/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/config.json deleted file mode 100644 index bdf6bfd80ee70e13900d99c47cce0bed5d84b22e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansslotsystempromise", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansslotsystempromise", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/MainAbility/app.js b/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index cc183ba6f171c0a02e11f8a2eecdf4247d8c8bc2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - {{title}} - -
diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index d864012434b7258ed298e29412f9df376e4fa88f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "测试slot接口promise形式:系统应用" - }, - onInit() { - this.title = "测试slot接口promise形式:系统应用"; - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - }, -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestAbility/app.js b/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/test/ExampleJsunit.test.js deleted file mode 100644 index 1d98f9bd001e9f4ff02a9b8e0449d56234ff0f70..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/test/ExampleJsunit.test.js +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import notification from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' - -const TIMEOUT = 2000; -export default function ActsAnsSlotSystemPromise() { -describe('ActsAnsSlotSystemPromise', function () { - - /* - * @tc.number : ActsAnsSlotSystemPromise_0100 - * @tc.name : Verify getSlots after adding slots and removeSlot - * @tc.desc : getSlots after adding all type slots and adding again after removing slot - */ - it('ActsAnsSlotSystemPromise_0100', 0, async function (done) { - console.debug("====>ActsAnsSlotTestSystem_0100 start====>"); - console.debug("====>addSlot SOCIAL_COMMUNICATION====>"); - await notification.addSlot( - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: notification.SlotLevel.LEVEL_NONE, - desc: "slot_SOCIAL_COMMUNICATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SOCIAL_COMMUNICATION_sound", - lightEnabled: true, - lightColor: 1 - }); - console.debug("====>addSlot SERVICE_INFORMATION====>"); - await notification.addSlot( - { - type: notification.SlotType.SERVICE_INFORMATION, - level: notification.SlotLevel.LEVEL_MIN, - desc: "slot_SERVICE_INFORMATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SERVICE_INFORMATION_sound", - lightEnabled: true, - lightColor: 2 - }); - console.debug("====>addSlot CONTENT_INFORMATION====>"); - await notification.addSlot( - { - type: notification.SlotType.CONTENT_INFORMATION, - level: notification.SlotLevel.LEVEL_LOW, - desc: "slot_CONTENT_INFORMATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_CONTENT_INFORMATION_sound", - lightEnabled: true, - lightColor: 3 - }); - console.debug("====>addSlot OTHER_TYPES====>"); - await notification.addSlot( - { - type: notification.SlotType.OTHER_TYPES, - level: notification.SlotLevel.LEVEL_DEFAULT, - desc: "slot_OTHER_TYPES_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_OTHER_TYPES_sound", - lightEnabled: true, - lightColor: 4 - }); - console.debug("====>addSlot UNKNOWN_TYPE====>"); - await notification.addSlot( - { - type: notification.SlotType.UNKNOWN_TYPE, - level: notification.SlotLevel.LEVEL_HIGH, - desc: "slot_UNKNOWN_TYPE_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_UNKNOWN_TYPE_sound", - lightEnabled: true, - lightColor: 5 - }); - var data = await notification.getSlots(); - console.debug("====>getSlots enter====>"); - console.debug("====>getSlots data====>" + JSON.stringify(data)); - try{ - expect(data[0].type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data[0].level).assertEqual(notification.SlotLevel.LEVEL_NONE); - expect(data[0].desc).assertEqual("slot_SOCIAL_COMMUNICATION_desc"); - expect(data[0].badgeFlag).assertEqual(false); - expect(data[0].bypassDnd).assertEqual(true); - expect(data[0].vibrationEnabled).assertEqual(true); - expect(data[0].sound).assertEqual("slot_SOCIAL_COMMUNICATION_sound"); - expect(data[0].lightEnabled).assertEqual(true); - expect(data[0].lightColor).assertEqual(1); - - expect(data[1].type).assertEqual(notification.SlotType.SERVICE_INFORMATION); - expect(data[1].level).assertEqual(notification.SlotLevel.LEVEL_MIN); - expect(data[1].desc).assertEqual("slot_SERVICE_INFORMATION_desc"); - expect(data[1].badgeFlag).assertEqual(false); - expect(data[1].bypassDnd).assertEqual(true); - expect(data[1].vibrationEnabled).assertEqual(true); - expect(data[1].sound).assertEqual("slot_SERVICE_INFORMATION_sound"); - expect(data[1].lightEnabled).assertEqual(true); - expect(data[1].lightColor).assertEqual(2); - - expect(data[2].type).assertEqual(notification.SlotType.CONTENT_INFORMATION); - expect(data[2].level).assertEqual(notification.SlotLevel.LEVEL_LOW); - expect(data[2].desc).assertEqual("slot_CONTENT_INFORMATION_desc"); - expect(data[2].badgeFlag).assertEqual(false); - expect(data[2].bypassDnd).assertEqual(true); - expect(data[2].vibrationEnabled).assertEqual(true); - expect(data[2].sound).assertEqual("slot_CONTENT_INFORMATION_sound"); - expect(data[2].lightEnabled).assertEqual(true); - expect(data[2].lightColor).assertEqual(3); - - expect(data[3].type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data[3].level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); - expect(data[3].desc).assertEqual("slot_OTHER_TYPES_desc"); - expect(data[3].badgeFlag).assertEqual(false); - expect(data[3].bypassDnd).assertEqual(true); - expect(data[3].vibrationEnabled).assertEqual(true); - expect(data[3].sound).assertEqual("slot_OTHER_TYPES_sound"); - expect(data[3].lightEnabled).assertEqual(true); - expect(data[3].lightColor).assertEqual(4); - console.debug("====>getSlots end====>"); - }catch(err){ - console.error("====>getSlots catch err====>" + JSON.stringify(err)); - expect().assertFail(); - done(); - } - console.debug("====>removeAllSlots ActsAnsSlotSystemPromise_0100====>"); - await notification.removeAllSlots(); - console.debug("====>getSlots after remove all slots====>"); - var dataTwo = notification.getSlots(); - console.debug("====>getSlots dataTwo:" + JSON.stringify(dataTwo)); - console.debug("====>addSlot SERVICE_INFORMATION second====>"); - await notification.addSlot( - { - type: notification.SlotType.SERVICE_INFORMATION, - level: notification.SlotLevel.LEVEL_DEFAULT, - desc: "slot_SERVICE_INFORMATION_Desc_Second", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SERVICE_INFORMATION_Sound_Second", - lightEnabled: true, - lightColor: 2 - }); - var dataThree = await notification.getSlot(notification.SlotType.SERVICE_INFORMATION); - console.debug("====>getSlotPromise SERVICE_INFORMATION ActsAnsSlotSystemPromise_0100 enter====>"); - console.debug("====>getSlotPromise ActsAnsSlotSystemPromise_0100 dataThree:" + JSON.stringify(dataThree)); - expect(dataThree.type).assertEqual(notification.SlotType.SERVICE_INFORMATION); - expect(dataThree.level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); - expect(dataThree.desc).assertEqual("slot_SERVICE_INFORMATION_Desc_Second"); - expect(dataThree.badgeFlag).assertEqual(false); - expect(dataThree.bypassDnd).assertEqual(true); - expect(dataThree.vibrationEnabled).assertEqual(true); - expect(dataThree.sound).assertEqual("slot_SERVICE_INFORMATION_Sound_Second"); - expect(dataThree.lightEnabled).assertEqual(true); - expect(dataThree.lightColor).assertEqual(2); - console.debug("====>getSlotPromise SERVICE_INFORMATION ActsAnsSlotSystemPromise_0100 finish====>"); - console.debug("====>removeSlot SERVICE_INFORMATION====>"); - await notification.removeSlot(notification.SlotType.SERVICE_INFORMATION); - done(); - setTimeout(function (){ - console.debug("====>time out ActsAnsSlotTestSystem_0100====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsSlotSystemPromise_0200 - * @tc.name : Verify that the same type of slot is added repeatedly - * @tc.desc : the same type of slot is added repeatedly, and the obtained slot is added for the first time - */ - it('ActsAnsSlotSystemPromise_0200', 0, async function (done) { - console.debug("====>ActsAnsSlotSystemPromise_0200 start====>"); - console.debug("====>addSlot SOCIAL_COMMUNICATION====>"); - await notification.addSlot( - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: notification.SlotLevel.LEVEL_NONE, - desc: "slot_SOCIAL_COMMUNICATION_Desc_First", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SOCIAL_COMMUNICATION_Sound_First", - lightEnabled: true, - lightColor: 1 - }); - await notification.addSlot( - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: notification.SlotLevel.LEVEL_DEFAULT, - desc: "slot_SOCIAL_COMMUNICATION_Desc_Second", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SOCIAL_COMMUNICATION_Sound_Second", - lightEnabled: true, - lightColor: 1 - }); - console.debug("====>getSlot SlotType.SOCIAL_COMMUNICATION====>"); - var data = await notification.getSlot(notification.SlotType.SOCIAL_COMMUNICATION); - console.debug("====>getSlot ActsAnsSlotSystemPromise_0200 enter====>"); - console.debug("====>getSlot ActsAnsSlotSystemPromise_0200 data:" + JSON.stringify(data)); - expect(data.type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data.level).assertEqual(notification.SlotLevel.LEVEL_NONE); - expect(data.desc).assertEqual("slot_SOCIAL_COMMUNICATION_Desc_First"); - expect(data.badgeFlag).assertEqual(false); - expect(data.bypassDnd).assertEqual(true); - expect(data.vibrationEnabled).assertEqual(true); - expect(data.sound).assertEqual("slot_SOCIAL_COMMUNICATION_Sound_First"); - expect(data.lightEnabled).assertEqual(true); - expect(data.lightColor).assertEqual(1); - console.debug("====>getSlot ActsAnsSlotSystemPromise_0200 finish====>"); - console.debug("====>removeSlot SOCIAL_COMMUNICATION start====>"); - await notification.removeSlot(notification.SlotType.SOCIAL_COMMUNICATION); - console.debug("====>ActsAnsSlotSystemPromise_0200 end====>"); - done(); - setTimeout(function (){ - console.debug("====>time out ActsAnsSlotSystemPromise_0200====>"); - }, TIMEOUT); - }) -}) } diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/test/List.test.js b/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/test/List.test.js deleted file mode 100644 index 186aa8e4f1a4b69e4bb3fc4b11f70e10b792c1dd..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsSlotSystemPromise from './ExampleJsunit.test.js' -export default function testsuite() { -ActsAnsSlotSystemPromise() -} diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/resources/base/element/string.json b/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/resources/base/element/string.json deleted file mode 100644 index 63151edc575cbac002b4a8febea73d6541548cc6..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ActsAnsSlotSystemPromise" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/resources/base/media/icon.png b/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansslottest/actsansslotsystempromise/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/BUILD.gn b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/BUILD.gn deleted file mode 100644 index 646f8b018480b8cfd66454d6206e133b2e7fa9f9..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsSlotAddRemoveAllTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsSlotAddRemoveAllTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/Test.json b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/Test.json deleted file mode 100644 index 612d084efce23c2dc4bbda00eafe1cbf98016449..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "60000", - "shell-timeout": "60000", - "bundle-name": "com.example.actsansslotaddremoveall", - "package-name": "com.example.actsansslotaddremoveall" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsSlotAddRemoveAllTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/signature/openharmony_sx.p7b b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/config.json b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/config.json deleted file mode 100644 index d7d7d6ba7f0e38790164276df11aaf4c869986ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansslotaddremoveall", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansslotaddremoveall", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/MainAbility/app.js b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index cc183ba6f171c0a02e11f8a2eecdf4247d8c8bc2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - {{title}} - -
diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index fe12a15c7f28b47fa2ceec1d7ad6f0bc9527bb59..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "测试addSlots接口和removeAllSlots接口" - }, - onInit() { - this.title = "测试addSlots接口和removeAllSlots接口"; - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - }, -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestAbility/app.js b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/test/ExampleJsunit.test.js deleted file mode 100644 index efe46f776b15c71ef635123f7a49f2bafd5666d6..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/test/ExampleJsunit.test.js +++ /dev/null @@ -1,725 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import notification from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' - -const TIMEOUT = 2000; -export default function ActsAnsSlotAddRemoveAll() { -describe('ActsAnsSlotAddRemoveAll', function () { - - /* - * @tc.number : ActsAnsSlotAddRemoveAll_0100 - * @tc.name : removeAllSlots after addSlots callback - * @tc.desc : Verify that removeAllSlots after addSlots - */ - it('ActsAnsSlotAddRemoveAll_0100', 0, async function (done) { - console.debug("====>ActsAnsSlotAddRemoveAll_0100 start====>"); - console.debug("====>addSlots start ActsAnsSlotAddRemoveAll_0100====>"); - notification.addSlots([ - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: notification.SlotLevel.LEVEL_NONE, - desc: "slot_SOCIAL_COMMUNICATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SOCIAL_COMMUNICATION_sound", - lightEnabled: true, - lightColor: 1 - }, - { - type: notification.SlotType.SERVICE_INFORMATION, - level: notification.SlotLevel.LEVEL_MIN, - desc: "slot_SERVICE_INFORMATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SERVICE_INFORMATION_sound", - lightEnabled: true, - lightColor: 2 - }, - { - type: notification.SlotType.CONTENT_INFORMATION, - level: notification.SlotLevel.LEVEL_LOW, - desc: "slot_CONTENT_INFORMATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_CONTENT_INFORMATION_sound", - lightEnabled: true, - lightColor: 3 - }, - { - type: notification.SlotType.OTHER_TYPES, - level: notification.SlotLevel.LEVEL_DEFAULT, - desc: "slot_OTHER_TYPES_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_OTHER_TYPES_sound", - lightEnabled: true, - lightColor: 4 - } - ], (err)=>{ - console.debug("====>addSlots callback ActsAnsSlotAddRemoveAll_0100====>"); - expect(err.code).assertEqual(0); - console.debug("====>getSlots start ActsAnsSlotAddRemoveAll_0100====>"); - notification.getSlots((err, data)=>{ - console.debug("====>getSlots callback ActsAnsSlotAddRemoveAll_0100====>"); - console.debug("====>getSlots err ActsAnsSlotAddRemoveAll_0100====>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlots data ActsAnsSlotAddRemoveAll_0100====>" + JSON.stringify(data)); - try{ - expect(data[0].type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data[0].level).assertEqual(notification.SlotLevel.LEVEL_NONE); - expect(data[0].desc).assertEqual("slot_SOCIAL_COMMUNICATION_desc"); - expect(data[0].badgeFlag).assertEqual(false); - expect(data[0].bypassDnd).assertEqual(true); - expect(data[0].vibrationEnabled).assertEqual(true); - expect(data[0].sound).assertEqual("slot_SOCIAL_COMMUNICATION_sound"); - expect(data[0].lightEnabled).assertEqual(true); - expect(data[0].lightColor).assertEqual(1); - - expect(data[1].type).assertEqual(notification.SlotType.SERVICE_INFORMATION); - expect(data[1].level).assertEqual(notification.SlotLevel.LEVEL_MIN); - expect(data[1].desc).assertEqual("slot_SERVICE_INFORMATION_desc"); - expect(data[1].badgeFlag).assertEqual(false); - expect(data[1].bypassDnd).assertEqual(true); - expect(data[1].vibrationEnabled).assertEqual(true); - expect(data[1].sound).assertEqual("slot_SERVICE_INFORMATION_sound"); - expect(data[1].lightEnabled).assertEqual(true); - expect(data[1].lightColor).assertEqual(2); - - expect(data[2].type).assertEqual(notification.SlotType.CONTENT_INFORMATION); - expect(data[2].level).assertEqual(notification.SlotLevel.LEVEL_LOW); - expect(data[2].desc).assertEqual("slot_CONTENT_INFORMATION_desc"); - expect(data[2].badgeFlag).assertEqual(false); - expect(data[2].bypassDnd).assertEqual(true); - expect(data[2].vibrationEnabled).assertEqual(true); - expect(data[2].sound).assertEqual("slot_CONTENT_INFORMATION_sound"); - expect(data[2].lightEnabled).assertEqual(true); - expect(data[2].lightColor).assertEqual(3); - - expect(data[3].type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data[3].level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); - expect(data[3].desc).assertEqual("slot_OTHER_TYPES_desc"); - expect(data[3].badgeFlag).assertEqual(false); - expect(data[3].bypassDnd).assertEqual(true); - expect(data[3].vibrationEnabled).assertEqual(true); - expect(data[3].sound).assertEqual("slot_OTHER_TYPES_sound"); - expect(data[3].lightEnabled).assertEqual(true); - expect(data[3].lightColor).assertEqual(4); - console.debug("====>getSlots end ActsAnsSlotAddRemoveAll_0100====>"); - console.debug("====>removeAllSlots start ActsAnsSlotAddRemoveAll_0100====>"); - notification.removeAllSlots((err)=>{ - console.debug("====>removeAllSlots ActsAnsSlotAddRemoveAll_0100 callback====>"); - expect(err.code).assertEqual(0); - console.debug("====>getSlots start second ActsAnsSlotAddRemoveAll_0100====>"); - notification.getSlots((err, data)=>{ - console.debug("====>getSlots second 0100 err====>" + JSON.stringify(err)); - console.debug("====>getSlots second 0100 data====>" + JSON.stringify(data)); - console.debug("====>getSlots second 0100 data.length====>"+ data.length); - expect(data.length).assertEqual(0); - console.debug("====>ActsAnsSlotAddRemoveAll_0100 end====>"); - done(); - }) - }) - }catch(err){ - console.error("====>getSlots catch err ActsAnsSlotAddRemoveAll_0100====>" + JSON.stringify(err)); - expect().assertFail(); - done(); - } - }) - - }) - setTimeout(function (){ - console.debug("====>time out ActsAnsSlotAddRemoveAll_0100====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsSlotAddRemoveAll_0200 - * @tc.name : removeAllSlots after addSlots promise - * @tc.desc : Verify that removeAllSlots after addSlots - */ - it('ActsAnsSlotAddRemoveAll_0200', 0, async function (done) { - console.debug("====>ActsAnsSlotAddRemoveAll_0200 start====>"); - console.debug("====>addSlots start ActsAnsSlotAddRemoveAll_0200====>"); - await notification.addSlots([ - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: notification.SlotLevel.LEVEL_NONE, - desc: "slot_SOCIAL_COMMUNICATION_desc_second", - badgeFlag: true, - bypassDnd: false, - vibrationEnabled: false, - sound: "slot_SOCIAL_COMMUNICATION_sound_second", - lightEnabled: false, - lightColor: 1 - }, - { - type: notification.SlotType.SERVICE_INFORMATION, - level: notification.SlotLevel.LEVEL_MIN, - desc: "slot_SERVICE_INFORMATION_desc_second", - badgeFlag: true, - bypassDnd: false, - vibrationEnabled: false, - sound: "slot_SERVICE_INFORMATION_sound_second", - lightEnabled: false, - lightColor: 2 - }, - { - type: notification.SlotType.CONTENT_INFORMATION, - level: notification.SlotLevel.LEVEL_LOW, - desc: "slot_CONTENT_INFORMATION_desc_second", - badgeFlag: true, - bypassDnd: false, - vibrationEnabled: false, - sound: "slot_CONTENT_INFORMATION_sound_second", - lightEnabled: false, - lightColor: 3 - }, - { - type: notification.SlotType.OTHER_TYPES, - level: notification.SlotLevel.LEVEL_DEFAULT, - desc: "slot_OTHER_TYPES_desc_second", - badgeFlag: true, - bypassDnd: false, - vibrationEnabled: false, - sound: "slot_OTHER_TYPES_sound_second", - lightColor: 4 - } - ]); - console.debug("====>getSlots start ActsAnsSlotAddRemoveAll_0200====>"); - var data = await notification.getSlots(); - console.debug("====>getSlots ActsAnsSlotAddRemoveAll_0200 data:" + JSON.stringify(data)); - try{ - expect(data[0].type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data[0].level).assertEqual(notification.SlotLevel.LEVEL_NONE); - expect(data[0].desc).assertEqual("slot_SOCIAL_COMMUNICATION_desc_second"); - expect(data[0].badgeFlag).assertEqual(true); - expect(data[0].bypassDnd).assertEqual(false); - expect(data[0].vibrationEnabled).assertEqual(false); - expect(data[0].sound).assertEqual("slot_SOCIAL_COMMUNICATION_sound_second"); - expect(data[0].lightEnabled).assertEqual(false); - expect(data[0].lightColor).assertEqual(1); - - expect(data[1].type).assertEqual(notification.SlotType.SERVICE_INFORMATION); - expect(data[1].level).assertEqual(notification.SlotLevel.LEVEL_MIN); - expect(data[1].desc).assertEqual("slot_SERVICE_INFORMATION_desc_second"); - expect(data[1].badgeFlag).assertEqual(true); - expect(data[1].bypassDnd).assertEqual(false); - expect(data[1].vibrationEnabled).assertEqual(false); - expect(data[1].sound).assertEqual("slot_SERVICE_INFORMATION_sound_second"); - expect(data[1].lightEnabled).assertEqual(false); - expect(data[1].lightColor).assertEqual(2); - - expect(data[2].type).assertEqual(notification.SlotType.CONTENT_INFORMATION); - expect(data[2].level).assertEqual(notification.SlotLevel.LEVEL_LOW); - expect(data[2].desc).assertEqual("slot_CONTENT_INFORMATION_desc_second"); - expect(data[2].badgeFlag).assertEqual(true); - expect(data[2].bypassDnd).assertEqual(false); - expect(data[2].vibrationEnabled).assertEqual(false); - expect(data[2].sound).assertEqual("slot_CONTENT_INFORMATION_sound_second"); - expect(data[2].lightEnabled).assertEqual(false); - expect(data[2].lightColor).assertEqual(3); - - expect(data[3].type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data[3].level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); - expect(data[3].desc).assertEqual("slot_OTHER_TYPES_desc_second"); - expect(data[3].badgeFlag).assertEqual(true); - expect(data[3].bypassDnd).assertEqual(false); - expect(data[3].vibrationEnabled).assertEqual(false); - expect(data[3].sound).assertEqual("slot_OTHER_TYPES_sound_second"); - expect(data[3].lightColor).assertEqual(4); - console.debug("====>getSlots end ActsAnsSlotAddRemoveAll_0200====>"); - }catch(err){ - console.error("====>getSlots catch err ActsAnsSlotAddRemoveAll_0200====>" + JSON.stringify(err)); - expect().assertFail(); - done(); - } - console.debug("====>removeAllSlots start ActsAnsSlotAddRemoveAll_0200====>"); - await notification.removeAllSlots(); - console.debug("====>ActsAnsSlotAddRemoveAll_0200 end====>"); - done(); - setTimeout(function (){ - console.debug("====>time out ActsAnsSlotAddRemoveAll_0200====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsSlotAddRemoveAll_0300 - * @tc.name : removeAllSlots after addSlots repeatedly callback - * @tc.desc : Verify that removeAllSlots after addSlots repeatedly - */ - it('ActsAnsSlotAddRemoveAll_0300', 0, async function (done) { - console.debug("====>ActsAnsSlotAddRemoveAll_0300 start====>"); - console.debug("====>addSlots start ActsAnsSlotAddRemoveAll_0300====>"); - notification.addSlots([ - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: notification.SlotLevel.LEVEL_NONE, - desc: "slot_SOCIAL_COMMUNICATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SOCIAL_COMMUNICATION_sound", - lightEnabled: true, - lightColor: 1 - }, - { - type: notification.SlotType.SERVICE_INFORMATION, - level: notification.SlotLevel.LEVEL_MIN, - desc: "slot_SERVICE_INFORMATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SERVICE_INFORMATION_sound", - lightEnabled: true, - lightColor: 2 - }, - { - type: notification.SlotType.CONTENT_INFORMATION, - level: notification.SlotLevel.LEVEL_LOW, - desc: "slot_CONTENT_INFORMATION_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_CONTENT_INFORMATION_sound", - lightEnabled: true, - lightColor: 3 - }, - { - type: notification.SlotType.OTHER_TYPES, - level: notification.SlotLevel.LEVEL_DEFAULT, - desc: "slot_OTHER_TYPES_desc", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_OTHER_TYPES_sound", - lightEnabled: true, - lightColor: 4 - } - ], (err)=>{ - console.debug("====>addSlots callback ActsAnsSlotAddRemoveAll_0300====>"); - expect(err.code).assertEqual(0); - console.debug("====>addSlots second time ActsAnsSlotAddRemoveAll_0300====>"); - notification.addSlots([ - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: notification.SlotLevel.LEVEL_NONE, - desc: "slot_SOCIAL_COMMUNICATION_desc_twice", - badgeFlag: true, - bypassDnd: true, - vibrationEnabled: false, - sound: "slot_SOCIAL_COMMUNICATION_sound_twice", - lightEnabled: true, - lightColor: 5 - }, - { - type: notification.SlotType.SERVICE_INFORMATION, - level: notification.SlotLevel.LEVEL_MIN, - desc: "slot_SERVICE_INFORMATION_desc", - badgeFlag: false, - bypassDnd: false, - vibrationEnabled: true, - sound: "slot_SERVICE_INFORMATION_sound_twice", - lightEnabled: true, - lightColor: 6 - }, - { - type: notification.SlotType.CONTENT_INFORMATION, - level: notification.SlotLevel.LEVEL_LOW, - desc: "slot_CONTENT_INFORMATION_desc_twice", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_CONTENT_INFORMATION_sound_twice", - lightEnabled: false, - lightColor: 7 - }, - { - type: notification.SlotType.OTHER_TYPES, - level: notification.SlotLevel.LEVEL_DEFAULT, - desc: "slot_OTHER_TYPES_desc_twice", - badgeFlag: true, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_OTHER_TYPES_sound_twice", - lightEnabled: true, - lightColor: 8 - } - ], (err)=>{ - console.debug("====>addSlots twice callback ActsAnsSlotAddRemoveAll_0300====>"); - expect(err.code).assertEqual(0); - console.debug("====>getSlots start ActsAnsSlotAddRemoveAll_0300====>"); - notification.getSlots((err, data)=>{ - console.debug("====>getSlots callback ActsAnsSlotAddRemoveAll_0300====>"); - console.debug("====>getSlots err ActsAnsSlotAddRemoveAll_0300====>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlots data ActsAnsSlotAddRemoveAll_0300====>" + JSON.stringify(data)); - try{ - expect(data[0].type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data[0].level).assertEqual(notification.SlotLevel.LEVEL_NONE); - expect(data[0].desc).assertEqual("slot_SOCIAL_COMMUNICATION_desc"); - expect(data[0].badgeFlag).assertEqual(false); - expect(data[0].bypassDnd).assertEqual(true); - expect(data[0].vibrationEnabled).assertEqual(true); - expect(data[0].sound).assertEqual("slot_SOCIAL_COMMUNICATION_sound"); - expect(data[0].lightEnabled).assertEqual(true); - expect(data[0].lightColor).assertEqual(1); - - expect(data[1].type).assertEqual(notification.SlotType.SERVICE_INFORMATION); - expect(data[1].level).assertEqual(notification.SlotLevel.LEVEL_MIN); - expect(data[1].desc).assertEqual("slot_SERVICE_INFORMATION_desc"); - expect(data[1].badgeFlag).assertEqual(false); - expect(data[1].bypassDnd).assertEqual(true); - expect(data[1].vibrationEnabled).assertEqual(true); - expect(data[1].sound).assertEqual("slot_SERVICE_INFORMATION_sound"); - expect(data[1].lightEnabled).assertEqual(true); - expect(data[1].lightColor).assertEqual(2); - - expect(data[2].type).assertEqual(notification.SlotType.CONTENT_INFORMATION); - expect(data[2].level).assertEqual(notification.SlotLevel.LEVEL_LOW); - expect(data[2].desc).assertEqual("slot_CONTENT_INFORMATION_desc"); - expect(data[2].badgeFlag).assertEqual(false); - expect(data[2].bypassDnd).assertEqual(true); - expect(data[2].vibrationEnabled).assertEqual(true); - expect(data[2].sound).assertEqual("slot_CONTENT_INFORMATION_sound"); - expect(data[2].lightEnabled).assertEqual(true); - expect(data[2].lightColor).assertEqual(3); - - expect(data[3].type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data[3].level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); - expect(data[3].desc).assertEqual("slot_OTHER_TYPES_desc"); - expect(data[3].badgeFlag).assertEqual(false); - expect(data[3].bypassDnd).assertEqual(true); - expect(data[3].vibrationEnabled).assertEqual(true); - expect(data[3].sound).assertEqual("slot_OTHER_TYPES_sound"); - expect(data[3].lightEnabled).assertEqual(true); - expect(data[3].lightColor).assertEqual(4); - console.debug("====>getSlots end ActsAnsSlotAddRemoveAll_0300====>"); - console.debug("====>removeAllSlots start ActsAnsSlotAddRemoveAll_0300====>"); - notification.removeAllSlots((err)=>{ - console.debug("====>removeAllSlots ActsAnsSlotAddRemoveAll_0300 callback====>"); - expect(err.code).assertEqual(0); - console.debug("====>getSlots start second ActsAnsSlotAddRemoveAll_0300====>"); - notification.getSlots((err, data)=>{ - console.debug("====>getSlots second 0300 err====>" + JSON.stringify(err)); - console.debug("====>getSlots second 0300 data====>" + JSON.stringify(data)); - console.debug("====>getSlots second 0300 data.length====>"+ data.length); - expect(data.length).assertEqual(0); - console.debug("====>ActsAnsSlotAddRemoveAll_0300 end====>"); - done(); - }) - }) - }catch(err){ - console.error("====>getSlots catch err 0300====>" + JSON.stringify(err)); - expect().assertFail(); - done(); - } - }) - }) - - }) - setTimeout(function (){ - console.debug("====>time out ActsAnsSlotAddRemoveAll_0300====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsSlotAddRemoveAll_0400 - * @tc.name : removeAllSlots after addSlots repeatedly promise - * @tc.desc : Verify that removeAllSlots after addSlots repeatedly - */ - it('ActsAnsSlotAddRemoveAll_0400', 0, async function (done) { - console.debug("====>ActsAnsSlotAddRemoveAll_0400 start====>"); - console.debug("====>addSlots start ActsAnsSlotAddRemoveAll_0400====>"); - await notification.addSlots([ - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: notification.SlotLevel.LEVEL_NONE, - desc: "slot_SOCIAL_COMMUNICATION_desc_second", - badgeFlag: true, - bypassDnd: false, - vibrationEnabled: false, - sound: "slot_SOCIAL_COMMUNICATION_sound_second", - lightEnabled: false, - lightColor: 1 - }, - { - type: notification.SlotType.SERVICE_INFORMATION, - level: notification.SlotLevel.LEVEL_MIN, - desc: "slot_SERVICE_INFORMATION_desc_second", - badgeFlag: true, - bypassDnd: false, - vibrationEnabled: false, - sound: "slot_SERVICE_INFORMATION_sound_second", - lightEnabled: false, - lightColor: 2 - }, - { - type: notification.SlotType.CONTENT_INFORMATION, - level: notification.SlotLevel.LEVEL_LOW, - desc: "slot_CONTENT_INFORMATION_desc_second", - badgeFlag: true, - bypassDnd: false, - vibrationEnabled: false, - sound: "slot_CONTENT_INFORMATION_sound_second", - lightEnabled: false, - lightColor: 3 - }, - { - type: notification.SlotType.OTHER_TYPES, - level: notification.SlotLevel.LEVEL_DEFAULT, - desc: "slot_OTHER_TYPES_desc_second", - badgeFlag: true, - bypassDnd: false, - vibrationEnabled: false, - sound: "slot_OTHER_TYPES_sound_second", - lightColor: 4 - } - ]); - console.debug("====>addSlots twice start ActsAnsSlotAddRemoveAll_0400====>"); - await notification.addSlots([ - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - level: notification.SlotLevel.LEVEL_NONE, - desc: "slot_SOCIAL_COMMUNICATION_desc_second_twice", - badgeFlag: false, - bypassDnd: false, - vibrationEnabled: false, - sound: "slot_SOCIAL_COMMUNICATION_sound_second_twice", - lightEnabled: true, - lightColor: 1 - }, - { - type: notification.SlotType.SERVICE_INFORMATION, - level: notification.SlotLevel.LEVEL_MIN, - desc: "slot_SERVICE_INFORMATION_desc_second_twice", - badgeFlag: true, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_SERVICE_INFORMATION_sound_second_twice", - lightEnabled: true, - lightColor: 2 - }, - { - type: notification.SlotType.CONTENT_INFORMATION, - level: notification.SlotLevel.LEVEL_LOW, - desc: "slot_CONTENT_INFORMATION_desc_second_twice", - badgeFlag: true, - bypassDnd: false, - vibrationEnabled: true, - sound: "slot_CONTENT_INFORMATION_sound_second_twice", - lightEnabled: false, - lightColor: 3 - }, - { - type: notification.SlotType.OTHER_TYPES, - level: notification.SlotLevel.LEVEL_DEFAULT, - desc: "slot_OTHER_TYPES_desc_second_twice", - badgeFlag: false, - bypassDnd: true, - vibrationEnabled: true, - sound: "slot_OTHER_TYPES_sound_second_twice", - lightColor: 4 - } - ]); - console.debug("====>getSlots start ActsAnsSlotAddRemoveAll_0400====>"); - var data = await notification.getSlots(); - console.debug("====>getSlots enter ActsAnsSlotAddRemoveAll_0400====>"); - console.debug("====>getSlots data ActsAnsSlotAddRemoveAll_0400====>" + JSON.stringify(data)); - try{ - expect(data[0].type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data[0].level).assertEqual(notification.SlotLevel.LEVEL_NONE); - expect(data[0].desc).assertEqual("slot_SOCIAL_COMMUNICATION_desc_second"); - expect(data[0].badgeFlag).assertEqual(true); - expect(data[0].bypassDnd).assertEqual(false); - expect(data[0].vibrationEnabled).assertEqual(false); - expect(data[0].sound).assertEqual("slot_SOCIAL_COMMUNICATION_sound_second"); - expect(data[0].lightEnabled).assertEqual(false); - expect(data[0].lightColor).assertEqual(1); - - expect(data[1].type).assertEqual(notification.SlotType.SERVICE_INFORMATION); - expect(data[1].level).assertEqual(notification.SlotLevel.LEVEL_MIN); - expect(data[1].desc).assertEqual("slot_SERVICE_INFORMATION_desc_second"); - expect(data[1].badgeFlag).assertEqual(true); - expect(data[1].bypassDnd).assertEqual(false); - expect(data[1].vibrationEnabled).assertEqual(false); - expect(data[1].sound).assertEqual("slot_SERVICE_INFORMATION_sound_second"); - expect(data[1].lightEnabled).assertEqual(false); - expect(data[1].lightColor).assertEqual(2); - - expect(data[2].type).assertEqual(notification.SlotType.CONTENT_INFORMATION); - expect(data[2].level).assertEqual(notification.SlotLevel.LEVEL_LOW); - expect(data[2].desc).assertEqual("slot_CONTENT_INFORMATION_desc_second"); - expect(data[2].badgeFlag).assertEqual(true); - expect(data[2].bypassDnd).assertEqual(false); - expect(data[2].vibrationEnabled).assertEqual(false); - expect(data[2].sound).assertEqual("slot_CONTENT_INFORMATION_sound_second"); - expect(data[2].lightEnabled).assertEqual(false); - expect(data[2].lightColor).assertEqual(3); - - expect(data[3].type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data[3].level).assertEqual(notification.SlotLevel.LEVEL_DEFAULT); - expect(data[3].desc).assertEqual("slot_OTHER_TYPES_desc_second"); - expect(data[3].badgeFlag).assertEqual(true); - expect(data[3].bypassDnd).assertEqual(false); - expect(data[3].vibrationEnabled).assertEqual(false); - expect(data[3].sound).assertEqual("slot_OTHER_TYPES_sound_second"); - expect(data[3].lightColor).assertEqual(4); - console.debug("====>getSlots end ActsAnsSlotAddRemoveAll_0400====>"); - }catch(err){ - console.error("====>getSlots catch err ActsAnsSlotAddRemoveAll_0400====>" + JSON.stringify(err)); - expect().assertFail(); - done(); - } - console.debug("====>removeAllSlots start ActsAnsSlotAddRemoveAll_0400====>"); - await notification.removeAllSlots(); - console.debug("====>ActsAnsSlotAddRemoveAll_0400 end====>"); - done(); - setTimeout(function (){ - console.debug("====>time out ActsAnsSlotAddRemoveAll_0400====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsSlotAddRemoveAll_0500 - * @tc.name : removeAllSlots callback - * @tc.desc : Verify that removeAllSlots without adding slots - */ - it('ActsAnsSlotAddRemoveAll_0500', 0, async function (done) { - console.debug("====>removeAllSlots start ActsAnsSlotAddRemoveAll_0500====>"); - notification.removeAllSlots((err)=>{ - console.debug("====>removeAllSlots ActsAnsSlotAddRemoveAll_0500 err:" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - done(); - }) - console.debug("====>removeAllSlots ActsAnsSlotAddRemoveAll_0500====>"); - setTimeout(function (){ - console.debug("====>time out ActsAnsSlotAddRemoveAll_0500====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsSlotAddRemoveAll_0600 - * @tc.name : removeAllSlots promise - * @tc.desc : Verify that removeAllSlots without adding slots - */ - it('ActsAnsSlotAddRemoveAll_0600', 0, async function (done) { - console.debug("====>removeAllSlots start ActsAnsSlotAddRemoveAll_0600====>"); - notification.removeAllSlots().then(()=>{ - console.debug("====>removeAllSlots ActsAnsSlotAddRemoveAll_0600====>"); - done(); - }).catch((err)=>{ - console.debug("====>removeAllSlots ActsAnsSlotAddRemoveAll_0600 err:" + JSON.stringify(err)); - expect().assertFail(); - done(); - }) - console.debug("====>removeAllSlots ActsAnsSlotAddRemoveAll_0600====>"); - setTimeout(function (){ - console.debug("====>time out ActsAnsSlotAddRemoveAll_0600====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsSlotAddRemoveAll_0700 - * @tc.name : addSlots callback - * @tc.desc : Verify that addSlots with same type of slot - */ - it('ActsAnsSlotAddRemoveAll_0700', 0, async function (done) { - console.debug("====>start ActsAnsSlotAddRemoveAll_0700====>"); - await notification.addSlots([ - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - desc: "slot_SOCIAL_COMMUNICATION_desc_first" - }, - { - type: notification.SlotType.SOCIAL_COMMUNICATION, - desc: "slot_SERVICE_INFORMATION_desc_second" - } - ], (err)=>{ - console.debug("====>addSlots callback ActsAnsSlotAddRemoveAll_0700====>"); - expect(err.code).assertEqual(0); - console.debug("====>getSlots ActsAnsSlotAddRemoveAll_0700====>"); - notification.getSlots((err, data)=>{ - console.debug("====>getSlots enter ActsAnsSlotAddRemoveAll_0700====>"); - console.debug("====>getSlots err ActsAnsSlotAddRemoveAll_0700====>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.debug("====>getSlots data ActsAnsSlotAddRemoveAll_0700====>" + JSON.stringify(data)); - try{ - console.debug("====>getSlots ActsAnsSlotAddRemoveAll_0700 data.length:====>" + data.length); - expect(data.length).assertEqual(1); - expect(data[0].type).assertEqual(notification.SlotType.SOCIAL_COMMUNICATION); - expect(data[0].desc).assertEqual("slot_SERVICE_INFORMATION_desc_second"); - console.debug("====>getSlots end ActsAnsSlotAddRemoveAll_0700====>"); - notification.removeAllSlots((err)=>{ - console.debug("====>removeAllSlots ActsAnsSlotAddRemoveAll_0700 err:" + JSON.stringify(err)); - console.debug("====>ActsAnsSlotAddRemoveAll_0700 end====>"); - expect(err.code).assertEqual(0); - done(); - }) - }catch(err){ - console.error("====>getSlots catch err ActsAnsSlotAddRemoveAll_0700====>" + JSON.stringify(err)); - expect().assertFail(); - done(); - } - }) - }) - setTimeout(function (){ - console.debug("====>time out ActsAnsSlotAddRemoveAll_0700====>"); - }, TIMEOUT); - }) - - /* - * @tc.number : ActsAnsSlotAddRemoveAll_0800 - * @tc.name : addSlots promise - * @tc.desc : Verify that addSlots with same type of slot - */ - it('ActsAnsSlotAddRemoveAll_0800', 0, async function (done) { - console.debug("====>start ActsAnsSlotAddRemoveAll_0800====>"); - await notification.addSlots([ - { - type: notification.SlotType.OTHER_TYPES, - desc: "slot_SOCIAL_COMMUNICATION_desc_first" - }, - { - type: notification.SlotType.OTHER_TYPES, - desc: "slot_SERVICE_INFORMATION_desc_second" - } - ]); - console.debug("====>getSlots ActsAnsSlotAddRemoveAll_0800====>"); - var data = await notification.getSlots(); - console.debug("====>getSlots ActsAnsSlotAddRemoveAll_0800 data:" + JSON.stringify(data)); - try{ - console.debug("====>getSlots ActsAnsSlotAddRemoveAll_0800 data.length:====>" + data.length); - expect(data.length).assertEqual(1); - expect(data[0].type).assertEqual(notification.SlotType.OTHER_TYPES); - expect(data[0].desc).assertEqual("slot_SERVICE_INFORMATION_desc_second"); - console.debug("====>getSlots end ActsAnsSlotAddRemoveAll_0800====>"); - await notification.removeAllSlots(); - console.debug("====>ActsAnsSlotAddRemoveAll_0800 end====>"); - done(); - }catch(err){ - console.error("====>getSlots err ActsAnsSlotAddRemoveAll_0800====>" + JSON.stringify(err)); - expect().assertFail(); - done(); - } - setTimeout(function (){ - console.debug("====>time out ActsAnsSlotAddRemoveAll_0800====>"); - }, TIMEOUT); - }) -})} diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/test/List.test.js b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/test/List.test.js deleted file mode 100644 index 0907b31fe15246980550b9db63094862ec22bfab..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsSlotAddRemoveAll from './ExampleJsunit.test.js' -export default function testsuite() { -ActsAnsSlotAddRemoveAll() -} diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/resources/base/element/string.json b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/resources/base/element/string.json deleted file mode 100644 index dff94616b22458248f6370896f7ff633e1ba787f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string":[ - { - "name":"app_name", - "value":"ActsAnsSlotAddRemoveAll" - }, - { - "name":"mainability_description", - "value":"JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/resources/base/media/icon.png b/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/actsansslottest/actsansslottaddremoveall/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/BUILD.gn b/notification/ans_standard/publish_test/BUILD.gn deleted file mode 100644 index b1f3e9b64fb0103165525f0978e125b6a316f26d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/BUILD.gn +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import("//build/ohos_var.gni") - -group("publish_test") { - testonly = true - if (is_standard_system) { - deps = [ - #"actsanspublishcontroltest:ActsAnsPublishControlTest", - #"actsanspublishconversation:ActsAnsConversationTest", - "badgedisplayed:badgedisplayed", - "enablenotification:enablenotification", - "getactive:getactive", - "getwantagentinfo:ActsAnsGetWantAgentInfoTest", - - #"publishcontentype:publishcontentype", - #"subscribe:subscribe", - "activebtn:activebtn", - - #"actsansdistributedtest:ActsAnsDistributeTest", - "actsansgetallactive:ActsAnsGetAllActiveTestXts", - "ansactscancelgroup:ActsAnsCancelGroupTest", - "ansactsremovegroup:ActsAnsRemoveGroupTest", - - #"donotdisturbmode:ActsAnsDoNotDisturbTest", - - #"publish:ActsAnsNotificationPublishXts", - "publishsound:ActsAnsPublishSoundTest", - - #"publishvibra:ActsAnsPublishVibraTest", - #"sub:ActsAnsSubTestXts", - "unsubscribe:ActsAnsUnSubscriberTest", - "anssecondarydirectory:ActsAnsSecondaryDirectoryTest", - "publishremovalwantagent:ActsAnsPublishRemovalWantAgentTest", - "wantagent:wantagent", - ] - } -} diff --git a/notification/ans_standard/publish_test/activebtn/BUILD.gn b/notification/ans_standard/publish_test/activebtn/BUILD.gn deleted file mode 100644 index f3b78549dd161ccdc8371c135623c1cb7cd459d6..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/BUILD.gn +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -group("activebtn") { - testonly = true - if (is_standard_system) { - deps = [ - "activebutton:ActsAnsActionButtonTest", - "testa:testA", - "testb:testB", - "testc:testC", - ] - } -} diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/BUILD.gn b/notification/ans_standard/publish_test/activebtn/activebutton/BUILD.gn deleted file mode 100644 index 0c8a2299399ed74dbdfded23a028f0582c32c11e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsActionButtonTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsActionButtonTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/Test.json b/notification/ans_standard/publish_test/activebtn/activebutton/Test.json deleted file mode 100644 index 4439dcde1992e2253ff070d3eb8c3ec786d05177..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/Test.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "shell-timeout": "180000", - "bundle-name": "com.example.actsansactionbuttontest", - "package-name": "com.example.actsansactionbuttontest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsActionButtonTest.hap", - "testA.hap", - "testB.hap", - "testC.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/activebtn/activebutton/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/activebtn/activebutton/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/config.json b/notification/ans_standard/publish_test/activebtn/activebutton/src/main/config.json deleted file mode 100644 index 1cb2c45cfafed37fdd0737ab71f1b861ddea2cb8..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansactionbuttontest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansactionbuttontest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 44f4bc0a213133ced33d70b9220c26b66a088726..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - activeButton - -
diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/test/ActiveButton.js b/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/test/ActiveButton.js deleted file mode 100644 index a68143f3627e28fb7c4b9b4cdec03e7270985595..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/test/ActiveButton.js +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import notify from '@ohos.notification' -import WantAgent from '@ohos.wantAgent' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' - -export default function ActsAnsActionButtonTest() { -describe('ActsAnsActionButtonTest', function () { - console.info("===ActsDoNotSubscriberTest start===>"); - function publishCallbacka(err){ - console.debug("===>publishCallbacka===>"+err.code); - expect(err.code).assertEqual(0) - } - function publishCallbackb(err){ - console.debug("===>publishCallbackb===>"+err.code); - expect(err.code).assertEqual(0) - } - function publishCallbackc(err){ - console.debug("===>publishCallbackc===>"+err.code); - expect(err.code).assertEqual(0) - } - - function consumeCallbackA(data) { - console.debug("===>consumeCallbackA data : ===>" +JSON.stringify(data)); - var triggerInfo = { - code:0 - } - expect(data.request.actionButtons[0].title).assertEqual("buttonA") - var wantAgenta = data.request.actionButtons[0].wantAgent - console.debug("===>titleA: ===>" + JSON.stringify(data.request.actionButtons[0].title)) - console.debug("===>wantAgentA: ===>" + JSON.stringify(wantAgenta)) - WantAgent.trigger(wantAgenta, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('==== triggerA success' + err.code+JSON.stringify(data) ); - } else { - console.info('----triggerA failed!----'+err.code); - } - } - ); - } - - /* - * @tc.number: ActsActiveButton_test_0100 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsActiveButton_test_0100', 0, async function (done) { - console.debug("===ActsActiveButton_test_0100===begin===>"); - var subInfo ={ - onConsume:consumeCallbackA - } - notify.subscribe(subInfo); - - var agentInfoA = { - wants: [ - { - bundleName: "com.example.wantAgentTest", - abilityName: "com.example.wantAgentTest.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - } - ], - operationType: WantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] - }; - var wantAgentData = await WantAgent.getWantAgent(agentInfoA); - - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, - longText : { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - longText: "long_text", - briefText: "long_briefText", - expandedTitle: "long_expandedTitle" - }, - }, - id: 1, - slotType : notify.SlotType.SERVICE_INFORMATION, - actionButtons: [{title:"buttonA", wantAgent:wantAgentData}] - } - await notify.publish(notificationRequest, publishCallbacka); - console.info("===ActsActiveButton_test_0100===end===>"); - setTimeout((async function(){ - notify.unsubscribe(subInfo); - console.info("======ActsActiveButton_test_0100 setTimeout unsubscribe===>"); - done(); - }),300); - }) - - //consume - function consumeCallbackB(data) { - console.debug("===>consumeCallbackB data : ===>" +JSON.stringify(data)); - var triggerInfo = { - code:1 - } - expect(data.request.actionButtons[0].title).assertEqual("buttonB") - var wantAgentB = data.request.actionButtons[0].wantAgent - console.debug("===>titleB: ===>" + JSON.stringify(data.request.actionButtons[0].title)) - console.debug("===>wantAgentB: ===>" + JSON.stringify(wantAgentB)) - WantAgent.trigger(wantAgentB, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('==== triggerB success' + err.code+JSON.stringify(data) ); - } else { - console.info('----triggerB failed!----'+err.code); - } - } - ); - } - - /* - * @tc.number: ActsActiveButton_test_0200 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsActiveButton_test_0200', 0, async function (done) { - console.debug("===ActsActiveButton_test_0200===begin===>"); - var subInfo ={ - onConsume:consumeCallbackB - } - notify.subscribe(subInfo); - - var agentInfoB = { - wants: [ - { - bundleName: "com.example.wantAgentTest", - abilityName: "com.example.wantAgentTest.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - } - ], - operationType: WantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[WantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] - }; - var wantAgentDataB = await WantAgent.getWantAgent(agentInfoB); - - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, - longText : { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - longText: "long_text", - briefText: "long_briefText", - expandedTitle: "long_expandedTitle" - }, - }, - id: 2, - slotType : notify.SlotType.SERVICE_INFORMATION, - actionButtons: [{title:"buttonB", wantAgent:wantAgentDataB}] - } - await notify.publish(notificationRequest).then(()=>{ - console.info("===ActsActiveButton_test_0200===promise===>"); - }); - setTimeout((async function(){ - notify.unsubscribe(subInfo); - console.info("======ActsActiveButton_test_0200 setTimeout unsubscribe===>"); - done(); - }),300); - }) - - - function consumeCallbackC(data) { - console.debug("===>consumeCallbackC data : ===>" +JSON.stringify(data)); - var triggerInfoC = { - code:2 - } - var triggerInfoD = { - code:3 - } - expect(data.request.actionButtons[0].title).assertEqual("buttonC") - expect(data.request.actionButtons[1].title).assertEqual("buttonD") - var wantAgentC = data.request.actionButtons[0].wantAgent - var wantAgentD = data.request.actionButtons[1].wantAgent - console.debug("===>wantAgentC: ===>" + JSON.stringify(wantAgentC)) - console.debug("===>wantAgentD: ===>" + JSON.stringify(wantAgentD)) - WantAgent.trigger(wantAgentC, triggerInfoC, - (err, data) => { - if (err.code == 0) { - console.info('==== triggerC success' + err.code+JSON.stringify(data) ); - } else { - console.info('----triggerC failed!----'+err.code); - } - }); - WantAgent.trigger(wantAgentD, triggerInfoD, - (err, data) => { - if (err.code == 0) { - console.info('==== triggered success' + err.code + JSON.stringify(data) ); - } else { - console.info('----triggered failed!----'+ err.code); - } - }); - } -}) - -} diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/test/List.test.js deleted file mode 100644 index 813c446f58760c01585ade795f85fb44ad176ffb..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/test/List.test.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsActionButtonTest from './ActiveButton.js' -import ActsAnsPublishIconTest from './publishIcon.js' -import ActsAnsPublishImageTest from './publishImage.js' -export default function testsuite() { -ActsAnsActionButtonTest() -ActsAnsPublishIconTest() -ActsAnsPublishImageTest() -} diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/test/publishIcon.js b/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/test/publishIcon.js deleted file mode 100644 index 9359f3dcf944d7ce0f6d497d9d393778feb67ef7..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/test/publishIcon.js +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import notification from '@ohos.notification' -import image from '@ohos.multimedia.image' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -var largeIconA -var smallIconA -var largeBufferA -var smallBufferA -var largeOptsA -var smallOptsA - -var largeIconB -var smallIconB -var largeBufferB -var smallBufferB -var largeOptsB -var smallOptsB - -var largeIconC -var smallIconC -var largeBufferC -var smallBufferC -var largeOptsC -var smallOptsC - -var largeIconD -var smallIconD -var largeBufferD -var smallBufferD -var largeOptsD -var smallOptsD - -export default function ActsAnsPublishIconTest() { -describe('ActsAnsPublishIconTest', function () { - function publishCallbackA(err){ - console.log('ActsAnsPublishIconTest publishCallbackA asyncCallback'+err.code) - expect(err.code).assertEqual(0) - } - function publishCallbackB(err){ - console.log('ActsAnsPublishIconTest publishCallbackB asyncCallback'+err.code) - expect(err.code != 0).assertEqual(true); - } - function consumeCallbackA(data) { - console.debug("===consumeCallbackA data : ===>" + JSON.stringify(data)); - expect(data.request.id).assertEqual(1) - } - function consumeCallbackB(data) { - console.debug("===consumeCallbackB data : ===>" + JSON.stringify(data)); - expect(data.request.id).assertEqual(2) - } - - function subscribeCallbackA(err) { - console.info("===subscribeCallbackA err : ===>" + JSON.stringify(err)); - expect(err.code).assertEqual(0) - } - function subscribeCallbackB(err) { - console.info("===subscribeCallbackB err : ===>" + JSON.stringify(err)); - expect(err.code).assertEqual(0) - } - - - /* - * @tc.number: ACTS_PublishIconTest_0300 - * @tc.name: publish() - * @tc.desc: verify the function of publish - */ - it('ACTS_PublishIconTest_0300', 0,async function (done) { - largeBufferC = new ArrayBuffer(4*1024*50); - smallBufferC = new ArrayBuffer(4*2*25); - largeOptsC = {alphaType: 0, editable: true, pixelFormat: 0, scaleMode: 1, size: {height: 50, width: 1024}} - smallOptsC = {alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: {height: 25, width: 2}} - const promise_Large = image.createPixelMap(largeBufferC, largeOptsC); - promise_Large.then((data) => { - largeIconC = data; - console.debug("===createPixelMapC largeIcon===>"+JSON.stringify(largeIconC)); - const promise_Small = image.createPixelMap(smallBufferC, smallOptsC); - promise_Small.then((data) => { - smallIconC = data; - console.debug("===createPixelMapC smallIcon===>"+JSON.stringify(smallIconC)); - - notification.publish({ - content:{ - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_titleC", - text: "test_textC", - additionalText: "test_additionalTextC" - }, - }, - id: 3, - slotType : notification.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0100_1", - badgeIconStyle: 1, - showDeliveryTime: true, - smallIcon:smallIconC, - largeIcon:largeIconC, - },publishCallbackB); - done(); - }) - }); - }); - - /* - * @tc.number: ACTS_PublishTest_0400 - * @tc.name: publish() - * @tc.desc: verify the function of publish - */ - it('ACTS_PublishIconTest_0400', 0,async function (done) { - largeBufferD = new ArrayBuffer(4*1024*50); - smallBufferD = new ArrayBuffer(4*2*25); - largeOptsD = {alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: {height: 50, width: 1024}} - smallOptsD = {alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: {height: 25, width: 2}} - const promise_Large = image.createPixelMap(largeBufferD, largeOptsD); - promise_Large.then((data) => { - largeIconD = data; - console.debug("===createPixelMapD largeIcon===>"+JSON.stringify(largeIconD)); - const promise_Small = image.createPixelMap(smallBufferD, smallOptsD); - promise_Small.then((data) => { - smallIconD = data; - console.debug("===createPixelMapD smallIcon===>"+JSON.stringify(smallIconD)); - - notification.publish({ - content:{ - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test1_title", - text: "test1_text", - additionalText: "test1_additionalText" - }, - }, - id: 4, - slotType : notification.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0100_1", - badgeIconStyle: 1, - showDeliveryTime: true, - smallIcon:smallIconD, - largeIcon:largeIconD, - }).then().catch((err)=>{ - console.debug("===ACTS_PublishIconTest_0400 promise===>"+err.code); - expect(err.code != 0).assertEqual(true); - done() - }); - }) - }); - }); -}) -} diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/test/publishImage.js b/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/test/publishImage.js deleted file mode 100644 index 839e0fde58da99851090a9846e5dac605403d60d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/js/test/publishImage.js +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import notify from '@ohos.notification' -import image from '@ohos.multimedia.image' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -var BufferA -var BufferB -var BufferC -var BufferD -var optsA -var optsB -var optsC -var optsD -var pubimageA -var pubimageB -var pubimageC -var pubimageD -export default function ActsAnsPublishImageTest() { -describe('ActsAnsPublishImageTest', function () { - console.info("===ActsAnsPublishImageTest start===>"); - - //consume - function consumeCallbackA(data) { - console.debug("===>consumeDoNotCallback1 data : ===>" + JSON.stringify(data)); - expect(data.request.id).assertEqual(1) - } - function consumeCallbackB(data) { - console.debug("===>consumeDoNotCallback2 data : ===>" +JSON.stringify(data)); - expect(data.request.id).assertEqual(2) - } - //subscribe - function subscribeCallbackA(err) { - console.debug("===>subscribeCallbackA===>"+err.code); - expect(err.code).assertEqual(0) - } - function subscribeCallbackB(err) { - console.debug("===>subscribeCallbackB===>"+err.code); - expect(err.code).assertEqual(0) - } - function publishCallbackA(err){ - console.log('ActsAnsPublishImageTest publishCallbackA asyncCallback'+err.code) - expect(err.code).assertEqual(0) - } - function publishCallbackB(err){ - console.log('ActsAnsPublishImageTest publishCallbackB asyncCallback'+err.code) - expect(err.code != 0).assertEqual(true); - } - - - /* - * @tc.number: ActsPublishImage_test_0300 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsPublishImage_test_0300', 0, async function (done) { - console.debug("===ActsPublishImage_test_0300===begin===>"); - BufferC = new ArrayBuffer( 4*1024* 2048); - optsC = {alphaType: 0, editable: true, pixelFormat: 0, scaleMode: 1, size: {height: 1024, width: 2048}} - - const promise_Large = image.createPixelMap(BufferC, optsC); - promise_Large.then((data) => { - pubimageC = data; - console.debug("====createPixelMapC image===>"+pubimageC); - - notify.publish({ - id: 3, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_PICTURE, - picture: { - title: "image_titleC", - text: "image_textC", - additionalText: "image_additionalTextC", - briefText:"image_briefC", - expandedTitle:"expandedTitleC", - picture:pubimageC - }, - }, - slotType:notify.SlotType.SOCIAL_COMMUNICATION, - classification:"classificationC", - sortingKey:"sortingKeyC", - },publishCallbackB); - done(); - }) - }) - - /* - * @tc.number: ActsPublishImage_test_0400 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsPublishImage_test_0400', 0, async function (done) { - console.debug("===ActsPublishImage_test_0400===begin===>"); - BufferD = new ArrayBuffer( 4*1024* 2048); - optsD = {alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: {height: 1024, width: 2048}} - - const promise_Large = image.createPixelMap(BufferD, optsD); - promise_Large.then((data) => { - pubimageD = data; - console.debug("===createPixelMapD image===>"+pubimageD); - - notify.publish({ - id: 4, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_PICTURE, - picture: { - title: "image_titleD", - text: "image_textD", - additionalText: "image_additionalTextD", - briefText:"image_briefD", - expandedTitle:"expandedTitleD", - picture:pubimageD - }, - }, - slotType:notify.SlotType.SOCIAL_COMMUNICATION, - classification:"classificationD", - sortingKey:"sortingKeyD", - }).then().catch((err)=>{ - console.debug("===ActsPublishImage_test_0400 err===>"+err.code); - expect(err.code != 0).assertEqual(true); - done(); - }); - }) - }) - }) - - -} diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/activebtn/activebutton/src/main/resources/base/element/string.json deleted file mode 100644 index d9400769ce6a7a3180283a9c39a17262a9538031..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ActiveBtn" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/activebtn/activebutton/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/activebtn/activebutton/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/activebtn/testa/BUILD.gn b/notification/ans_standard/publish_test/activebtn/testa/BUILD.gn deleted file mode 100644 index 207e9b317fd9fe7326bf26bd1e43ec2547093616..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testa/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("testA") { - hap_profile = "./entry/src/main/config.json" - hap_name = "testA" - subsystem_name = "notification" - part_name = "distributed_notification_service" - testonly = true - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/config.json b/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/config.json deleted file mode 100644 index 1bbe141d2ebe0f7a884651fc81b08bbde38931cd..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/config.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "app": { - "bundleName": "com.example.wantAgentTestA", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.wantAgentTestA", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.wantAgentTestA.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index aa13e19ea206c08a562754f7cef3572726e96941..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - Page 1 - -
diff --git a/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index 6e1cc7770a86a2b0add36fa1bdeaa1e0673ef31e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index f65b394eb7a98a4058d726bacda53fe1221d909d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "test1" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/activebtn/testa/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/activebtn/testa/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/activebtn/testa/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/activebtn/testa/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/activebtn/testb/BUILD.gn b/notification/ans_standard/publish_test/activebtn/testb/BUILD.gn deleted file mode 100644 index cd6e8eceeac2067dbdeb008d614c6b1b8654e6a3..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testb/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("testB") { - hap_profile = "./entry/src/main/config.json" - hap_name = "testB" - subsystem_name = "notification" - part_name = "distributed_notification_service" - testonly = true - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/config.json b/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/config.json deleted file mode 100644 index d9917cc1f971d46a3e5d18a09ae9fbd367272ba9..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/config.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "app": { - "bundleName": "com.example.wantAgentTestB", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.wantAgentTestB", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.wantAgentTestB.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 5f0dc11c72dd500785428632bfbba9d776ab70ac..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - Page 2 - -
diff --git a/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index 6e1cc7770a86a2b0add36fa1bdeaa1e0673ef31e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index ef239e584f5a0fbfa932d1ec4897291ba92b9765..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "test2" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/activebtn/testb/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/activebtn/testb/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/activebtn/testb/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/activebtn/testb/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/activebtn/testc/BUILD.gn b/notification/ans_standard/publish_test/activebtn/testc/BUILD.gn deleted file mode 100644 index a84fb16aba7fddfce6890854fe8f58897b11034b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testc/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("testC") { - hap_profile = "./entry/src/main/config.json" - hap_name = "testC" - subsystem_name = "notification" - part_name = "distributed_notification_service" - testonly = true - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/config.json b/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/config.json deleted file mode 100644 index 98673af19ce97ddb259377c2efbb21bf13586386..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/config.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "app": { - "bundleName": "com.example.wantAgentTestC", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.wantAgentTestC", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.wantAgentTestC.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 09696c297ee9837d996bd113bf8d41b67f236f7b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - .container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 68e58158a1ab2820a5aac524a6b3edafc09ed52b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - 页面3 - -
diff --git a/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index 6e1cc7770a86a2b0add36fa1bdeaa1e0673ef31e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index b3bd2eb154f549353d38d9d76af8d80bfccc14cb..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "test3" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/activebtn/testc/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/activebtn/testc/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/activebtn/testc/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/activebtn/testc/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/BUILD.gn b/notification/ans_standard/publish_test/actsansdistributedtest/BUILD.gn deleted file mode 100644 index df875f936b0a7e840e00c25358020aa511fcc922..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansdistributedtest/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsDistributeTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsDistributeTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/Test.json b/notification/ans_standard/publish_test/actsansdistributedtest/Test.json deleted file mode 100644 index 265bd964be8f74a7c636bd68ba3e16bd6ae26f7e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansdistributedtest/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "60000", - "shell-timeout": "60000", - "bundle-name": "com.example.actsansdistributetest", - "package-name": "com.example.actsansdistributetest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsDistributeTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/actsansdistributedtest/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/actsansdistributedtest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/config.json b/notification/ans_standard/publish_test/actsansdistributedtest/src/main/config.json deleted file mode 100644 index 7d7ea2ecc7494348fc41a82b893ec0afe283183e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansdistributetest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansdistributetest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 5c52a87a04f583e9d5f4db1dd40d4eafdb9b6aeb..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index a84867b3cf7fd2e4164591ca4a1f2bdc3ef80ffc..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 分布式自动化 - -
diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/test/List.test.js deleted file mode 100644 index fd711d154cc98dc99c26140909332f85117dcfa3..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsDistributeTest from './actsansdistributedtest.js' -export default function testsuite() { -ActsAnsDistributeTest() -} diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/test/actsansdistributedtest.js b/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/test/actsansdistributedtest.js deleted file mode 100644 index 6b19fe74fed2ea9917513f8a3473c3984122703f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/js/test/actsansdistributedtest.js +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import notify from '@ohos.notification' -import wantAgent from '@ohos.wantAgent' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -var timeout = 1800; - -export default function ActsAnsDistributeTest() { - describe('ActsAnsDistributeTest', function () { - - /* - * @tc.number: ActsDistribute_test_0100 - * @tc.name: enableDistributed() - * @tc.desc: verify the function of enableDistributed,isDistributedEnabled - */ - it('ActsDistribute_test_0100', 0, async function (done) { - await notify.enableDistributed(false,async() => { - await notify.isDistributedEnabled((err,data) => { - console.log("===>ActsDistribute_test_0100 success===>"+err+data) - expect(data).assertEqual(false) - done(); - }) - }) - }) - - /* - * @tc.number: ActsDistribute_test_0200 - * @tc.name: enableDistributedByBundle() - * @tc.desc: verify the function of enableDistributedByBundle,isDistributedEnableByBundle - */ - it('ActsDistribute_test_0200', 0, async function (done) { - await notify.enableDistributedByBundle({ - bundle:"com.example.actsansdistributetest" - },true,async() => { - await notify.isDistributedEnableByBundle({ - bundle:"com.example.actsansdistributetest", - },(err,data) => { - console.log("===>ActsDistribute_test_0200 success===>"+err+data) - expect(data).assertEqual(true) - done(); - }) - }) - }) - - /* - * @tc.number: ActsDistribute_test_0300 - * @tc.name: getDeviceRemindType() - * @tc.desc: verify the function of getDeviceRemindType - */ - it('ActsDistribute_test_0300', 0, async function (done) { - await notify.getDeviceRemindType((err,data) => { - console.debug("===>ActsDistribute_test_0300===>"+ JSON.stringify(data)) - if (data != notify.DeviceRemindType.IDLE_DONOT_REMIND - && data != notify.DeviceRemindType.IDLE_REMIND - && data != notify.DeviceRemindType.ACTIVE_DONOT_REMIND - && data != notify.DeviceRemindType.ACTIVE_REMIND ) - { - expect().assertFail(); - } - done(); - }); - }) - - /* - * @tc.number: ActsDistribute_test_0400 - * @tc.name: publish() - * @tc.desc: verify the function of publish - */ - it('ActsDistribute_test_0400', 0, async function (done) { - function onConsume0100(data) { - console.info("========ActsDistribute_test_0400 onConsume data:=======>" + JSON.stringify(data)); - if (data.request.distributedOption.remindType != notify.DeviceRemindType.IDLE_DONOT_REMIND - && data.request.distributedOption.remindType != notify.DeviceRemindType.IDLE_REMIND - && data.request.distributedOption.remindType != notify.DeviceRemindType.ACTIVE_DONOT_REMIND - && data.request.distributedOption.remindType != notify.DeviceRemindType.ACTIVE_REMIND ) - { - expect().assertFail(); - } - expect(data.request.deviceId).assertEqual(""); - console.info("ActsDistribute_test_0400 onConsume data"+JSON.stringify(data.request.notifyFlags)); - expect(JSON.stringify(data.request.notifyFlags)).assertEqual(undefined); - } - await notify.enableDistributed(true); - await notify.enableDistributedSelf(true); - console.info("==================ActsDistribute_test_0400 start==================>"); - var subscriber ={ - onConsume:onConsume0100, - } - await notify.subscribe(subscriber); - let DistributedOptions = { - isDistributed: true, - supportDisplayDevices: ["0"], - supportOperateDevices: ["0"] - } - var notifyRequest = { - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test13_title", - text: "test13_text", - additionalText: "test13_additionalText" - } - }, - id: 4, - label: "ANS_PublishBasicText_0100", - slotType : notify.SlotType.CONTENT_INFORMATION, - distributedOption:DistributedOptions - } - await notify.publish(notificationRequest); - console.info("===========ActsDistribute_test_0400 publish promise========>"); - setTimeout((async function(){ - console.info("======ActsDistribute_test_0400 setTimeout==============>"); - await notify.unsubscribe(subscriber); - console.info("======ActsDistribute_test_0400 setTimeout unsubscribe==>"); - done(); - }),timeout); - }) - - /* - * @tc.number: ActsDistribute_test_0500 - * @tc.name: onEnabledNotificationChanged() - * @tc.desc: verify the function of onEnabledNotificationChanged - */ - it('ActsDistribute_test_0500', 0, async function (done) { - function onEnablednotifyChanged001(data){ - console.log("===>onEnablednotifyChanged001 success===>"+JSON.stringify(data)) - console.log("===>onEnablednotifyChanged001 bundle===>"+JSON.stringify(data.bundle)) - console.log("===>onEnablednotifyChanged001 uid===>"+JSON.stringify(data.uid)) - console.log("===>onEnablednotifyChanged001 enable===>"+JSON.stringify(data.enable)) - expect(JSON.stringify(data.bundle)).assertEqual("com.example.actsansdistributetest"); - expect(JSON.stringify(data.uid)).assertEqual("454231"); - expect(JSON.stringify(data.enable)).assertEqual(true); - } - function connectCallbacka() { - console.debug("==>connectCallbacka code==>"); - } - var subscriber ={ - onConnect:connectCallbacka, - onEnablednotifyChanged:onEnablednotifyChanged001, - } - await notify.subscribe(subscriber,async(err)=>{ - console.debug("==>subscribeCallback code==>" +err.code); - expect(err.code).assertEqual(0); - await notify.requestEnablenotify((err) => { - console.log("===>ActsDistribute_test_0500 success===>"+err.code) - }) - }); - setTimeout((async function(){ - console.info("======ActsDistribute_test_0500 setTimeout==============>"); - await notify.unsubscribe(subscriber); - console.info("======ActsDistribute_test_0500 setTimeout unsubscribe==>"); - done(); - }),timeout); - }) - - /* - * @tc.number: ActsDistribute_test_0600 - * @tc.name: Query whether the template exists - * @tc.desc: isSupportTemplate(templateName: string, callback: AsyncCallback): void - */ - it('ActsDistribute_test_0600', 0, async function (done) { - console.info("==>ActsDistribute_test_0600 start==>"); - var templateName = '/system/etc/notification_template/assets/js/downloadTemplate.js'; - function isSupportTemplateCallback(err, data) { - if(err) { - console.error("isSupportTemplateCallback" + err.code); - } else { - expect(true).assertTrue(); - console.info("isSupportTemplateCallback" + JSON.stringify(data)); - done(); - } - } - notify.isSupportTemplate(templateName, isSupportTemplateCallback); - done(); - }) - - /* - * @tc.number: ActsDistribute_test_0700 - * @tc.name: Query whether the template exists - * @tc.desc: isSupportTemplate(templateName: string): Promise - */ - it('ActsDistribute_test_0700', 0, async function (done) { - console.info("==>ActsDistribute_test_0700 start==>"); - var templateName = '/system/etc/notification_template/assets/js/downloadTemplate.js'; - notify.isSupportTemplate(templateName).then ((data) => { - expect(data).assertEqual(false); - console.info("isSupportTemplatePromise"); - console.info("==>ActsDistribute_test_0700 success==>" + JSON.stringify(data)); - done(); - }) - done(); - }) - - /* - * @tc.number: ActsDistribute_test_0800 - * @tc.name: add NotificationActionButton - * @tc.desc: NotificationActionButton userInput inputKey - */ - it('ActsDistribute_test_0800', 0, async function (done) { - const TAG = 'NotificationActionButton ===> ' - const BundleOption = { - bundle: 'com.example.actsansdistributetest' - } - await notify.isNotificationEnabled(BundleOption, (err, data) => { - if (err.code) { - console.info(TAG + ': isNotificationEnabled failed! Err.code ===> ' + JSON.stringify(err.code)) - console.info(TAG + ': isNotificationEnabled failed! Err.message ===> ' + JSON.stringify(err.message)) - expect(false).assertTrue() - } else { - console.info(TAG + ': isNotificationEnabled success! Result ===> ' + JSON.stringify(data)) - expect(true).assertTrue() - } - }) - - async function SubscribeCallbackData(data) { - console.info(TAG + ': data ===> ' + JSON.stringify(data)) - console.info(TAG + ': data.request.content.normal.title ===> ' + JSON.stringify(data.request.content.normal.title)) - console.info(TAG + ': data.request.content.normal.text ===> ' + JSON.stringify(data.request.content.normal.text)) - console.info(TAG + ': data.request.content.normal.additionalText ===> ' + JSON.stringify(data.request.content.normal.additionalText)) - console.info(TAG + ': data.request.actionButtons[0].title ===> ' + JSON.stringify(data.request.actionButtons[0].title)) - expect(data.request.content.normal.title).assertEqual('title'); - expect(data.request.content.normal.text).assertEqual('text'); - expect(data.request.content.normal.additionalText).assertEqual('additionalText'); - expect(data.request.content.normal.creatorBundleName).assertEqual(BundleOption.bundle); - expect(data.request.content.normal.creatorPid != undefined).assertTrue() - expect(data.request.content.normal.creatorUid != undefined).assertTrue() - expect(data.request.actionButtons[0].title).assertEqual('additionalText'); - expect(data.request.actionButtons[0].extras.wantAgentInfo_key_1).assertEqual('wantAgentInfo_key_1') - expect(data.request.actionButtons[0].extras.wantAgentInfo_key_2).assertEqual('wantAgentInfo_key_2') - expect(data.request.actionButtons[0].userInput.inputKey).assertEqual('Please input at this') - expect(true).assertTrue() - - await notify.unsubscribe(NotificationSubscriber, (err) => { - if (err.code) { - console.info(TAG + ': unsubscribe failed! Err.code ===> ' + JSON.stringify(err.code)) - console.info(TAG + ': unsubscribe failed! Err.message ===> ' + JSON.stringify(err.message)) - expect(false).assertTrue() - done() - } else { - console.info(TAG + ': unsubscribe success!') - expect(true).assertTrue() - } - }) - } - - let NotificationSubscriber = { - onConsume: SubscribeCallbackData - } - - await notify.subscribe(NotificationSubscriber, (err) => { - if (err.code) { - console.info(TAG + ': subscribe failed! Err.code ===> ' + JSON.stringify(err.code)) - console.info(TAG + ': subscribe failed! Err.message ===> ' + JSON.stringify(err.message)) - expect(false).assertTrue() - } else { - console.info(TAG + ': subscribe success!') - expect(true).assertTrue() - done() - } - }) - - let wantAgentInfo = { - wants: [ - { - bundleName: 'com.example.actsansdistributetest', - abilityName: 'com.example.actsansdistributetest.TestAbility' - } - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags: [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG], - extraInfo: { - key_1: 'value_1', - key_2: 'value_2', - } - } - - let wantAgentInstance = await wantAgent.getWantAgent(wantAgentInfo) - const NotificationRequest = { - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: 'title', - text: 'text', - additionalText: 'additionalText' - }, - }, - actionButtons: [ - { - title: 'activeButton_title', - wantAgent: wantAgentInstance, - extras: { - wantAgentInfo_key_1: 'wantAgentInfo_key_1', - wantAgentInfo_key_2: 'wantAgentInfo_key_2', - }, - userInput: { - inputKey: 'Please input at this' - } - } - ], - } - - await notify.publish(NotificationRequest, (err) => { - if (err.code) { - console.info(TAG + ': publish failed! Err.code ===> ' + JSON.stringify(err.code)) - console.info(TAG + ': publish failed! Err.message ===> ' + JSON.stringify(err.message)) - expect(false).assertTrue() - } else { - console.info(TAG + ': publish successd!') - expect(true).assertTrue() - } - }) - }) - - }) -} diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/actsansdistributedtest/src/main/resources/base/element/string.json deleted file mode 100644 index 5581f06dd5a57ff7bdd0e1314a98dba0f30a027c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "distribute" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/actsansdistributedtest/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/actsansdistributedtest/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/actsansgetallactive/BUILD.gn b/notification/ans_standard/publish_test/actsansgetallactive/BUILD.gn deleted file mode 100644 index 8117c33920823c4f1bda68bc1a5df4118ca8ca6e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansgetallactive/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsGetAllActiveTestXts") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsGetAllActiveTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/actsansgetallactive/Test.json b/notification/ans_standard/publish_test/actsansgetallactive/Test.json deleted file mode 100644 index 590894bf8618bcd078a514c9576d4dfaea9d048f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansgetallactive/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "shell-timeout": "180000", - "bundle-name": "com.example.actsansgetallactivetest", - "package-name": "com.example.actsansgetallactivetest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsGetAllActiveTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsansgetallactive/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/actsansgetallactive/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/actsansgetallactive/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/actsansgetallactive/src/main/config.json b/notification/ans_standard/publish_test/actsansgetallactive/src/main/config.json deleted file mode 100644 index f3f54ddde18c4a57853262a16546291c6c1afcf7..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansgetallactive/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansgetallactivetest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansgetallactivetest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 50933d90e341bfd1da4cb62c7db8e07b6de2a643..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - currentApp - - - ForGetAllActive - -
diff --git a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/test/List.test.js deleted file mode 100644 index 8566dc428e332d4d1535a048b5541ea71da2a799..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsGetAllActiveTestXts from './getAllActive.js' -export default function testsuite() { -ActsAnsGetAllActiveTestXts() -} diff --git a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/test/getAllActive.js b/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/test/getAllActive.js deleted file mode 100644 index d03ac954f313ea7a36e9bf9beb97ef204260c390..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansgetallactive/src/main/js/test/getAllActive.js +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -var time = 500 -export default function ActsAnsGetAllActiveTestXts() { -describe('ActsAnsGetAllActiveTestXts', function () { - console.info("===========ActsAnsGetAllActiveTest start====================>"); - function getAllCallback(err, data){ - console.log("Ans_GetAllActive_0100 getAllCallback ============>"); - var i; - console.log("Ans_GetAllActive_0100 getAllCallback data.length============>"+data.length); - expect(data.length).assertEqual(2); - console.log("Ans_GetAllActive_0100 getAllCallback data============>"+JSON.stringify(data)); - for (i = 0; i < data.length; i++) { - if (i == 0){ - expect(data[i].content.normal.title).assertEqual("test_title_otherApp"); - console.log("=======Ans_GetAllActive_0100 getCallback title=====>"+data[i].content.normal.title) - expect(data[i].content.normal.text).assertEqual("test_text_otherApp"); - console.log("=======Ans_GetAllActive_0100 getCallback text========>"+data[i].content.normal.text) - expect(data[i].content.normal.additionalText).assertEqual("test_additionalText_otherApp"); - console.log("===Ans_GetAllActive_0100 getCallback text====>"+data[i].content.normal.additionalText) - expect(data[i].id).assertEqual(2); - console.log("============Ans_GetAllActive_0100 getCallback id============>"+data[i].id) - expect(data[i].label).assertEqual("otherApp"); - console.log("============Ans_GetAllActive_0100 getCallback label=====>"+data[i].label) - }else if(i == 1){ - expect(data[i].content.normal.title).assertEqual("test_title_currentApp"); - console.log("======Ans_GetAllActive_0100 getCallback title=========>"+data[i].content.normal.title) - expect(data[i].content.normal.text).assertEqual("test_text_currentApp"); - console.log("==========Ans_GetAllActive_0100 getCallback text=======>"+data[i].content.normal.text) - expect(data[i].content.normal.additionalText).assertEqual("test_additionalText_currentApp"); - console.log("===Ans_GetAllActive_0100 getCallback text=====>"+data[i].content.normal.additionalText) - expect(data[i].id).assertEqual(1); - console.log("============Ans_GetAllActive_0100 getCallback id============>"+data[i].id) - expect(data[i].label).assertEqual("currentApp_0100"); - console.log("============Ans_GetAllActive_0100 getCallback label=====>"+data[i].label) - } - } - } - - /* - * @tc.number: Ans_GetAllActive_xts_0100 - * @tc.name: getAllActiveNotifications(callback: AsyncCallback>): void; - * @tc.desc: Verify: After the current app and other apps publish two notifications, - get all active notifications in the system(callback) - */ - it('Ans_GetAllActive_xts_0100', 0, async function (done) { - console.debug("===============Ans_GetAllActive_0100 start==================>"); - await notify.cancelAll(); - var notificationRequestOfOtherApp = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_otherApp", - text: "test_text_otherApp", - additionalText: "test_additionalText_otherApp" - }, - }, - id: 2, - label: "otherApp", - } - await notify.publish(notificationRequestOfOtherApp); - console.debug("===============Ans_GetAllActive_0100 publish OtherApp notify end==================>"); - var notificationRequestOfCurrentApp = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_currentApp", - text: "test_text_currentApp", - additionalText: "test_additionalText_currentApp" - }, - }, - id: 1, - label: "currentApp_0100", - } - await notify.publish(notificationRequestOfCurrentApp); - console.debug("===============Ans_GetAllActive_0100 publish CurrentApp notify end==================>"); - notify.getAllActiveNotifications(getAllCallback); - console.debug("===============Ans_GetAllActive_0100 getAllActiveNotifications end==================>"); - setTimeout(function(){ - console.debug("===============Ans_GetAllActive_0100 setTimeout==================>"); - done(); - }, time); - }) -}) - -} diff --git a/notification/ans_standard/publish_test/actsansgetallactive/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/actsansgetallactive/src/main/resources/base/element/string.json deleted file mode 100644 index 7f71c81573e31b291ddd76d3c37c7eba4a6da7dc..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsansgetallactive/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "getAllActive" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsansgetallactive/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/actsansgetallactive/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/actsansgetallactive/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/BUILD.gn b/notification/ans_standard/publish_test/actsanspublishcontroltest/BUILD.gn deleted file mode 100644 index 1251e230a6154c746b6a1f1c01b025a42f7a8906..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsPublishControlTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsPublishControlTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/Test.json b/notification/ans_standard/publish_test/actsanspublishcontroltest/Test.json deleted file mode 100644 index d81b03b75f91b9a4b78d536d3d930a820eb5e87b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "shell-timeout": "180000", - "bundle-name": "com.example.actsanspublishcontroltest", - "package-name": "com.example.actsanspublishcontroltest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsPublishControlTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/actsanspublishcontroltest/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/actsanspublishcontroltest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/config.json b/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/config.json deleted file mode 100644 index 387ab7474f3a539ba6bf2e13d78866f86d842910..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanspublishcontroltest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanspublishcontroltest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index cc183ba6f171c0a02e11f8a2eecdf4247d8c8bc2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - {{title}} - -
diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 0cdcd00e876ddacdc80de31771450fe24f2ad3b6..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "测试发布流控" - }, - onInit() { - this.title = "测试发布流控"; - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - }, -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/test/ExampleJsunit.test.js deleted file mode 100644 index 6a597ed39a579d2de7000ba9731eeb31a28018ce..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/test/ExampleJsunit.test.js +++ /dev/null @@ -1,452 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import notification from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' - -var notificationSubscriberInfo ={ - bundleNames: ["com.example.actsanspublishcontroltest"] -} - -var notificationSubscriber = { - onConsume: consumeCallback, - onConnect: subscribeOnCallback -} - -var idRecord = new Array(20).fill(0); -const publishFrequence = 10; -const TIMEOUT = 3000; - -function consumeCallback(data) { - console.debug("====>consumeCallback data: ====>" + JSON.stringify(data)); - console.debug("====>consumeCallback id: ====>" + data.request.id); - switch(data.request.id){ - case 1: - idRecord[0] = 1; - console.debug("====>id is recorded: " + data.request.id); - break; - case 2: - idRecord[1] = 1; - console.debug("====>id is recorded: " + data.request.id); - break; - case 3: - idRecord[2] = 1; - console.debug("====>id is recorded: " + data.request.id); - break; - case 4: - idRecord[3] = 1; - console.debug("====>id is recorded: " + data.request.id); - break; - case 5: - idRecord[4] = 1; - console.debug("====>id is recorded: " + data.request.id); - break; - case 6: - idRecord[5] = 1; - console.debug("====>id is recorded: " + data.request.id); - break; - case 7: - idRecord[6] = 1; - console.debug("====>id is recorded: " + data.request.id); - break; - case 8: - idRecord[7] = 1; - console.debug("====>id is recorded: " + data.request.id); - break; - case 9: - idRecord[8] = 1; - console.debug("====>id is recorded: " + data.request.id); - break; - case 10: - idRecord[9] = 1; - console.debug("====>id is recorded: " + data.request.id); - break; - case 11: - idRecord[10] = 1; - console.debug("====>id is recorded: " + data.request.id); - break; - case 12: - idRecord[11] = 1; - console.debug("====>id is recorded: " + data.request.id); - break; - case 13: - idRecord[12] = 1; - console.debug("====>id is recorded: " + data.request.id); - break; - case 14: - idRecord[13] = 1; - console.debug("====>id is recorded: " + data.request.id); - break; - case 15: - idRecord[14] = 1; - console.debug("====>id is recorded: " + data.request.id); - break; - case 16: - idRecord[15] = 1; - console.debug("====>id is recorded: " + data.request.id); - break; - case 17: - idRecord[16] = 1; - console.debug("====>id is recorded: " + data.request.id); - break; - case 18: - idRecord[17] = 1; - console.debug("====>id is recorded: " + data.request.id); - break; - case 19: - idRecord[18] = 1; - console.debug("====>id is recorded: " + data.request.id); - break; - case 20: - idRecord[19] = 1; - console.debug("====>id is recorded: " + data.request.id); - break; - - default: - console.debug("====>fail enter default====>"); - expect().assertFail(); - break; - } -} - -function subscribeOnCallback() { - console.debug("====>subscribeOnCallback enter====>"); -} - -function subscribeCallback(err) { - console.debug("====>subscribeCallback err: ====>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); -} - -function publish_the_first_notification(err){ - console.debug("====>publish the first notification 11111 err: ====>" + JSON.stringify(err)); -} -function publish_the_second_notification(err){ - console.debug("====>publish the second notification 22222 err: ====>" + JSON.stringify(err)); -} -function publish_the_third_notification(err){ - console.debug("====>publish the third notification 33333 err: ====>" + JSON.stringify(err)); -} -function publish_the_fourth_notification(err){ - console.debug("====>publish the fourth notification 44444 err: ====>" + JSON.stringify(err)); -} -function publish_the_fifth_notification(err){ - console.debug("====>publish the fifth notification 55555 err: ====>" + JSON.stringify(err)); -} -function publish_the_sixth_notification(err){ - console.debug("====>publish the sixth notification 66666 err: ====>" + JSON.stringify(err)); -} -function publish_the_seventh_notification(err){ - console.debug("====>publish the seventh notification 77777 err: ====>" + JSON.stringify(err)); -} -function publish_the_eighth_notification(err){ - console.debug("====>publish the eighth notification 88888 err: ====>" + JSON.stringify(err)); -} -function publish_the_ninth_notification(err){ - console.debug("====>publish the ninth notification 99999 err: ====>" + JSON.stringify(err)); -} -function publish_the_tenth_notification(err){ - console.debug("====>publish the tenth notification 10 10 err: ====>" + JSON.stringify(err)); -} -function publish_the_eleventh_notification(err){ - console.debug("====>publish the eleventh notification 11 11 err: ====>" + JSON.stringify(err)); -} -function publish_the_twelfth_notification(err){ - console.debug("====>publish the twelfth notification 12 12 err: ====>" + JSON.stringify(err)); -} -function publish_the_thirteenth_notification(err){ - console.debug("====>publish the thirteenth notification 13 13 err: ====>" + JSON.stringify(err)); -} -function publish_the_fourteenth_notification(err){ - console.debug("====>publish the fourteenth notification 14 14 err: ====>" + JSON.stringify(err)); -} -function publish_the_fifteenth_notification(err){ - console.debug("====>publish the fifteenth notification 15 15 err: ====>" + JSON.stringify(err)); -} -function publish_the_sixteenth_notification(err){ - console.debug("====>publish the sixteenth notification 16 16 err: ====>" + JSON.stringify(err)); -} -function publish_the_seventeenth_notification(err){ - console.debug("====>publish the seventeenth notification 17 17 err: ====>" + JSON.stringify(err)); -} -function publish_the_eighteenth_notification(err){ - console.debug("====>publish the eighteenth notification 18 18 err: ====>" + JSON.stringify(err)); -} -function publish_the_nineteenth_notification(err){ - console.debug("====>publish the nineteenth notification 19 19 err: ====>" + JSON.stringify(err)); -} - -export default function ActsAnsPublishControlTest() { -describe('ActsAnsPublishControlTest', function () { - - /* - * @tc.number : ActsAnsPublishControlTest_0100 - * @tc.name : Verify rejection of publishing notifications that exceed the threshold - * @tc.desc : Twenty notifications are published continuously within one second, and the first - * ten notifications can be received, the last ten notifications cannot be received - */ - it('ActsAnsPublishControlTest_0100', 0, async function (done) { - console.debug("====>ActsAnsPublishControlTest_0100 start====>"); - try{ - await notification.subscribe(notificationSubscriber, notificationSubscriberInfo, subscribeCallback); - }catch(err) { - console.error("====>ActsAnsPublishControlTest_0100 subscribe fail err:" + JSON.stringify(err)); - } - - function timeOut(){ - console.debug("====>time out enter====>"); - var sumOne = 0; - var sumTwo = 0; - for (let i = 0; i <= publishFrequence - 1; i++) { - sumOne += idRecord[i]; - } - for (let i = publishFrequence; i < 20; i++) { - sumTwo += idRecord[i]; - } - console.debug("====>sumOne====>" + sumOne); - console.debug("====>sumTwo====>" + sumTwo); - expect(sumOne).assertEqual(10); - expect(sumTwo).assertEqual(0); - console.debug("====>ActsAnsPublishControlTest_0100 end====>"); - done(); - } - - function publish_the_twentieth_notification(err){ - console.debug("====>publish the twentieth notification 20 20 err: ====>" + JSON.stringify(err)); - console.debug("====>time out start====>"); - setTimeout(timeOut, TIMEOUT); - } - - notification.publish({ - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test1_title", - text: "test1_text", - additionalText: "test1_additionalText" - }, - }, - id: 1 - }, publish_the_first_notification); - notification.publish({ - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test2_title", - text: "test2_text", - additionalText: "test2_additionalText" - }, - }, - id: 2 - }, publish_the_second_notification); - notification.publish({ - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test3_title", - text: "test3_text", - additionalText: "test3_additionalText" - }, - }, - id: 3 - }, publish_the_third_notification); - notification.publish({ - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test4_title", - text: "test4_text", - additionalText: "test4_additionalText" - }, - }, - id: 4 - }, publish_the_fourth_notification); - notification.publish({ - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test5_title", - text: "test5_text", - additionalText: "test5_additionalText" - }, - }, - id: 5 - }, publish_the_fifth_notification); - notification.publish({ - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test6_title", - text: "test6_text", - additionalText: "test6_additionalText" - }, - }, - id: 6 - }, publish_the_sixth_notification); - notification.publish({ - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test7_title", - text: "test7_text", - additionalText: "test7_additionalText" - }, - }, - id: 7 - }, publish_the_seventh_notification); - notification.publish({ - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test8_title", - text: "test8_text", - additionalText: "test8_additionalText" - }, - }, - id: 8 - }, publish_the_eighth_notification); - notification.publish({ - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test9_title", - text: "test9_text", - additionalText: "test9_additionalText" - }, - }, - id: 9 - }, publish_the_ninth_notification); - notification.publish({ - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test10_title", - text: "test10_text", - additionalText: "test10_additionalText" - }, - }, - id: 10 - }, publish_the_tenth_notification); - notification.publish({ - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test11_title", - text: "test11_text", - additionalText: "test11_additionalText" - }, - }, - id: 11 - }, publish_the_eleventh_notification); - notification.publish({ - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test12_title", - text: "test12_text", - additionalText: "test12_additionalText" - }, - }, - id: 12 - }, publish_the_twelfth_notification); - notification.publish({ - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test13_title", - text: "test13_text", - additionalText: "test13_additionalText" - }, - }, - id: 13 - }, publish_the_thirteenth_notification); - notification.publish({ - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test14_title", - text: "test14_text", - additionalText: "test14_additionalText" - }, - }, - id: 14 - }, publish_the_fourteenth_notification); - notification.publish({ - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test15_title", - text: "test15_text", - additionalText: "test15_additionalText" - }, - }, - id: 15 - }, publish_the_fifteenth_notification); - notification.publish({ - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test16_title", - text: "test16_text", - additionalText: "test11_additionalText" - }, - }, - id: 16 - }, publish_the_sixteenth_notification); - notification.publish({ - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test17_title", - text: "test17_text", - additionalText: "test17_additionalText" - }, - }, - id: 17 - }, publish_the_seventeenth_notification); - notification.publish({ - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test18_title", - text: "test18_text", - additionalText: "test18_additionalText" - }, - }, - id: 18 - }, publish_the_eighteenth_notification); - notification.publish({ - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test19_title", - text: "test19_text", - additionalText: "test19_additionalText" - }, - }, - id: 19 - }, publish_the_nineteenth_notification); - notification.publish({ - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test20_title", - text: "test20_text", - additionalText: "test20_additionalText" - }, - }, - id: 20 - }, publish_the_twentieth_notification); - }) -})} diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/test/List.test.js deleted file mode 100644 index afa53d7a7d184a93e05ca1ac54a20afc4be15cc8..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsPublishControlTest from './ExampleJsunit.test.js' -export default function testsuite() { -ActsAnsPublishControlTest() -} diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/resources/base/element/string.json deleted file mode 100644 index e1c6e8e9957436acd4c64e0d2429b2129d0593c9..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ActsAnsPublishControlTest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/actsanspublishcontroltest/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/BUILD.gn b/notification/ans_standard/publish_test/actsanspublishconversation/BUILD.gn deleted file mode 100644 index e2e6e55841f9d00bd11cf93344a4e70e277cd425..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishconversation/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsConversationTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsConversationTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/Test.json b/notification/ans_standard/publish_test/actsanspublishconversation/Test.json deleted file mode 100644 index f2c7c0cf967a2e0e7c20335467f435f54a4bc7f2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishconversation/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "shell-timeout": "180000", - "bundle-name": "com.example.actsansconversationtest", - "package-name": "com.example.actsansconversationtest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsConversationTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/actsanspublishconversation/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/actsanspublishconversation/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/config.json b/notification/ans_standard/publish_test/actsanspublishconversation/src/main/config.json deleted file mode 100644 index b22fb97a708eac406027c38661df0c0af74efaab..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/config.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansconversationtest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansconversationtest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER", - "reason": "install bundle", - "usedScene": { - "ability": [ - "KitFramework" - ], - "when": "always" - } - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/MainAbility/app.js deleted file mode 100644 index 4f1747a95c4acbb66db5351e826c31584356e11c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 9711158cbba71a8c9200a68e928535e4f5e6bda5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - publishConversation - -
diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index cedc552d2c6861b286c9c08bdaafb93be8964e16..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,31 +0,0 @@ - -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import file from '@system.file' -import app from '@system.app' -import device from '@system.device' -import router from '@system.router' - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - } -} diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/test/ActsAnsPublishConversation.js b/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/test/ActsAnsPublishConversation.js deleted file mode 100644 index c10ab0c71a3f5b30b9ffa93b939ec84017ccdad4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/test/ActsAnsPublishConversation.js +++ /dev/null @@ -1,140 +0,0 @@ -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import notify from '@ohos.notification'; -import image from '@ohos.multimedia.image' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -var timeout = 500; -export default function ActsAnsConversationTest() { -describe('ActsAnsConversationTest', function () { - console.info("===========ActsAnsConversationTest start====================>"); - - function onConsumeOne(data) { - console.info("=========Ans_Conversation_0100 onConsume start==============>"); - console.info("=========Ans_Conversation_0100 onConsume data:==============>" + JSON.stringify(data)); - - expect(data.request.content.contentType).assertEqual(notify.ContentType.NOTIFICATION_CONTENT_CONVERSATION); - expect(data.request.content.conversation.title).assertEqual("test_title"); - expect(data.request.content.conversation.text).assertEqual("test_text"); - expect(data.request.content.conversation.additionalText).assertEqual("test_additionalText"); - expect(data.request.content.conversation.conversationTitle).assertEqual("conversationTitle_0100"); - expect(data.request.content.conversation.conversationGroup).assertEqual(true); - - expect(data.request.content.conversation.messages[0].text).assertEqual("conversation_text_1"); - expect(data.request.content.conversation.messages[0].timestamp).assertEqual(1); - expect(data.request.content.conversation.messages[0].sender.name).assertEqual("sender_name_1"); - expect(data.request.content.conversation.messages[0].sender.key).assertEqual("sender_key_1"); - expect(data.request.content.conversation.messages[0].sender.uri).assertEqual("sender_uri_1"); - expect(data.request.content.conversation.messages[0].sender.isMachine).assertEqual(true); - expect(data.request.content.conversation.messages[0].sender.isUserImportant).assertEqual(true); - expect(data.request.content.conversation.messages[0].mimeType).assertEqual("conversation_mimeType_1"); - expect(data.request.content.conversation.messages[0].uri).assertEqual("conversation_uri_1"); - - expect(data.request.content.conversation.messages[1].text).assertEqual("conversation_text_2"); - expect(data.request.content.conversation.messages[1].timestamp).assertEqual(1); - expect(data.request.content.conversation.messages[1].sender.name).assertEqual("sender_name_2"); - expect(data.request.content.conversation.messages[1].sender.key).assertEqual("sender_key_2"); - expect(data.request.content.conversation.messages[1].sender.uri).assertEqual("sender_uri_2"); - expect(data.request.content.conversation.messages[1].sender.isMachine).assertEqual(true); - expect(data.request.content.conversation.messages[1].sender.isUserImportant).assertEqual(true); - expect(data.request.content.conversation.messages[1].mimeType).assertEqual("conversation_mimeType_2"); - expect(data.request.content.conversation.messages[1].uri).assertEqual("conversation_uri_2"); - - console.info("=========Ans_Conversation_0100 onConsume end================>"); - } - - /* - * @tc.number: Ans_Conversation_0100 - * @tc.name: publish(request: NotificationRequest): Promise; - * @tc.desc: Verify that the conversation information can be received in the received notification. - */ - it('Ans_Conversation_0100', 0, async function (done) { - console.info("==================Ans_Conversation_0100 start==================>"); - var bufferA = new ArrayBuffer(4*2*25); - var optionA = {alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: {height: 25, width: 2}} - var conversationIconA = await image.createPixelMap(bufferA, optionA); - console.info("===========Ans_Conversation_0100 createPixelMap A promise======>"); - var bufferB = new ArrayBuffer(4*2*24); - var optionB = {alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: {height: 24, width: 2}} - var conversationIconB = await image.createPixelMap(bufferB, optionB); - console.info("===========Ans_Conversation_0100 createPixelMap B promise======>"); - var bufferC = new ArrayBuffer(4*2*23); - var optionC = {alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: {height: 23, width: 2}} - var conversationIconC = await image.createPixelMap(bufferC, optionC); - console.info("===========Ans_Conversation_0100 createPixelMap C promise======>"); - var subscriber = { - onConsume:onConsumeOne, - } - await notify.subscribe(subscriber); - console.info("==================Ans_Conversation_0100 subscribe promise==================>"); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_CONVERSATION, - conversation: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - user:{ - name:"user_name", - key: "user_key", - uri: "user_uri", - isMachine:true, - isUserImportant:true, - icon:conversationIconA - }, - messages:[ - { - text:"conversation_text_1", - timestamp:1, - sender:{ - name:"sender_name_1", - key: "sender_key_1", - uri: "sender_uri_1", - isMachine:true, - isUserImportant:true, - icon:conversationIconB - }, - mimeType:"conversation_mimeType_1", - uri:"conversation_uri_1", - }, - { - text:"conversation_text_2", - timestamp:1, - sender:{ - name:"sender_name_2", - key: "sender_key_2", - uri: "sender_uri_2", - isMachine:true, - isUserImportant:true, - icon:conversationIconC - }, - mimeType:"conversation_mimeType_2", - uri:"conversation_uri_2", - },], - conversationGroup:true, - conversationTitle:"conversationTitle_0100", - }, - }, - } - await notify.publish(notificationRequest); - console.info("===========Ans_Conversation_0100 publish promise========>"); - setTimeout((async function(){ - console.info("======Ans_Conversation_0100 setTimeout==============>"); - notify.unsubscribe(subscriber); - console.info("======Ans_Conversation_0100 setTimeout unsubscribe==>"); - done(); - }),timeout); - }) -})} diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/test/List.test.js deleted file mode 100644 index c824b7c59e2f503f719bf035f8b06efa027359b0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import ActsAnsConversationTest from './ActsAnsPublishConversation.js' -export default function testsuite() { -ActsAnsConversationTest() -} diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/actsanspublishconversation/src/main/resources/base/element/string.json deleted file mode 100644 index f0d6fd0078e752a685ecb690e7e01cb805fdd329..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "conversation" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/actsanspublishconversation/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/actsanspublishconversation/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/BUILD.gn b/notification/ans_standard/publish_test/ansactscancelgroup/BUILD.gn deleted file mode 100644 index 30d8aaaa2d30d14f444b3102637adfe65cfe126c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactscancelgroup/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsCancelGroupTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsCancelGroupTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/Test.json b/notification/ans_standard/publish_test/ansactscancelgroup/Test.json deleted file mode 100644 index 5d799d0353e361a210f9d7f0c6b7f0ae40cec94b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactscancelgroup/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "60000", - "shell-timeout": "60000", - "bundle-name": "com.example.actsansrcancelgroup", - "package-name": "com.example.actsansrcancelgroup" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsCancelGroupTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/ansactscancelgroup/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/ansactscancelgroup/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/config.json b/notification/ans_standard/publish_test/ansactscancelgroup/src/main/config.json deleted file mode 100644 index 8af39c0bbcbfc349417d3144a84e236b57cc940d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/config.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansrcancelgroup", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansrcancelgroup", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER", - "reason": "install bundle", - "usedScene": { - "ability": [ - "KitFramework" - ], - "when": "always" - } - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/MainAbility/app.js deleted file mode 100644 index 4f1747a95c4acbb66db5351e826c31584356e11c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 09696c297ee9837d996bd113bf8d41b67f236f7b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - .container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 16b4255db8e27c65d400a19e183a3ff6a3bcb1b4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - ActsAnsNotificationCancel - -
diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index cedc552d2c6861b286c9c08bdaafb93be8964e16..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,31 +0,0 @@ - -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import file from '@system.file' -import app from '@system.app' -import device from '@system.device' -import router from '@system.router' - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - } -} diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/test/ActsAnsCancelGroup.js b/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/test/ActsAnsCancelGroup.js deleted file mode 100644 index 3523eb201e183401ec7d8766770fdc5cfc06b007..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/test/ActsAnsCancelGroup.js +++ /dev/null @@ -1,777 +0,0 @@ -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -var timeout = 500; -export default function ActsAnsCancelGroup() { -describe('ActsAnsCancelGroup', function () { - console.info("===========ActsAnsCancelGroup start====================>"); - - var bundleOption = { - bundle:"com.example.actsanscancelgroup", - }; - - function onConsumeCancelGroup(data) { - console.info("=========ANS_CancelGroup_0100 onConsume start==============>"); - console.info("=========ANS_CancelGroup_0100 onConsume data:==============>" + JSON.stringify(data)); - notify.cancelGroup("group_0100", CancelGroupCallbackOne); - console.info("=========ANS_CancelGroup_0100 onConsume cancelGroup======>"); - console.info("=========ANS_CancelGroup_0100 onConsume end================>"); - } - - function onCancelCancelGroup(data) { - console.info("========ANS_CancelGroup_0100 onCancel start===========>"); - console.info("========ANS_CancelGroup_0100 onCancel data:===========>" + JSON.stringify(data)); - expect(data.request.id).assertEqual(1); - console.info("========ANS_CancelGroup_0100 onCancel id:=============>" + data.request.id); - expect(data.request.label).assertEqual("0100"); - console.info("========ANS_CancelGroup_0100 onCancel label:==========>" + data.request.label); - expect(data.request.groupName).assertEqual("group_0100"); - console.info("========ANS_CancelGroup_0100 onCancel groupName:======>" + data.request.groupName); - console.info("========ANS_CancelGroup_0100 onCancel end=============>"); - } - - function CancelGroupCallbackOne(err){ - console.info("========ANS_CancelGroup_0100 CancelGroupCallbackOne start==>"); - console.info("========ANS_CancelGroup_0100 CancelGroupCallbackOne err====>"+JSON.stringify(err)); - console.info("========ANS_CancelGroup_0100 CancelGroupCallbackOne end====>"); - } - - /* - * @tc.number: ANS_CancelGroup_0100 - * @tc.name: cancelGroup(groupName: string, callback: AsyncCallback): void; - * @tc.desc: Verify : one notification of the specified group can be successfully canceled(callback) - */ - it('ANS_CancelGroup_0100', 0, async function (done) { - console.info("==================ANS_CancelGroup_0100 start==================>"); - var subscriber = { - onConsume:onConsumeCancelGroup, - onCancel:onCancelCancelGroup - } - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - groupName:"group_0100", - id: 1, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0100", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.subscribe(subscriber); - console.info("===========ANS_CancelGroup_0100 subscribe promise======>"); - notify.publish(notificationRequest); - console.info("===========ANS_CancelGroup_0100 publish promise========>"); - setTimeout((async function(){ - console.info("======ANS_CancelGroup_0100 setTimeout==============>"); - notify.unsubscribe(subscriber); - console.info("======ANS_CancelGroup_0100 setTimeout unsubscribe==>"); - done(); - }),timeout); - }) - - function onConsumeCancelGroupPromise(data) { - console.info("=========ANS_CancelGroup_0200 onConsume start==============>"); - console.info("=========ANS_CancelGroup_0200 onConsume data:==============>" + JSON.stringify(data)); - notify.cancelGroup("group_0200"); - console.info("=========ANS_CancelGroup_0200 onConsume cancelGroup======>"); - console.info("=========ANS_CancelGroup_0200 onConsume end================>"); - } - - function onCancelCancelGroupPromise(data) { - console.info("========ANS_CancelGroup_0200 onCancel start===========>"); - console.info("========ANS_CancelGroup_0200 onCancel data:===========>" + JSON.stringify(data)); - expect(data.request.id).assertEqual(2); - console.info("========ANS_CancelGroup_0200 onCancel id:=============>" + data.request.id); - expect(data.request.label).assertEqual("0200"); - console.info("========ANS_CancelGroup_0200 onCancel label:==========>" + data.request.label); - expect(data.request.groupName).assertEqual("group_0200"); - console.info("========ANS_CancelGroup_0200 onCancel groupName:======>" + data.request.groupName); - console.info("========ANS_CancelGroup_0200 onCancel end=============>"); - } - - /* - * @tc.number: ANS_CancelGroup_0200 - * @tc.name: cancelGroup(groupName: string): Promise; - * @tc.desc: Verify : one notification of the specified group can be successfully cancel(promise) - */ - it('ANS_CancelGroup_0200', 0, async function (done) { - console.info("==================ANS_CancelGroup_0200 start==================>"); - var subscriber ={ - onConsume:onConsumeCancelGroupPromise, - onCancel:onCancelCancelGroupPromise - } - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - groupName:"group_0200", - id: 2, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0200", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.subscribe(subscriber); - console.info("===========ANS_CancelGroup_0200 subscribe promise======>"); - notify.publish(notificationRequest); - console.info("===========ANS_CancelGroup_0200 publish promise========>"); - setTimeout((async function(){ - console.info("======ANS_CancelGroup_0200 setTimeout==============>"); - notify.unsubscribe(subscriber); - console.info("======ANS_CancelGroup_0200 setTimeout unsubscribe==>"); - done(); - }),timeout); - }) - - var timesOfOnConsume - - function onConsumeCancelGroupTwo(data) { - console.info("=========ANS_CancelGroup_0300 onConsume start==============>"); - console.info("=========ANS_CancelGroup_0300 onConsume data:==============>" + JSON.stringify(data)); - timesOfOnConsume = timesOfOnConsume + 1 - if (timesOfOnConsume == 2){ - notify.cancelGroup("group_0300", cancelGroupCallbackTwo); - console.info("=========ANS_CancelGroup_0300 onConsume cancelGroup======>"); - } - console.info("=========ANS_CancelGroup_0300 onConsume end================>"); - } - - var timesOfOnCancel - - function onCancelCancelGroupTwo(data) { - console.info("========ANS_CancelGroup_0300 onCancel start===========>"); - console.info("========ANS_CancelGroup_0300 onCancel data:===========>" + JSON.stringify(data)); - timesOfOnCancel = timesOfOnCancel + 1 - if (timesOfOnCancel == 1){ - expect(data.request.id).assertEqual(1); - } else if (timesOfOnCancel == 2){ - expect(data.request.id).assertEqual(2); - } - console.info("========ANS_CancelGroup_0300 onCancel end===========>"); - } - - function cancelGroupCallbackTwo(err){ - console.info("========ANS_CancelGroup_0300 cancelGroupCallbackTwo start====>"); - console.info("========ANS_CancelGroup_0300 cancelGroupCallbackTwo err======>" + JSON.stringify(err)); - console.info("========ANS_CancelGroup_0300 cancelGroupCallbackTwo end======>"); - } - - /* - * @tc.number: ANS_CancelGroup_0300 - * @tc.name: cancelGroup(groupName: string, callback: AsyncCallback): void; - * @tc.desc: Verify : 2 notifications of the specified group can be successfully canceled(callback) - */ - it('ANS_CancelGroup_0300', 0, async function (done) { - console.info("==================ANS_CancelGroup_0300 start==================>"); - timesOfOnConsume = 0 - timesOfOnCancel = 0 - var subscriber ={ - onConsume:onConsumeCancelGroupTwo, - onCancel:onCancelCancelGroupTwo, - } - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - groupName:"group_0300", - id: 1, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0300_1", - badgeIconStyle: 1, - showDeliveryTime: true, - } - var notificationRequest1 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - groupName:"group_0300", - id: 2, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0300_2", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.subscribe(subscriber); - console.info("===========ANS_CancelGroup_0300 subscribe promise======>"); - notify.publish(notificationRequest); - console.info("===========ANS_CancelGroup_0300 publish1 promise=======>"); - notify.publish(notificationRequest1); - console.info("===========ANS_CancelGroup_0300 publish2 promise=======>"); - setTimeout((async function(){ - console.info("======ANS_CancelGroup_0300 setTimeout==============>"); - notify.unsubscribe(subscriber); - console.info("======ANS_CancelGroup_0300 setTimeout unsubscribe==>"); - done(); - }),timeout); - }) - - function onConsumeCancelGroupPromiseTwo(data) { - console.info("=========ANS_CancelGroup_0400 onConsume start==============>"); - console.info("=========ANS_CancelGroup_0400 onConsume data:==============>" + JSON.stringify(data)); - timesOfOnConsume = timesOfOnConsume + 1 - if (timesOfOnConsume == 2){ - notify.cancelGroup("group_0400"); - console.info("=========ANS_CancelGroup_0400 onConsume cancelGroup Promise======>"); - } - console.info("=========ANS_CancelGroup_0400 onConsume end================>"); - } - - function onCancelCancelGroupPromiseTwo(data) { - console.info("========ANS_CancelGroup_0400 onCancel start===========>"); - console.info("========ANS_CancelGroup_0400 onCancel data:===========>" + JSON.stringify(data)); - timesOfOnCancel = timesOfOnCancel + 1 - if (timesOfOnCancel == 1){ - expect(data.request.id).assertEqual(1); - } else if (timesOfOnCancel == 2){ - expect(data.request.id).assertEqual(2); - } - console.info("========ANS_CancelGroup_0400 onCancel end===========>"); - } - - /* - * @tc.number: ANS_CancelGroup_0400 - * @tc.name: cancelGroup(groupName: string): Promise; - * @tc.desc: Verify : 2 notifications of the specified group can be successfully canceled(promise) - */ - it('ANS_CancelGroup_0400', 0, async function (done) { - console.info("===============ANS_CancelGroup_0400 start==================>"); - timesOfOnConsume = 0 - timesOfOnCancel = 0 - var subscriber ={ - onConsume:onConsumeCancelGroupPromiseTwo, - onCancel:onCancelCancelGroupPromiseTwo, - } - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - groupName:"group_0400", - id: 1, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0400_1", - badgeIconStyle: 1, - showDeliveryTime: true, - } - var notificationRequest1 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - groupName:"group_0400", - id: 2, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0400_2", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.subscribe(subscriber); - console.info("===========ANS_CancelGroup_0400 subscribe promise======>"); - notify.publish(notificationRequest); - console.info("===========ANS_CancelGroup_0400 publish1 promise=======>"); - notify.publish(notificationRequest1); - console.info("===========ANS_CancelGroup_0400 publish2 promise=======>"); - setTimeout((async function(){ - console.info("======ANS_CancelGroup_0400 setTimeout==============>"); - notify.unsubscribe(subscriber); - console.info("======ANS_CancelGroup_0400 setTimeout unsubscribe==>"); - done(); - }),timeout); - }); - - function onConsumeCancelGroupThree(data) { - console.info("=========ANS_CancelGroup_0500 onConsume start==============>"); - console.info("=========ANS_CancelGroup_0500 onConsume data:==============>" + JSON.stringify(data)); - notify.cancelGroup("group_0500", cancelGroupByBundleCallbackThree); - console.info("=========ANS_CancelGroup_0500 onConsume cancelGroup======>"); - console.info("=========ANS_CancelGroup_0500 onConsume end================>"); - } - - function onCancelCancelGroupThree(data) { - timesOfOnCancel = timesOfOnCancel + 1; - console.info("========ANS_CancelGroup_0500 onCancel start===========>"); - console.info("========ANS_CancelGroup_0500 onCancel data:===========>" + JSON.stringify(data)); - if (timesOfOnCancel == 1){ - expect(data.request.id).assertEqual(5); - console.info("========ANS_CancelGroup_0500 onCancel id:=============>" + data.request.id); - expect(data.request.label).assertEqual("0500"); - console.info("========ANS_CancelGroup_0500 onCancel label:==========>" + data.request.label); - expect(data.request.groupName).assertEqual("group_0500"); - console.info("========ANS_CancelGroup_0500 onCancel groupName:======>" + data.request.groupName); - notify.cancelGroup("group_0500", cancelGroupByBundleCallbackThree2); - console.info("========ANS_CancelGroup_0500 onCancel cancelGroup:======>"); - } else if (timesOfOnCancel == 2){ - expect.assertFail(); - } - console.info("========ANS_CancelGroup_0500 onCancel end=============>"); - } - - function cancelGroupByBundleCallbackThree(err){ - console.info("========ANS_CancelGroup_0500 cancelGroupByBundleCallbackThree start==>"); - console.info("========ANS_CancelGroup_0500 cancelGroupByBundleCallbackThree err====>"+JSON.stringify(err)); - console.info("========ANS_CancelGroup_0500 cancelGroupByBundleCallbackThree end====>"); - } - - function cancelGroupByBundleCallbackThree2(err){ - console.info("========ANS_CancelGroup_0500 cancelGroupByBundleCallbackThree2 start==>"); - console.info("========ANS_CancelGroup_0500 cancelGroupByBundleCallbackThree2 err====>"+JSON.stringify(err)); - console.info("========ANS_CancelGroup_0500 cancelGroupByBundleCallbackThree2 end====>"); - } - - /* - * @tc.number: ANS_CancelGroup_0500 - * @tc.name: cancelGroup(groupName: string, callback: AsyncCallback): void; - * @tc.desc: Verify : After the notification of a specific group is successfully canceled, - cancel the notification of this group again(callback) - */ - it('ANS_CancelGroup_0500', 0, async function (done) { - console.info("==================ANS_CancelGroup_0500 start==================>"); - timesOfOnCancel = 0; - var subscriber ={ - onConsume:onConsumeCancelGroupThree, - onCancel:onCancelCancelGroupThree - } - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - groupName:"group_0500", - id: 5, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0500", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.subscribe(subscriber); - console.info("===========ANS_CancelGroup_0500 subscribe promise======>"); - notify.publish(notificationRequest); - console.info("===========ANS_CancelGroup_0500 publish promise========>"); - setTimeout((async function(){ - console.info("======ANS_CancelGroup_0500 setTimeout==============>"); - notify.unsubscribe(subscriber); - console.info("======ANS_CancelGroup_0500 setTimeout unsubscribe==>"); - done(); - }),timeout); - }) - - function onConsumeCancelGroupPromiseThree(data) { - console.info("=========ANS_CancelGroup_0600 onConsume start==============>"); - console.info("=========ANS_CancelGroup_0600 onConsume data:==============>" + JSON.stringify(data)); - notify.cancelGroup("group_0600"); - console.info("=========ANS_CancelGroup_0600 onConsume cancelGroup======>"); - console.info("=========ANS_CancelGroup_0600 onConsume end================>"); - } - - function onCancelCancelGroupPromiseThree(data) { - timesOfOnCancel = timesOfOnCancel + 1; - console.info("========ANS_CancelGroup_0600 onCancel start===========>"); - console.info("========ANS_CancelGroup_0600 onCancel data:===========>" + JSON.stringify(data)); - if (timesOfOnCancel == 1) { - expect(data.request.id).assertEqual(6); - console.info("========ANS_CancelGroup_0600 onCancel id:=============>" + data.request.id); - expect(data.request.label).assertEqual("0600"); - console.info("========ANS_CancelGroup_0600 onCancel label:==========>" + data.request.label); - expect(data.request.groupName).assertEqual("group_0600"); - console.info("========ANS_CancelGroup_0600 onCancel groupName:======>" + data.request.groupName); - notify.cancelGroup("group_0600"); - console.info("========ANS_CancelGroup_0600 onCancel cancelGroup:==========>"); - }else if(timesOfOnCancel == 2){ - expect.assertFail(); - } - console.info("========ANS_CancelGroup_0600 onCancel end=============>"); - } - - /* - * @tc.number: ANS_CancelGroup_0600 - * @tc.name: cancelGroup(groupName: string, callback: AsyncCallback): void; - * @tc.desc: Verify : After the notification of a specific group is successfully canceled, - cancel the notification of this group again(promise) - */ - it('ANS_CancelGroup_0600', 0, async function (done) { - console.info("==================ANS_CancelGroup_0700 start==================>"); - timesOfOnCancel = 0; - var subscriber ={ - onConsume:onConsumeCancelGroupPromiseThree, - onCancel:onCancelCancelGroupPromiseThree - } - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - groupName:"group_0600", - id: 6, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0600", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.subscribe(subscriber); - console.info("===========ANS_CancelGroup_0600 subscribe promise======>"); - notify.publish(notificationRequest); - console.info("===========ANS_CancelGroup_0600 publish promise========>"); - setTimeout((async function(){ - console.info("======ANS_CancelGroup_0600 setTimeout==============>"); - notify.unsubscribe(subscriber); - console.info("======ANS_CancelGroup_0600 setTimeout unsubscribe==>"); - done(); - }),timeout); - }) - - function cancelGroupCallbackFour(err){ - console.info("========ANS_CancelGroup_0700 cancelGroupCallbackFour start==>"); - console.info("========ANS_CancelGroup_0700 cancelGroupCallbackFour err====>"+JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info("========ANS_CancelGroup_0700 cancelGroupCallbackFour end====>"); - } - - /* - * @tc.number: ANS_CancelGroup_0700 - * @tc.name: cancelGroup(groupName: string, callback: AsyncCallback): void; - * @tc.desc: Verify : Call the interface with an empty groupName parameter(callback) - */ - it('ANS_CancelGroup_0700', 0, async function (done) { - console.info("==================ANS_CancelGroup_0700 start==================>"); - notify.cancelGroup("", cancelGroupCallbackFour); - setTimeout((async function(){ - console.info("======ANS_CancelGroup_0700 setTimeout==============>"); - done(); - }),timeout); - }) - - /* - * @tc.number: ANS_CancelGroup_0800 - * @tc.name: cancelGroup(groupName: string): Promise; - * @tc.desc: Verify : Call the interface with an empty groupName parameter(promise) - */ - it('ANS_CancelGroup_0800', 0, async function (done) { - console.info("==================ANS_CancelGroup_0800 start==================>"); - notify.cancelGroup("").then(()=>{ - console.info("==================ANS_CancelGroup_0800 cancelGroup then==================>"); - }).catch((err)=>{ - console.info("==================ANS_CancelGroup_0800 cancelGroup catch==================>"); - console.info("==================ANS_CancelGroup_0800 cancelGroup err==================>"+err.code); - expect(err.code != 0).assertEqual(true); - }); - setTimeout((async function(){ - console.info("======ANS_CancelGroup_0800 setTimeout==============>"); - done(); - }),timeout); - }) - - function onConsumCancelGroupFour(data) { - console.info("=========ANS_CancelGroup_0900 onConsume start==============>"); - console.info("=========ANS_CancelGroup_0900 onConsume data:==============>" + JSON.stringify(data)); - notify.cancelGroup("group_wrong", cancelGroupCallbackFive); - console.info("=========ANS_CancelGroup_0900 onConsume cancelGroup======>"); - console.info("=========ANS_CancelGroup_0900 onConsume end================>"); - } - - function onCancelCancelGroupFour(data) { - expect().assertFail(); - console.info("========ANS_CancelGroup_0900 onCancel start===========>"); - console.info("========ANS_CancelGroup_0900 onCancel data:===========>" + JSON.stringify(data)); - console.info("========ANS_CancelGroup_0900 onCancel end=============>"); - } - - function cancelGroupCallbackFive(err){ - console.info("========ANS_CancelGroup_0900 cancelGroupCallbackFive start==>"); - console.info("========ANS_CancelGroup_0900 cancelGroupCallbackFive err====>"+JSON.stringify(err)); - console.info("========ANS_CancelGroup_0900 cancelGroupCallbackFive end====>"); - } - - /* - * @tc.number: ANS_CancelGroup_0900 - * @tc.name: cancelGroup(groupName: string, callback: AsyncCallback): void; - * @tc.desc: Verify : Call the interface with an wrong groupName parameter(callback) - */ - it('ANS_CancelGroup_0900', 0, async function (done) { - console.info("==================ANS_CancelGroup_0900 start==================>"); - var subscriber ={ - onConsume:onConsumCancelGroupFour, - onCancel:onCancelCancelGroupFour - } - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - groupName:"group_0900", - id: 9, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0900", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.subscribe(subscriber); - console.info("===========ANS_CancelGroup_0900 subscribe promise======>"); - notify.publish(notificationRequest); - console.info("===========ANS_CancelGroup_0900 publish promise========>"); - setTimeout((async function(){ - console.info("======ANS_CancelGroup_0900 setTimeout==============>"); - notify.unsubscribe(subscriber); - console.info("======ANS_CancelGroup_0900 setTimeout unsubscribe==>"); - done(); - }),timeout); - }) - - function onConsumeCancelGroupPromiseFour(data) { - console.info("=========ANS_CancelGroup_1000 onConsume start==============>"); - console.info("=========ANS_CancelGroup_1000 onConsume data:==============>" + JSON.stringify(data)); - notify.cancelGroup("group_wrong"); - console.info("=========ANS_CancelGroup_1000 onConsume cancelGroup======>"); - console.info("=========ANS_CancelGroup_1000 onConsume end================>"); - } - - function onCancelCancelGroupPromiseFour(data) { - expect().assertFail(); - console.info("========ANS_CancelGroup_1000 onCancel start===========>"); - console.info("========ANS_CancelGroup_1000 onCancel data:===========>" + JSON.stringify(data)); - console.info("========ANS_CancelGroup_1000 onCancel end=============>"); - } - - /* - * @tc.number: ANS_CancelGroup_1000 - * @tc.name: cancelGroup(groupName: string, callback: AsyncCallback): void; - * @tc.desc: Verify : Verify : Call the interface with an wrong groupName parameter(promise) - */ - it('ANS_CancelGroup_1000', 0, async function (done) { - console.info("==================ANS_CancelGroup_1000 start==================>"); - var subscriber ={ - onConsume:onConsumeCancelGroupPromiseFour, - onCancel:onCancelCancelGroupPromiseFour - } - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - groupName:"group_1000", - id: 10, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "1000", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.subscribe(subscriber); - console.info("===========ANS_CancelGroup_1000 subscribe promise======>"); - notify.publish(notificationRequest); - console.info("===========ANS_CancelGroup_1000 publish promise========>"); - setTimeout((async function(){ - console.info("======ANS_CancelGroup_1000 setTimeout==============>"); - notify.unsubscribe(subscriber); - console.info("======ANS_CancelGroup_1000 setTimeout unsubscribe==>"); - done(); - }),timeout); - }) -})} diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/test/List.test.js deleted file mode 100644 index bc14a1f940d402665df3cea98b6b70b25c96ab43..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import ActsAnsCancelGroup from './ActsAnsCancelGroup.js' -export default function testsuite() { -ActsAnsCancelGroup() -} diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/ansactscancelgroup/src/main/resources/base/element/string.json deleted file mode 100644 index d3627136a08eb2e660c8c2799a533aed2bda7684..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "actsansremovegroup" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/ansactscancelgroup/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/ansactscancelgroup/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/BUILD.gn b/notification/ans_standard/publish_test/ansactsremovegroup/BUILD.gn deleted file mode 100644 index e661a26c6f5bc8636e3a95bcf38bce8e26c9daf2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactsremovegroup/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsRemoveGroupTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsRemoveGroupTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/Test.json b/notification/ans_standard/publish_test/ansactsremovegroup/Test.json deleted file mode 100644 index a86a91f86f5abb773b14f22ae69c6fc9b10eda79..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactsremovegroup/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "60000", - "shell-timeout": "60000", - "bundle-name": "com.example.actsansremovegroup", - "package-name": "com.example.actsansremovegroup" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsRemoveGroupTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/ansactsremovegroup/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/ansactsremovegroup/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/config.json b/notification/ans_standard/publish_test/ansactsremovegroup/src/main/config.json deleted file mode 100644 index 1b1fed87778c837882f9dc4e6809c3fe5ad82467..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/config.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansremovegroup", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansremovegroup", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER", - "reason": "install bundle", - "usedScene": { - "ability": [ - "KitFramework" - ], - "when": "always" - } - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/MainAbility/app.js deleted file mode 100644 index 4f1747a95c4acbb66db5351e826c31584356e11c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 2fec145914fbd933f8b5c0278439a4855ec3083b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - AnsRemoveGroup - -
diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index ea04be4dfb189497d14d2e3cf69041742d6dee6e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,44 +0,0 @@ - -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import file from '@system.file' -import app from '@system.app' -import device from '@system.device' -import router from '@system.router' - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - const reportExtend = new ReportExtend(file) - core.addService('expect', expectExtend) - core.addService('report', reportExtend) - core.init() - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - } -} diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/test/ActsAnsRemoveGroup.js b/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/test/ActsAnsRemoveGroup.js deleted file mode 100644 index fe97064c2f880c056282d3b7ff3ec0415162ef7b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/test/ActsAnsRemoveGroup.js +++ /dev/null @@ -1,777 +0,0 @@ -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -var timeout = 500; -export default function ActsAnsRemoveGroup() { -describe('ActsAnsRemoveGroup', function () { - console.info("===========ActsAnsRemoveGroup start====================>"); - - var bundleOption = { - bundle:"com.example.actsansremovegroup", - }; - - function onConsumeRemoveGroup(data) { - console.info("=========ANS_RemoveGroup_0100 onConsume start==============>"); - console.info("=========ANS_RemoveGroup_0100 onConsume data:==============>" + JSON.stringify(data)); - notify.removeGroupByBundle(bundleOption, "group_0100", removeGroupByBundleCallbackOne); - console.info("=========ANS_RemoveGroup_0100 onConsume removeGroupByBundle======>"); - console.info("=========ANS_RemoveGroup_0100 onConsume end================>"); - } - - function onCancelRemoveGroup(data) { - console.info("========ANS_RemoveGroup_0100 onCancel start===========>"); - console.info("========ANS_RemoveGroup_0100 onCancel data:===========>" + JSON.stringify(data)); - expect(data.request.id).assertEqual(1); - console.info("========ANS_RemoveGroup_0100 onCancel id:=============>" + data.request.id); - expect(data.request.label).assertEqual("0100"); - console.info("========ANS_RemoveGroup_0100 onCancel label:==========>" + data.request.label); - expect(data.request.groupName).assertEqual("group_0100"); - console.info("========ANS_RemoveGroup_0100 onCancel groupName:======>" + data.request.groupName); - console.info("========ANS_RemoveGroup_0100 onCancel end=============>"); - } - - function removeGroupByBundleCallbackOne(err){ - console.info("========ANS_RemoveGroup_0100 removeGroupByBundleCallbackOne start==>"); - console.info("========ANS_RemoveGroup_0100 removeGroupByBundleCallbackOne err====>"+JSON.stringify(err)); - console.info("========ANS_RemoveGroup_0100 removeGroupByBundleCallbackOne end====>"); - } - - /* - * @tc.number: ANS_RemoveGroup_0100 - * @tc.name: removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback): void; - * @tc.desc: Verify : one notification of the specified group can be successfully removed(callback) - */ - it('ANS_RemoveGroup_0100', 0, async function (done) { - console.info("==================ANS_RemoveGroup_0100 start==================>"); - var subscriber ={ - onConsume:onConsumeRemoveGroup, - onCancel:onCancelRemoveGroup - } - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - groupName:"group_0100", - id: 1, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0100", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.subscribe(subscriber); - console.info("===========ANS_RemoveGroup_0100 subscribe promise======>"); - notify.publish(notificationRequest); - console.info("===========ANS_RemoveGroup_0100 publish promise========>"); - setTimeout((async function(){ - console.info("======ANS_RemoveGroup_0100 setTimeout==============>"); - notify.unsubscribe(subscriber); - console.info("======ANS_RemoveGroup_0100 setTimeout unsubscribe==>"); - done(); - }),timeout); - }) - - function onConsumeRemoveGroupPromise(data) { - console.info("=========ANS_RemoveGroup_0200 onConsume start==============>"); - console.info("=========ANS_RemoveGroup_0200 onConsume data:==============>" + JSON.stringify(data)); - notify.removeGroupByBundle(bundleOption, "group_0200"); - console.info("=========ANS_RemoveGroup_0200 onConsume removeGroupByBundle======>"); - console.info("=========ANS_RemoveGroup_0200 onConsume end================>"); - } - - function onCancelRemoveGroupPromise(data) { - console.info("========ANS_RemoveGroup_0200 onCancel start===========>"); - console.info("========ANS_RemoveGroup_0200 onCancel data:===========>" + JSON.stringify(data)); - expect(data.request.id).assertEqual(2); - console.info("========ANS_RemoveGroup_0200 onCancel id:=============>" + data.request.id); - expect(data.request.label).assertEqual("0200"); - console.info("========ANS_RemoveGroup_0200 onCancel label:==========>" + data.request.label); - expect(data.request.groupName).assertEqual("group_0200"); - console.info("========ANS_RemoveGroup_0200 onCancel groupName:======>" + data.request.groupName); - console.info("========ANS_RemoveGroup_0200 onCancel end=============>"); - } - - /* - * @tc.number: ANS_RemoveGroup_0200 - * @tc.name: removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback): void; - * @tc.desc: Verify : one notification of the specified group can be successfully removed(promise) - */ - it('ANS_RemoveGroup_0200', 0, async function (done) { - console.info("==================ANS_RemoveGroup_0200 start==================>"); - var subscriber ={ - onConsume:onConsumeRemoveGroupPromise, - onCancel:onCancelRemoveGroupPromise - } - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - groupName:"group_0200", - id: 2, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0200", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.subscribe(subscriber); - console.info("===========ANS_RemoveGroup_0200 subscribe promise======>"); - notify.publish(notificationRequest); - console.info("===========ANS_RemoveGroup_0200 publish promise========>"); - setTimeout((async function(){ - console.info("======ANS_RemoveGroup_0200 setTimeout==============>"); - notify.unsubscribe(subscriber); - console.info("======ANS_RemoveGroup_0200 setTimeout unsubscribe==>"); - done(); - }),timeout); - }) - - var timesOfOnConsume - - function onConsumeRemoveGroupTwo(data) { - console.info("=========ANS_RemoveGroup_0300 onConsume start==============>"); - console.info("=========ANS_RemoveGroup_0300 onConsume data:==============>" + JSON.stringify(data)); - timesOfOnConsume = timesOfOnConsume + 1 - if (timesOfOnConsume == 2){ - notify.removeGroupByBundle(bundleOption, "group_0300", removeGroupByBundleCallback); - console.info("=========ANS_RemoveGroup_0300 onConsume removeGroupByBundle======>"); - } - console.info("=========ANS_RemoveGroup_0300 onConsume end================>"); - } - - var timesOfOnCancel - - function onCancelRemoveGroupTwo(data) { - console.info("========ANS_RemoveGroup_0300 onCancel start===========>"); - console.info("========ANS_RemoveGroup_0300 onCancel data:===========>" + JSON.stringify(data)); - timesOfOnCancel = timesOfOnCancel + 1 - if (timesOfOnCancel == 1){ - expect(data.request.id).assertEqual(1); - } else if (timesOfOnCancel == 2){ - expect(data.request.id).assertEqual(2); - } - console.info("========ANS_RemoveGroup_0300 onCancel end===========>"); - } - - function removeGroupByBundleCallback(err){ - console.info("========ANS_RemoveGroup_0300 removeGroupByBundleCallback start====>"); - console.info("========ANS_RemoveGroup_0300 removeGroupByBundleCallback err======>" + JSON.stringify(err)); - console.info("========ANS_RemoveGroup_0300 removeGroupByBundleCallback end======>"); - } - - /* - * @tc.number: ANS_RemoveGroup_0300 - * @tc.name: removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback): void; - * @tc.desc: Verify : 2 notifications of the specified group can be successfully removed(callback) - */ - it('ANS_RemoveGroup_0300', 0, async function (done) { - console.info("==================ANS_RemoveGroup_0300 start==================>"); - timesOfOnConsume = 0 - timesOfOnCancel = 0 - var subscriber ={ - onConsume:onConsumeRemoveGroupTwo, - onCancel:onCancelRemoveGroupTwo, - } - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - groupName:"group_0300", - id: 1, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0300_1", - badgeIconStyle: 1, - showDeliveryTime: true, - } - var notificationRequest1 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - groupName:"group_0300", - id: 2, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0300_2", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.subscribe(subscriber); - console.info("===========ANS_RemoveGroup_0300 subscribe promise======>"); - notify.publish(notificationRequest); - console.info("===========ANS_RemoveGroup_0300 publish1 promise=======>"); - notify.publish(notificationRequest1); - console.info("===========ANS_RemoveGroup_0300 publish2 promise=======>"); - setTimeout((async function(){ - console.info("======ANS_RemoveGroup_0300 setTimeout==============>"); - notify.unsubscribe(subscriber); - console.info("======ANS_RemoveGroup_0300 setTimeout unsubscribe==>"); - done(); - }),timeout); - }) - - function onConsumeRemoveGroupPromiseTwo(data) { - console.info("=========ANS_RemoveGroup_0400 onConsume start==============>"); - console.info("=========ANS_RemoveGroup_0400 onConsume data:==============>" + JSON.stringify(data)); - timesOfOnConsume = timesOfOnConsume + 1 - if (timesOfOnConsume == 2){ - notify.removeGroupByBundle(bundleOption, "group_0400"); - console.info("=========ANS_RemoveGroup_0400 onConsume removeGroupByBundle Promise======>"); - } - console.info("=========ANS_RemoveGroup_0400 onConsume end================>"); - } - - function onCancelRemoveGroupPromiseTwo(data) { - console.info("========ANS_RemoveGroup_0400 onCancel start===========>"); - console.info("========ANS_RemoveGroup_0400 onCancel data:===========>" + JSON.stringify(data)); - timesOfOnCancel = timesOfOnCancel + 1 - if (timesOfOnCancel == 1){ - expect(data.request.id).assertEqual(1); - } else if (timesOfOnCancel == 2){ - expect(data.request.id).assertEqual(2); - } - console.info("========ANS_RemoveGroup_0400 onCancel end===========>"); - } - - /* - * @tc.number: ANS_RemoveGroup_0400 - * @tc.name: removeGroupByBundle(bundle: BundleOption, groupName: string): Promise; - * @tc.desc: Verify : 2 notifications of the specified group can be successfully removed(promise) - */ - it('ANS_RemoveGroup_0400', 0, async function (done) { - console.info("===============ANS_RemoveGroup_0400 start==================>"); - timesOfOnConsume = 0 - timesOfOnCancel = 0 - var subscriber ={ - onConsume:onConsumeRemoveGroupPromiseTwo, - onCancel:onCancelRemoveGroupPromiseTwo, - } - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - groupName:"group_0400", - id: 1, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0400_1", - badgeIconStyle: 1, - showDeliveryTime: true, - } - var notificationRequest1 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - groupName:"group_0400", - id: 2, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0400_2", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.subscribe(subscriber); - console.info("===========ANS_RemoveGroup_0400 subscribe promise======>"); - notify.publish(notificationRequest); - console.info("===========ANS_RemoveGroup_0400 publish1 promise=======>"); - notify.publish(notificationRequest1); - console.info("===========ANS_RemoveGroup_0400 publish2 promise=======>"); - setTimeout((async function(){ - console.info("======ANS_RemoveGroup_0400 setTimeout==============>"); - notify.unsubscribe(subscriber); - console.info("======ANS_RemoveGroup_0400 setTimeout unsubscribe==>"); - done(); - }),timeout); - }); - - function onConsumeRemoveGroupThree(data) { - console.info("=========ANS_RemoveGroup_0500 onConsume start==============>"); - console.info("=========ANS_RemoveGroup_0500 onConsume data:==============>" + JSON.stringify(data)); - notify.removeGroupByBundle(bundleOption, "group_0500", removeGroupByBundleCallbackThree); - console.info("=========ANS_RemoveGroup_0500 onConsume removeGroupByBundle======>"); - console.info("=========ANS_RemoveGroup_0500 onConsume end================>"); - } - - function onCancelRemoveGroupThree(data) { - timesOfOnCancel = timesOfOnCancel + 1; - console.info("========ANS_RemoveGroup_0500 onCancel start===========>"); - console.info("========ANS_RemoveGroup_0500 onCancel data:===========>" + JSON.stringify(data)); - if (timesOfOnCancel == 1){ - expect(data.request.id).assertEqual(5); - console.info("========ANS_RemoveGroup_0500 onCancel id:=============>" + data.request.id); - expect(data.request.label).assertEqual("0500"); - console.info("========ANS_RemoveGroup_0500 onCancel label:==========>" + data.request.label); - expect(data.request.groupName).assertEqual("group_0500"); - console.info("========ANS_RemoveGroup_0500 onCancel groupName:======>" + data.request.groupName); - notify.removeGroupByBundle(bundleOption, "group_0500", removeGroupByBundleCallbackThree2); - console.info("========ANS_RemoveGroup_0500 onCancel removeGroupByBundle:======>"); - } else if (timesOfOnCancel == 2){ - expect.assertFail(); - } - console.info("========ANS_RemoveGroup_0500 onCancel end=============>"); - } - - function removeGroupByBundleCallbackThree(err){ - console.info("========ANS_RemoveGroup_0500 removeGroupByBundleCallbackThree start==>"); - console.info("========ANS_RemoveGroup_0500 removeGroupByBundleCallbackThree err====>"+JSON.stringify(err)); - console.info("========ANS_RemoveGroup_0500 removeGroupByBundleCallbackThree end====>"); - } - - function removeGroupByBundleCallbackThree2(err){ - console.info("========ANS_RemoveGroup_0500 removeGroupByBundleCallbackThree2 start==>"); - console.info("========ANS_RemoveGroup_0500 removeGroupByBundleCallbackThree2 err====>"+JSON.stringify(err)); - console.info("========ANS_RemoveGroup_0500 removeGroupByBundleCallbackThree2 end====>"); - } - - /* - * @tc.number: ANS_RemoveGroup_0500 - * @tc.name: removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback): void; - * @tc.desc: Verify : After the notification of a specific group is successfully removed, - remove the notification of this group again(callback) - */ - it('ANS_RemoveGroup_0500', 0, async function (done) { - console.info("==================ANS_RemoveGroup_0500 start==================>"); - timesOfOnCancel = 0; - var subscriber ={ - onConsume:onConsumeRemoveGroupThree, - onCancel:onCancelRemoveGroupThree - } - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - groupName:"group_0500", - id: 5, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0500", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.subscribe(subscriber); - console.info("===========ANS_RemoveGroup_0500 subscribe promise======>"); - notify.publish(notificationRequest); - console.info("===========ANS_RemoveGroup_0500 publish promise========>"); - setTimeout((async function(){ - console.info("======ANS_RemoveGroup_0500 setTimeout==============>"); - notify.unsubscribe(subscriber); - console.info("======ANS_RemoveGroup_0500 setTimeout unsubscribe==>"); - done(); - }),timeout); - }) - - function onConsumeRemoveGroupPromiseThree(data) { - console.info("=========ANS_RemoveGroup_0600 onConsume start==============>"); - console.info("=========ANS_RemoveGroup_0600 onConsume data:==============>" + JSON.stringify(data)); - notify.removeGroupByBundle(bundleOption, "group_0600"); - console.info("=========ANS_RemoveGroup_0600 onConsume removeGroupByBundle======>"); - console.info("=========ANS_RemoveGroup_0600 onConsume end================>"); - } - - function onCancelRemoveGroupPromiseThree(data) { - timesOfOnCancel = timesOfOnCancel + 1; - console.info("========ANS_RemoveGroup_0600 onCancel start===========>"); - console.info("========ANS_RemoveGroup_0600 onCancel data:===========>" + JSON.stringify(data)); - if (timesOfOnCancel == 1) { - expect(data.request.id).assertEqual(6); - console.info("========ANS_RemoveGroup_0600 onCancel id:=============>" + data.request.id); - expect(data.request.label).assertEqual("0600"); - console.info("========ANS_RemoveGroup_0600 onCancel label:==========>" + data.request.label); - expect(data.request.groupName).assertEqual("group_0600"); - console.info("========ANS_RemoveGroup_0600 onCancel groupName:======>" + data.request.groupName); - notify.removeGroupByBundle(bundleOption, "group_0600"); - console.info("========ANS_RemoveGroup_0600 onCancel removeGroupByBundle:==========>"); - }else if(timesOfOnCancel == 2){ - expect.assertFail(); - } - console.info("========ANS_RemoveGroup_0600 onCancel end=============>"); - } - - /* - * @tc.number: ANS_RemoveGroup_0600 - * @tc.name: removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback): void; - * @tc.desc: Verify : After the notification of a specific group is successfully removed, - remove the notification of this group again(promise) - */ - it('ANS_RemoveGroup_0600', 0, async function (done) { - console.info("==================ANS_RemoveGroup_0600 start==================>"); - timesOfOnCancel = 0; - var subscriber ={ - onConsume:onConsumeRemoveGroupPromiseThree, - onCancel:onCancelRemoveGroupPromiseThree - } - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - groupName:"group_0600", - id: 6, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0600", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.subscribe(subscriber); - console.info("===========ANS_RemoveGroup_0600 subscribe promise======>"); - notify.publish(notificationRequest); - console.info("===========ANS_RemoveGroup_0600 publish promise========>"); - setTimeout((async function(){ - console.info("======ANS_RemoveGroup_0600 setTimeout==============>"); - notify.unsubscribe(subscriber); - console.info("======ANS_RemoveGroup_0600 setTimeout unsubscribe==>"); - done(); - }),timeout); - }) - - function removeGroupByBundleCallbackFour(err){ - console.info("========ANS_RemoveGroup_0700 removeGroupByBundleCallbackFour start==>"); - console.info("========ANS_RemoveGroup_0700 removeGroupByBundleCallbackFour err====>"+JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info("========ANS_RemoveGroup_0700 removeGroupByBundleCallbackFour end====>"); - } - - /* - * @tc.number: ANS_RemoveGroup_0700 - * @tc.name: removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback): void; - * @tc.desc: Verify : Call the interface with an empty groupName parameter(callback) - */ - it('ANS_RemoveGroup_0700', 0, async function (done) { - console.info("==================ANS_RemoveGroup_0700 start==================>"); - notify.removeGroupByBundle(bundleOption, "", removeGroupByBundleCallbackFour); - setTimeout((async function(){ - console.info("======ANS_RemoveGroup_0700 setTimeout==============>"); - done(); - }),timeout); - }) - - /* - * @tc.number: ANS_RemoveGroup_0800 - * @tc.name: removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback): void; - * @tc.desc: Verify : Call the interface with an empty groupName parameter(promise) - */ - it('ANS_RemoveGroup_0800', 0, async function (done) { - console.info("==================ANS_RemoveGroup_0800 start==================>"); - notify.removeGroupByBundle(bundleOption, "").then(()=>{ - console.info("==================ANS_RemoveGroup_0800 removeGroupByBundle then==================>"); - }).catch((err)=>{ - console.info("==================ANS_RemoveGroup_0800 removeGroupByBundle catch==================>"); - console.info("==================ANS_RemoveGroup_0800 removeGroupByBundle err==================>"+err.code); - expect(err.code != 0).assertEqual(true); - }); - setTimeout((async function(){ - console.info("======ANS_RemoveGroup_0800 setTimeout==============>"); - done(); - }),timeout); - }) - - function onConsumeRemoveGroupFour(data) { - console.info("=========ANS_RemoveGroup_0900 onConsume start==============>"); - console.info("=========ANS_RemoveGroup_0900 onConsume data:==============>" + JSON.stringify(data)); - notify.removeGroupByBundle(bundleOption, "group_wrong", removeGroupByBundleCallbackFive); - console.info("=========ANS_RemoveGroup_0900 onConsume removeGroupByBundle======>"); - console.info("=========ANS_RemoveGroup_0900 onConsume end================>"); - } - - function onCancelRemoveGroupFour(data) { - expect().assertFail(); - console.info("========ANS_RemoveGroup_0900 onCancel start===========>"); - console.info("========ANS_RemoveGroup_0900 onCancel data:===========>" + JSON.stringify(data)); - console.info("========ANS_RemoveGroup_0900 onCancel end=============>"); - } - - function removeGroupByBundleCallbackFive(err){ - console.info("========ANS_RemoveGroup_0900 removeGroupByBundleCallbackOne start==>"); - console.info("========ANS_RemoveGroup_0900 removeGroupByBundleCallbackOne err====>"+JSON.stringify(err)); - console.info("========ANS_RemoveGroup_0900 removeGroupByBundleCallbackOne end====>"); - } - - /* - * @tc.number: ANS_RemoveGroup_0900 - * @tc.name: removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback): void; - * @tc.desc: Verify : Verify : Call the interface with an wrong groupName parameter(callback) - */ - it('ANS_RemoveGroup_0900', 0, async function (done) { - console.info("==================ANS_RemoveGroup_0900 start==================>"); - var subscriber ={ - onConsume:onConsumeRemoveGroupFour, - onCancel:onCancelRemoveGroupFour - } - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - groupName:"group_0900", - id: 9, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0900", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.subscribe(subscriber); - console.info("===========ANS_RemoveGroup_0900 subscribe promise======>"); - notify.publish(notificationRequest); - console.info("===========ANS_RemoveGroup_0900 publish promise========>"); - setTimeout((async function(){ - console.info("======ANS_RemoveGroup_0900 setTimeout==============>"); - notify.unsubscribe(subscriber); - console.info("======ANS_RemoveGroup_0900 setTimeout unsubscribe==>"); - done(); - }),timeout); - }) - - function onConsumeRemoveGroupPromiseFour(data) { - console.info("=========ANS_RemoveGroup_1000 onConsume start==============>"); - console.info("=========ANS_RemoveGroup_1000 onConsume data:==============>" + JSON.stringify(data)); - notify.removeGroupByBundle(bundleOption, "group_wrong"); - console.info("=========ANS_RemoveGroup_1000 onConsume removeGroupByBundle======>"); - console.info("=========ANS_RemoveGroup_1000 onConsume end================>"); - } - - function onCancelRemoveGroupPromiseFour(data) { - expect().assertFail(); - console.info("========ANS_RemoveGroup_1000 onCancel start===========>"); - console.info("========ANS_RemoveGroup_1000 onCancel data:===========>" + JSON.stringify(data)); - console.info("========ANS_RemoveGroup_1000 onCancel end=============>"); - } - - /* - * @tc.number: ANS_RemoveGroup_1000 - * @tc.name: removeGroupByBundle(bundle: BundleOption, groupName: string, callback: AsyncCallback): void; - * @tc.desc: Verify : Verify : Call the interface with an wrong groupName parameter(promise) - */ - it('ANS_RemoveGroup_1000', 0, async function (done) { - console.info("==================ANS_RemoveGroup_1000 start==================>"); - var subscriber ={ - onConsume:onConsumeRemoveGroupPromiseFour, - onCancel:onCancelRemoveGroupPromiseFour - } - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - groupName:"group_1000", - id: 10, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "1000", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.subscribe(subscriber); - console.info("===========ANS_RemoveGroup_1000 subscribe promise======>"); - notify.publish(notificationRequest); - console.info("===========ANS_RemoveGroup_1000 publish promise========>"); - setTimeout((async function(){ - console.info("======ANS_RemoveGroup_1000 setTimeout==============>"); - notify.unsubscribe(subscriber); - console.info("======ANS_RemoveGroup_1000 setTimeout unsubscribe==>"); - done(); - }),timeout); - }) -})} diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/test/List.test.js deleted file mode 100644 index 5f130a08232899565f737c766d2b80193d69bff8..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import ActsAnsRemoveGroup from './ActsAnsRemoveGroup.js' -export default function testsuite() { -ActsAnsRemoveGroup() -} diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/ansactsremovegroup/src/main/resources/base/element/string.json deleted file mode 100644 index d3627136a08eb2e660c8c2799a533aed2bda7684..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "actsansremovegroup" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/ansactsremovegroup/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/ansactsremovegroup/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/anssecondarydirectory/AppScope/app.json b/notification/ans_standard/publish_test/anssecondarydirectory/AppScope/app.json deleted file mode 100644 index ef5c10cb264e5ac83f1717b3419b99fa60bd59cb..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/anssecondarydirectory/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.secondaryDirectory", - "vendor": "huawei", - "versionCode": 1000000, - "versionName": "1.0.0", - "debug": false, - "icon": "$media:icon", - "label": "$string:app_name", - "description": "$string:description_application", - "distributedNotificationEnabled": true, - "keepAlive": true, - "singleUser": true, - "minAPIVersion": 9, - "targetAPIVersion": 9, - "car": { - "apiCompatibleVersion": 9, - "singleUser": false - } - } -} diff --git a/notification/ans_standard/publish_test/anssecondarydirectory/AppScope/resources/base/element/string.json b/notification/ans_standard/publish_test/anssecondarydirectory/AppScope/resources/base/element/string.json deleted file mode 100644 index 0d1f12ea9692aa14d5e6e140d74baa9b04c25352..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/anssecondarydirectory/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string":[ - { - "name":"app_name", - "value":"LifecycleTest" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/anssecondarydirectory/AppScope/resources/base/media/app_icon.png b/notification/ans_standard/publish_test/anssecondarydirectory/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index 474a55588fd7216113dd42073aadf254d4dba023..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/anssecondarydirectory/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/anssecondarydirectory/BUILD.gn b/notification/ans_standard/publish_test/anssecondarydirectory/BUILD.gn deleted file mode 100644 index ac75fa4403a51a01d9521aa3f081b27285d3e422..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/anssecondarydirectory/BUILD.gn +++ /dev/null @@ -1,43 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsSecondaryDirectoryTest") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":secondarydirectorytest_js_assets", - ":secondarydirectorytest_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAnsSecondaryDirectoryTest" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("secondarydirectorytest_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("secondarydirectorytest_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("secondarydirectorytest_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":secondarydirectorytest_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/notification/ans_standard/publish_test/anssecondarydirectory/Test.json b/notification/ans_standard/publish_test/anssecondarydirectory/Test.json deleted file mode 100644 index bc3688d2fe3031e021a2588d05c00b949b235409..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/anssecondarydirectory/Test.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "bundle-name": "com.example.secondaryDirectory", - "module-name": "phone", - "shell-timeout": "600000", - "testcase-timeout": 70000 - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsSecondaryDirectoryTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} diff --git a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/Application/AbilityStage.ts b/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index a590b7d615d839ed6c67eced002d150020e300d5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/MainAbility/MainAbility.ts b/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 83be6c5a2a1cab94029e5a4ed20690d133a08f58..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - globalThis.applicationContext = this.context.getApplicationContext(); - } - - onDestroy() { - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context; - windowStage.setUIContent(this.context, "MainAbility/pages/MainAbility_pages", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; diff --git a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/MainAbility/pages/MainAbility_pages.ets b/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/MainAbility/pages/MainAbility_pages.ets deleted file mode 100644 index ecf02975d91908f8b1b59f3e668343e8419e23c7..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/MainAbility/pages/MainAbility_pages.ets +++ /dev/null @@ -1,47 +0,0 @@ -// @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 router from '@ohos.router'; -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../../test/List.test' - -@Entry -@Component -struct Index { - @State message: string = 'MainAbility' - - aboutToAppear() { - console.info("start run testcase!!!!") - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - } - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index ebb6de4af1541d455222b2452af8af77736ad2d5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import TestRunner from '@ohos.application.testRunner' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -var abilityDelegator = undefined -var abilityDelegatorArguments = undefined - -function translateParamsToString(parameters) { - const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s it', - '-s level', '-s testType', '-s size', '-s timeout', - '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` - } - } - return targetParams.trim() -} - -async function onAbilityCreateCallback() { - console.log("onAbilityCreateCallback"); -} - -async function addAbilityMonitorCallback(err: any) { - console.info("addAbilityMonitorCallback : " + JSON.stringify(err)) -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - console.info("OpenHarmonyTestRunner OnPrepare ") - } - - async onRun() { - console.log('OpenHarmonyTestRunner onRun run') - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility' - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a com.example.secondaryDirectory.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + d.stdResult); - console.info('executeShellCommand : data : ' + d.exitCode); - }) - console.info('OpenHarmonyTestRunner onRun end') - } -}; \ No newline at end of file diff --git a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/test/List.test.ets b/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 329392db5760962ac57a94aff6206a4d8b1805b0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import secondaryDirectory from './SecondaryDirectory.test' - -export default function List() { - secondaryDirectory() -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/test/SecondaryDirectory.test.ets b/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/test/SecondaryDirectory.test.ets deleted file mode 100644 index 9e787b00b00db1b588366338f49a807cc66f0653..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/ets/test/SecondaryDirectory.test.ets +++ /dev/null @@ -1,464 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' -import notify from '@ohos.notification' -import WantAgent from '@ohos.wantAgent' - -var timeout = 1000; - -export default function secondaryDirectoryTest() { -describe('secondaryDirectoryTest', function () { - console.info("===========secondaryDirectoryTest start====================>"); - - /* - * @tc.number: ACTS_SecondaryDirectory_xts_0000 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ACTS_SecondaryDirectory_xts_0000', 0, async function (done) { - console.info("===ACTS_SecondaryDirectory_xts_0000===begin===>"); - let promise = await notify.enableNotification({ - bundle:"com.example.secondaryDirectory" - },true) - console.info("===ACTS_SecondaryDirectory_xts_0000===end===>"); - done(); - }) - - /* - * @tc.number: ACTS_SecondaryDirectory_xts_0100 - * @tc.name: NotificationRequest、NotificationSubscriber、NotificationSubscribeInfo、SubscribeCallbackData、NotificationFlags - * @tc.desc: use NotificationRequest type - */ - function consumeCallback1(data) { - console.info("===>consumeCallback1 data : ===>" +JSON.stringify(data)); - let subscribeCallback: notify.SubscribeCallbackData; - subscribeCallback = data; - let contentType = subscribeCallback.request.content.contentType; - console.info("===>contentType: ===>" + contentType) - expect(contentType).assertEqual(notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT); - - let flags: notify.NotificationFlags = subscribeCallback.request.notificationFlags; - if (flags != undefined) - { - console.info("===>notificationFlags: ===>" + JSON.stringify(flags)); - let soundEnabled: notify.NotificationFlagStatus = flags.soundEnabled; - let vibrationEnabled: notify.NotificationFlagStatus = flags.vibrationEnabled - expect(soundEnabled).assertEqual(0); - expect(vibrationEnabled).assertEqual(0); - } - } - - it('ACTS_SecondaryDirectory_xts_0100', 0, async function (done) { - console.info("===ACTS_SecondaryDirectory_xts_0100===begin===>"); - let subscriber: notify.NotificationSubscriber = { - onConsume:consumeCallback1 - } - - let subscriberInfo: notify.NotificationSubscribeInfo = { - bundleNames: ["com.example.secondaryDirectory"] - } - - await notify.subscribe(subscriber, subscriberInfo); - - let basicContent: notify.NotificationBasicContent = { - title: "test_title", - text: "test_text", - additionalText: "test_Publish" - } - let notifyContent: notify.NotificationContent = { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: basicContent - } - - let notificationRequest : notify.NotificationRequest = { - content: notifyContent, - id: 1 - } - - console.info("===ACTS_SecondaryDirectory_xts_0100===publish===>"); - await notify.publish(notificationRequest, (err) => { - console.info("===>publish callback===>"+err.code); - expect(err.code).assertEqual(0) - }); - console.info("===ACTS_SecondaryDirectory_xts_0100===end===>"); - - setTimeout((async function(){ - notify.unsubscribe(subscriber); - console.info("======ACTS_SecondaryDirectory_xts_0100 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - /* - * @tc.number: ACTS_SecondaryDirectory_xts_0200 - * @tc.name: NotificationLongTextContent - * @tc.desc: use NotificationLongTextContent type - */ - function consumeCallback2(data) { - console.info("===>consumeCallback2 data : ===>" +JSON.stringify(data)); - let longContentText: notify.NotificationLongTextContent = data.request.content.longText; - console.info("===>longText: ===>" + JSON.stringify(longContentText)) - expect(longContentText.title).assertEqual("test_title"); - expect(longContentText.text).assertEqual("test_text"); - expect(longContentText.additionalText).assertEqual("test_Publish"); - expect(longContentText.longText).assertEqual("longText123456"); - expect(longContentText.briefText).assertEqual("briefText123456"); - expect(longContentText.expandedTitle).assertEqual("expandedTitle123456"); - } - - it('ACTS_SecondaryDirectory_xts_0200', 0, async function (done) { - console.info("===ACTS_SecondaryDirectory_xts_0200===begin===>"); - let subInfo: notify.NotificationSubscriber = { - onConsume:consumeCallback2 - } - await notify.subscribe(subInfo); - - let longContentText: notify.NotificationLongTextContent = { - title: "test_title", - text: "test_text", - additionalText: "test_Publish", - longText: "longText123456", - briefText: "briefText123456", - expandedTitle: "expandedTitle123456" - } - - let notifyContent: notify.NotificationContent = { - contentType: notify.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, - longText: longContentText - } - - let notificationRequest : notify.NotificationRequest = { - content: notifyContent, - id: 2, - slotType: notify.SlotType.SERVICE_INFORMATION, - } - - console.info("===ACTS_SecondaryDirectory_xts_0200===publish===>"); - await notify.publish(notificationRequest, (err) => { - console.info("===>publish callback===>"+err.code); - expect(err.code).assertEqual(0) - }); - console.info("===ACTS_SecondaryDirectory_xts_0200===end===>"); - - setTimeout((async function(){ - notify.unsubscribe(subInfo); - console.info("======ACTS_SecondaryDirectory_xts_0200 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - /* - * @tc.number: ACTS_SecondaryDirectory_xts_0300 - * @tc.name: NotificationBasicContent - * @tc.desc: use NotificationBasicContent type - */ - function consumeCallback3(data) { - console.info("===>consumeCallback3 data : ===>" +JSON.stringify(data)); - let basicContentText: notify.NotificationBasicContent = data.request.content.normal; - console.info("===>basicText: ===>" + JSON.stringify(basicContentText)) - expect(basicContentText.title).assertEqual("test_title"); - expect(basicContentText.text).assertEqual("test_text"); - expect(basicContentText.additionalText).assertEqual("test_Publish"); - } - - it('ACTS_SecondaryDirectory_xts_0300', 0, async function (done) { - console.info("===ACTS_SecondaryDirectory_xts_0300===begin===>"); - let subInfo: notify.NotificationSubscriber = { - onConsume:consumeCallback3 - } - await notify.subscribe(subInfo); - - let basicContent: notify.NotificationBasicContent = { - title: "test_title", - text: "test_text", - additionalText: "test_Publish" - } - - let notifyContent: notify.NotificationContent = { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: basicContent - } - - let notificationRequest : notify.NotificationRequest = { - content: notifyContent, - id: 3 - } - - console.info("===ACTS_SecondaryDirectory_xts_0300===publish===>"); - await notify.publish(notificationRequest, (err) => { - console.info("===>publish callback===>"+err.code); - expect(err.code).assertEqual(0) - }); - console.info("===ACTS_SecondaryDirectory_xts_0300===end===>"); - - setTimeout((async function(){ - notify.unsubscribe(subInfo); - console.info("======ACTS_SecondaryDirectory_xts_0300 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - /* - * @tc.number: ACTS_SecondaryDirectory_xts_0400 - * @tc.name: NotificationMultiLineContent - * @tc.desc: use NotificationMultiLineContent type - */ - function consumeCallback4(data) { - console.info("===>consumeCallback4 data : ===>" +JSON.stringify(data)); - let longContentText: notify.NotificationMultiLineContent = data.request.content.multiLine; - console.info("===>multiLineText: ===>" + JSON.stringify(longContentText)) - expect(longContentText.briefText).assertEqual("notificationMultiLineContent_title"); - expect(longContentText.longTitle).assertEqual("notificationMultiLineContent_title_12345678999999999"); - expect(longContentText.lines[0]).assertEqual("thrive"); - expect(longContentText.lines[1]).assertEqual("democracy"); - expect(longContentText.lines[2]).assertEqual("civilization"); - expect(longContentText.lines[3]).assertEqual("harmonious"); - } - - it('ACTS_SecondaryDirectory_xts_0400', 0, async function (done) { - console.info("===ACTS_SecondaryDirectory_xts_0400===begin===>"); - let subInfo: notify.NotificationSubscriber = { - onConsume:consumeCallback4 - } - await notify.subscribe(subInfo); - - let multiLineContent: notify.NotificationMultiLineContent = { - title: "test_title", - text: "test_text", - briefText: "notificationMultiLineContent_title", - longTitle: "notificationMultiLineContent_title_12345678999999999", - lines: ["thrive", "democracy", "civilization", "harmonious"] - } - - let notifyContent: notify.NotificationContent = { - contentType: notify.ContentType.NOTIFICATION_CONTENT_MULTILINE, - multiLine: multiLineContent - } - - let notificationRequest : notify.NotificationRequest = { - content: notifyContent, - id: 4 - } - - console.info("===ACTS_SecondaryDirectory_xts_0400===publish===>"); - await notify.publish(notificationRequest, (err) => { - console.info("===>publish callback===>"+err.code); - expect(err.code).assertEqual(0) - }); - console.info("===ACTS_SecondaryDirectory_xts_0400===end===>"); - - setTimeout((async function(){ - notify.unsubscribe(subInfo); - console.info("======ACTS_SecondaryDirectory_xts_0400 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - /* - * @tc.number: ACTS_SecondaryDirectory_xts_0500 - * @tc.name: NotificationActionButton、NotificationUserInput - * @tc.desc: use NotificationActionButton type - */ - function consumeCallback5(data) { - console.info("===>consumeCallback5 data : ===>" +JSON.stringify(data)); - let actionButtons: notify.NotificationActionButton = data.request.actionButtons[0] - console.info("===>actionButtons: ===>" + JSON.stringify(actionButtons)) - expect(actionButtons.title).assertEqual("buttonA"); - expect(actionButtons.userInput.inputKey).assertEqual("test_NotificationUserInput"); - WantAgent.getWant(actionButtons.wantAgent).then((data) => { - expect(data[0].action).assertEqual("usual.event.REMOVAL_WANTAGENT"); - }); - } - - it('ACTS_SecondaryDirectory_xts_0500', 0, async function (done) { - console.info("===ACTS_SecondaryDirectory_xts_0500===begin===>"); - let subInfo: notify.NotificationSubscriber = { - onConsume:consumeCallback5 - } - await notify.subscribe(subInfo); - - let agentInfo = { - wants: [ - { - bundleName: 'com.example.secondaryDirectory', - abilityName: 'com.example.secondaryDirectory.MainAbility', - action: "usual.event.REMOVAL_WANTAGENT" - } - ], - operationType: WantAgent.OperationType.SEND_COMMON_EVENT, - requestCode: 0, - wantAgentFlags:[WantAgent.WantAgentFlags.ONE_TIME_FLAG] - }; - - let wantAgentData = await WantAgent.getWantAgent(agentInfo); - - let basicContent: notify.NotificationBasicContent = { - title: "test_title", - text: "test_text", - additionalText: "test_Publish" - } - let notifyContent: notify.NotificationContent = { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: basicContent - } - - let userInputContent: notify.NotificationUserInput = { - inputKey: 'test_NotificationUserInput', - } - - let notificationRequest : notify.NotificationRequest = { - content: notifyContent, - actionButtons: [ - { - title:"buttonA", - wantAgent: wantAgentData, - userInput: userInputContent - } - ], - id: 5 - } - - console.info("===ACTS_SecondaryDirectory_xts_0500===publish===>"); - await notify.publish(notificationRequest, (err) => { - console.info("===>publish callback===>"+err.code); - expect(err.code).assertEqual(0) - }); - console.info("===ACTS_SecondaryDirectory_xts_0500===end===>"); - - setTimeout((async function(){ - notify.unsubscribe(subInfo); - console.info("======ACTS_SecondaryDirectory_xts_0500 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - /* - * @tc.number: ACTS_SecondaryDirectory_xts_0600 - * @tc.name: NotificationTemplate - * @tc.desc: use NotificationTemplate type - */ - function consumeCallback6(data) { - console.info("===>consumeCallback6 data : ===>" +JSON.stringify(data)); - let templateContent: notify.NotificationTemplate = data.request.template; - console.info("===>template: ===>" + JSON.stringify(templateContent)) - expect(templateContent.name).assertEqual("downloadTemplate"); - expect(templateContent.data.title).assertEqual("file"); - expect(templateContent.data.fileName).assertEqual("music.mp4"); - expect(templateContent.data.progressValue).assertEqual(45); - } - - it('ACTS_SecondaryDirectory_xts_0600', 0, async function (done) { - console.info("===ACTS_SecondaryDirectory_xts_0600===begin===>"); - let subInfo: notify.NotificationSubscriber = { - onConsume:consumeCallback6 - } - await notify.subscribe(subInfo); - - let basicContent: notify.NotificationBasicContent = { - title: "test_title", - text: "test_text", - additionalText: "test_Publish" - } - let notifyContent: notify.NotificationContent = { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: basicContent - } - - let notifyTemplate: notify.NotificationTemplate = { - name: 'downloadTemplate', - data: { - title: 'file', - fileName: 'music.mp4', - progressValue: 45 - } - } - - let notificationRequest : notify.NotificationRequest = { - content: notifyContent, - template: notifyTemplate, - id: 6 - } - - console.info("===ACTS_SecondaryDirectory_xts_0600===publish===>"); - await notify.publish(notificationRequest, (err) => { - console.info("===>publish callback===>"+err.code); - expect(err.code).assertEqual(0) - }); - console.info("===ACTS_SecondaryDirectory_xts_0600===end===>"); - - setTimeout((async function(){ - notify.unsubscribe(subInfo); - console.info("======ACTS_SecondaryDirectory_xts_0600 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - /* - * @tc.number: ACTS_SecondaryDirectory_xts_0700 - * @tc.name: DistributedOptions - * @tc.desc: use DistributedOptions type - */ - function consumeCallback7(data) { - console.info("===>consumeCallback7 data : ===>" +JSON.stringify(data)); - let options: notify.DistributedOptions = data.request.distributedOption; - console.info("===>longText: ===>" + JSON.stringify(options)) - expect(options.isDistributed).assertEqual(false); - expect(options.supportDisplayDevices[0]).assertEqual("0"); - expect(options.supportOperateDevices[0]).assertEqual("0"); - } - - it('ACTS_SecondaryDirectory_xts_0700', 0, async function (done) { - console.info("===ACTS_SecondaryDirectory_xts_0700===begin===>"); - let subInfo: notify.NotificationSubscriber = { - onConsume:consumeCallback7 - } - await notify.subscribe(subInfo); - - let options: notify.DistributedOptions = { - isDistributed: false, - supportDisplayDevices: ["0"], - supportOperateDevices: ["0"] - } - - let basicContent: notify.NotificationBasicContent = { - title: "test_title", - text: "test_text", - additionalText: "test_Publish" - } - let notifyContent: notify.NotificationContent = { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: basicContent - } - - let notificationRequest : notify.NotificationRequest = { - content: notifyContent, - distributedOption: options, - id: 7 - } - - console.info("===ACTS_SecondaryDirectory_xts_0700===publish===>"); - await notify.publish(notificationRequest, (err) => { - console.info("===>publish callback===>"+err.code); - expect(err.code).assertEqual(0) - }); - console.info("===ACTS_SecondaryDirectory_xts_0700===end===>"); - - setTimeout((async function(){ - notify.unsubscribe(subInfo); - console.info("======ACTS_SecondaryDirectory_xts_0700 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); -}) } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/module.json b/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/module.json deleted file mode 100644 index aa56bb41e26482c1822b1e2e1282bf217182f3e2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/module.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "pages": "$profile:main_pages", - "uiSyntax": "ets", - "abilities": [ - { - "name": "com.example.secondaryDirectory.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:white", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ] - } - } \ No newline at end of file diff --git a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/element/color.json b/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/element/color.json deleted file mode 100644 index 1bbc9aa9617e97c45440e1d3d66afc1154837012..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/element/color.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "color": [ - { - "name": "white", - "value": "#FFFFFF" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 4af975ee904d5089633c604a63f3f9bcc3885a3f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "string": [ - { - "name": "phone_entry_dsc", - "value": "i am an entry for phone" - }, - { - "name": "phone_entry_main", - "value": "the phone entry ability" - }, - { - "name": "entry_label", - "value": "ActsLifecycleMultihapTest" - }, - { - "name": "form_description", - "value": "my form" - }, - { - "name": "description_application", - "value": "demo for test" - }, - { - "name": "entry_desc", - "value": "description" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - } - ] -} diff --git a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index 474a55588fd7216113dd42073aadf254d4dba023..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/profile/form_config.json b/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/profile/form_config.json deleted file mode 100644 index 146fbe1c6da88e46886838ba746afb29e69cc190..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/profile/form_config.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "forms": [ - { - "isDefault": true, - "src": "./js/widget/pages/index/index", - "scheduledUpdateTime": "10:30", - "defaultDimension": "2*2", - "name": "widget", - "description": "This is a service widget.", - "colorMode": "auto", - "window": { - "designWidth": 720, - "autoDesignWidth": true - }, - "formConfigAbility": "ability://xxxxx", - "supportDimensions": [ - "2*2" - ], - "updateEnabled": true, - "updateDuration": 1 - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/profile/main_pages.json b/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 81691245bb98976d7d8966dd406a9abd5140ef39..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/anssecondarydirectory/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "src": [ - "MainAbility/pages/MainAbility_pages" - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/anssecondarydirectory/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/anssecondarydirectory/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/anssecondarydirectory/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/badgedisplayed/BUILD.gn b/notification/ans_standard/publish_test/badgedisplayed/BUILD.gn deleted file mode 100644 index 1d35dab11a531dc8c5c02a6304c09d68cbc6f195..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/BUILD.gn +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -group("badgedisplayed") { - testonly = true - if (is_standard_system) { - deps = [ - #"badgedisplay:ActsAnsBadgeDisplayTest", - "localcandisplay:localcandisplay", - ] - } -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/BUILD.gn b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/BUILD.gn deleted file mode 100644 index eb0e2e6e80d7fba6e8bd3fb2c9275bfe1bc36151..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsBadgeDisplayTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsBadgeDisplayTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/Test.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/Test.json deleted file mode 100644 index cdb79c958db01c4ce0da3330ab757d374bc2b1db..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/Test.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "shell-timeout": "60000", - "bundle-name": "com.example.actsansbadgedisplaytest", - "package-name": "com.example.actsansbadgedisplaytest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsBadgeDisplayTest.hap", - "localcandisplay.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/signature/openharmony_sx.p7b deleted file mode 100644 index 9cc5575a271908c8f1c59091cd694d93012866da..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/config.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/config.json deleted file mode 100644 index ffa9d606db3c98b3c54f2024223af64dc962fd71..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/config.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansbadgedisplaytest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansbadgedisplaytest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO", - "reason": "need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER", - "reason": "need use ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index c2fb3e020fdd1ea6cbee7583c300833ba0936ae2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - Test hiding of badge - -
diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/test/BadgeDisplay.js deleted file mode 100644 index c8835589dbdcc82761e4a683b6e204f63b3a039c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/test/BadgeDisplay.js +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -var time = 1000 -export default function ActsAnsBadgeDisplayTest() { -describe('ActsAnsBadgeDisplayTest', function () { - console.info("===ActsAnsBadgeDisplayTest start===>"); - /* - * @tc.number: ActsGetDisplay_test_0100 - * @tc.name: isBadgeDisplayed() - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsGetDisplay_test_0100', 0, async function (done) { - await notify.isBadgeDisplayed({ - bundle:"com.example.actsanslocalcandisplaytest", - },(err,data) => { - console.log("===>ActsGetDisplay_test_0100 success===>"+JSON.stringify(err)+data) - expect(typeof(data)).assertEqual('boolean') - done(); - }) - }) - - /* - * @tc.number: ActsGetDisplay_test_0300 - * @tc.name: isBadgeDisplayed() - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsGetDisplay_test_0300', 0, async function (done) { - await notify.isBadgeDisplayed({ - bundle:"wrong BundleName", - },(err,data) => { - console.log("===>ActsGetDisplay_test_0300 success===>"+err+data) - expect(typeof(data)).assertEqual('boolean') - expect(data).assertEqual(false) - done(); - }) - }) - /* - * @tc.number: ActsGetDisplay_test_0400 - * @tc.name: isBadgeDisplayed() - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsGetDisplay_test_0400', 0, async function (done) { - notify.isBadgeDisplayed({ - bundle:"wrong BundleName", - }).then().catch((err)=>{ - console.log("===>ActsGetDisplay_test_0400 success===>"+err.code) - expect(err.code != 0).assertEqual(true); - done(); - }) - - }) - /* - * @tc.number: ActsGetDisplay_test_0500 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsGetDisplay_test_0500', 0, async function (done) { - await notify.isBadgeDisplayed("#$#$%$%^",(err,data) => { - console.log("===>ActsGetDisplay_test_0500 success===>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - }) - /* - * @tc.number: ActsGetDisplay_test_0600 - * @tc.name: isBadgeDisplayed() - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsGetDisplay_test_0600', 0, async function (done) { - var promise = await notify.isBadgeDisplayed("#$#$%$%^") - expect(promise).assertEqual(undefined) - done(); - }) - /* - * @tc.number: ActsGetDisplay_test_0700 - * @tc.name: isBadgeDisplayed() - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsGetDisplay_test_0700', 0, async function (done) { - await notify.isBadgeDisplayed({},(err,data) => { - console.log("===>ActsGetDisplay_test_0700 success===>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - }) - /* - * @tc.number: ActsGetDisplay_test_0800 - * @tc.name: isBadgeDisplayed() - * @tc.desc: verify the function of isBadgeDisplayed - */ - it('ActsGetDisplay_test_0800', 0, async function (done) { - var promise = await notify.isBadgeDisplayed({}) - expect(promise).assertEqual(undefined) - done(); - }) - - /* - * @tc.number: ActsSetDisplay_test_0100 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsSetDisplay_test_0100', 0, async function (done) { - await notify.displayBadge({ - bundle:"com.example.actsanslocalcandisplaytest" - },100,(err) => { - console.log("===>ActsSetDisplay_test_0100 success===>"+err) - }) - done(); - }) - /* - * @tc.number: ActsSetDisplay_test_0200 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsSetDisplay_test_0200', 0, async function (done) { - var promise = await notify.displayBadge({ - bundle:"com.example.actsanslocalcandisplaytest" - },100) - expect(promise).assertEqual(undefined) - done(); - }) - /* - * @tc.number: ActsSetDisplay_test_0300 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsSetDisplay_test_0300', 0, async function (done) { - await notify.displayBadge({ - bundle:"Wrong BundleName" - },true,(err) => { - console.log("===>ActsSetDisplay_test_0300 success===>"+err.code) - expect(err.code).assertEqual(ERR_ANS_INVALID_BUNDLE) - }) - done(); - }) - /* - * @tc.number: ActsSetDisplay_test_0400 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsSetDisplay_test_0400', 0, async function (done) { - notify.displayBadge({ - bundle:"Wrong BundleName" - },true).then().catch((err)=>{ - console.log("===>ActsSetDisplay_test_0400 err===>"+err.code) - expect(err.code != 0).assertEqual(true); - done(); - }) - }) - - /* - * @tc.number: ActsSetDisplay_test_0700 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsSetDisplay_test_0700', 0, async function (done) { - await notify.displayBadge({ - bundle:"com.example.actsanslocalcandisplaytest" - },false,async(err) => { - await notify.isBadgeDisplayed({ - bundle:"com.example.actsanslocalcandisplaytest", - },(err,data) => { - console.log("===>ActsSetDisplay_test_0700 success===>"+err+data) - expect(typeof(data)).assertEqual('boolean') - expect(data).assertEqual(false) - done(); - }) - }) - }) -}) - - -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/test/List.test.js deleted file mode 100644 index 7441e7f27f71cc7fc3707d602c23605dc5060511..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsBadgeDisplayTest from './BadgeDisplay.js' -export default function testsuite() { -ActsAnsBadgeDisplayTest() -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/resources/base/element/string.json deleted file mode 100644 index ee22c2daff2ea7528f6db8867da3a723dd314caf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Badge" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/badgedisplayed/badgedisplay/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/BUILD.gn b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/BUILD.gn deleted file mode 100644 index 4112820811c5619f08a75f1be1050b19fb7b539f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("localcandisplay") { - hap_profile = "./entry/src/main/config.json" - hap_name = "localcandisplay" - subsystem_name = "notification" - part_name = "distributed_notification_service" - testonly = true - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/config.json b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/config.json deleted file mode 100644 index 2579047fb45aea283d3c497a548eb0039e55de6e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/config.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanslocalcandisplaytest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanslocalcandisplaytest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsanslocalcandisplaytest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 57949f4fab858ee082bd93b0c29b45af60c56054..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - Badge display setting-Dependency - -
diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index 6e1cc7770a86a2b0add36fa1bdeaa1e0673ef31e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 6ea0fda516299f695326dd17795c04b3e779b040..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "BadgeTest" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/donotdisturbmode/BUILD.gn b/notification/ans_standard/publish_test/donotdisturbmode/BUILD.gn deleted file mode 100644 index b2bb747b6537d7fb176ecf7b0c094692f94892f1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/donotdisturbmode/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsDoNotDisturbTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsDoNotDisturbTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/donotdisturbmode/Test.json b/notification/ans_standard/publish_test/donotdisturbmode/Test.json deleted file mode 100644 index 37d9ecb73c4792e81fb58018f2b7f15bc9db9c02..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/donotdisturbmode/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "shell-timeout": "180000", - "bundle-name": "com.example.actsansdonotdisturbtest", - "package-name": "com.example.actsansdonotdisturbtest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsDoNotDisturbTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/donotdisturbmode/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/donotdisturbmode/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/donotdisturbmode/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/donotdisturbmode/src/main/config.json b/notification/ans_standard/publish_test/donotdisturbmode/src/main/config.json deleted file mode 100644 index 96d0627932959f8df9e7f1cd2630ab1860255a22..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/donotdisturbmode/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansdonotdisturbtest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansdonotdisturbtest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 850cce43f9e1a838c52c541213689b0679d713e1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - Do Not Disturb - -
diff --git a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/test/List.test.js deleted file mode 100644 index 063d950aa5ba33612666a7a9b3a7365d9ff9d1de..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsDoNotDisturbTest from './doNotDisturbTest.js' -export default function testsuite() { -ActsAnsDoNotDisturbTest() -} diff --git a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/test/doNotDisturbTest.js b/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/test/doNotDisturbTest.js deleted file mode 100644 index db68c83f5b14a554891ea6b9a16a3e5ad2bad282..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/donotdisturbmode/src/main/js/test/doNotDisturbTest.js +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -var ERR_ANS_INVALID_PARAM = 67108867 -export default function ActsAnsDoNotDisturbTest() { -describe('ActsAnsDoNotDisturbTest', function () { - console.info("===ActsAnsDoNotDisturbTest start===>"); - function connectCallbacka() { - console.debug("==>connectCallbacka code==>"); - } - function subscribeCallbacka(err) { - console.debug("==>subscribeCallbacka code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbacka(err){ - console.debug("==>unSubscribeCallbacka code==>" +err.code); - expect(err.code).assertEqual(0); - } - function connectCallbackb() { - console.debug("==>connectCallbackb code==>"); - } - function subscribeCallbackb(err) { - console.debug("==>subscribeCallbackb code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbackb(err){ - console.debug("==>unSubscribeCallbackb code==>" +err.code); - expect(err.code).assertEqual(0); - } - - /* - * @tc.number: ActsSetDoNotDisturbTest_test_1900 - * @tc.name: setDoNotDisturbDate() - * @tc.desc: verify the function of setDoNotDisturbDate - */ - it('ActsSetDoNotDisturbTest_test_1900', 0, async function (done) { - await notify.setDoNotDisturbDate({ - type:notify.DoNotDisturbType.TYPE_CLEARLY, - begin:100, - end:100 - },async(err) => { - console.log("===>test_1900 success===>"+err.code); - await notify.getDoNotDisturbDate((err,data)=>{ - console.log("===>test_1900 getDoNotDisturbDate success===>"+err.code+JSON.stringify(data)); - }) - }) - done(); - }) - - /* - * @tc.number: ActsSetDoNotDisturbTest_test_2000 - * @tc.name: displayBadge() - * @tc.desc: verify the function of displayBadge - */ - it('ActsSetDoNotDisturbTest_test_2000', 0, async function (done) { - var promise = notify.setDoNotDisturbDate({ - type:notify.DoNotDisturbType.TYPE_CLEARLY, - begin:100, - end:100 - }) - console.log("===>ActsSetDoNotDisturbTest_test_2000 promise===>"+promise); - expect(promise).assertEqual(undefined); - done(); - }) -}) - - -} diff --git a/notification/ans_standard/publish_test/donotdisturbmode/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/donotdisturbmode/src/main/resources/base/element/string.json deleted file mode 100644 index bf89efd1bde4349a63c1390da6d92b76d855336f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/donotdisturbmode/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "DoNot" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/donotdisturbmode/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/donotdisturbmode/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/donotdisturbmode/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotification/BUILD.gn b/notification/ans_standard/publish_test/enablenotification/BUILD.gn deleted file mode 100644 index 640f83ecaa8679e6ac8fef398106baf9a9cd6286..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/BUILD.gn +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -group("enablenotification") { - testonly = true - if (is_standard_system) { - deps = [ - #"enablenotification:ActsAnsEnableNotificationTest", - "localnotificationenable:ActsAnsLocalNotificationTest", - ] - } -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/BUILD.gn b/notification/ans_standard/publish_test/enablenotification/enablenotification/BUILD.gn deleted file mode 100644 index ee7bec12c81026c0852df67672365b19044da76f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotification/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsEnableNotificationTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsEnableNotificationTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/Test.json b/notification/ans_standard/publish_test/enablenotification/enablenotification/Test.json deleted file mode 100644 index 147f09c51c6eaf67870c890186830f410ea881ca..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotification/Test.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "shell-timeout": "180000", - "bundle-name": "com.example.actsansenablenotificationtest", - "package-name": "com.example.actsansenablenotificationtest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsEnableNotificationTest.hap", - "ActsAnsLocalNotificationTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/enablenotification/enablenotification/signature/openharmony_sx.p7b deleted file mode 100644 index 9cc5575a271908c8f1c59091cd694d93012866da..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotification/enablenotification/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/config.json b/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/config.json deleted file mode 100644 index a82a568e805065f1d6a2e502014d4f9297f15889..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/config.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansenablenotificationtest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansenablenotificationtest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO", - "reason": "need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER", - "reason": "need use ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 9eb8c44b381f93e9585573ef15292da395d24ca0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - Test Enabling of Notification - -
diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/test/EnableNotification.js b/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/test/EnableNotification.js deleted file mode 100644 index 860da1f0a6f68ac631af2183f7a7ff0611316593..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/test/EnableNotification.js +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -var time = 1000 -export default function ActsAnsEnableNotificationTest() { -describe('ActsAnsEnableNotificationTest', function () { - console.info("===========ActsAnsEnableNotificationTest start====================>"); - - /* - * @tc.number: ActsGetEnable_test_0300 - * @tc.name: isNotificationEnabled() - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsGetEnable_test_0300', 0, async function (done) { - await notify.isNotificationEnabled({ - bundle:"wrong BundleName", - },(err,data) => { - console.log("===>ActsGetEnable_test_0300 success===>"+err+data) - expect(typeof(data)).assertEqual('boolean') - expect(data).assertEqual(false) - done(); - }) - setTimeout(function(){ - console.debug("====>time out ActsGetEnable_test_0300====>"); - }, time); - }) - /* - * @tc.number: ActsGetEnable_test_0400 - * @tc.name: isNotificationEnabled() - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsGetEnable_test_0400', 0, async function (done) { - notify.isNotificationEnabled({ - bundle:"wrong BundleName", - }).then().catch((err)=>{ - console.debug("====>ActsGetEnable_test_0400 promsie====>"+err.code); - expect(err.code != 0).assertEqual(true); - done(); - }) - }) - /* - * @tc.number: ActsGetEnable_test_0500 - * @tc.name: isNotificationEnabled() - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsGetEnable_test_0500', 0, async function (done) { - await notify.isNotificationEnabled("#$#$%$%^",(err,data) => { - console.log("===>ActsGetEnable_test_0500 success===>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - }) - /* - * @tc.number: ActsGetEnable_test_0600 - * @tc.name: isNotificationEnabled() - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsGetEnable_test_0600', 0, async function (done) { - var promise = await notify.isNotificationEnabled("#$#$%$%^") - expect(promise).assertEqual(undefined) - done(); - }) - /* - * @tc.number: ActsGetDisplay_test_0700 - * @tc.name: isNotificationEnabled() - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsGetEnable_test_0700', 0, async function (done) { - await notify.isNotificationEnabled({},(err,data) => { - console.log("===>ActsGetEnable_test_0700 success===>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - }) - /* - * @tc.number: ActsGetEnable_test_0800 - * @tc.name: isNotificationEnabled() - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsGetEnable_test_0800', 0, async function (done) { - var promise = await notify.isNotificationEnabled({}) - expect(promise).assertEqual(undefined) - done(); - }) - - /* - * @tc.number: ActsGetEnable_test_1100 - * @tc.name: isNotificationEnabled() - * @tc.desc: verify the function of isNotificationEnabled - */ - it('ActsGetEnable_test_1100', 0, async function (done) { - await notify.isNotificationEnabled((err,data) => { - console.log("==========================>ActsGetEnable_test_1100 success=======================>"+err+data) - expect(typeof(data)).assertEqual('boolean') - }) - done(); - }) - - /* - * @tc.number: ActsSetEnable_test_0100 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsSetEnable_test_0100', 0, async function (done) { - await notify.enableNotification({ - bundle:"com.example.actsanslocalnotificationtest" - },100,(err) => { - console.log("===>ActsSetEnable_test_0100 success===>"+err) - }) - done(); - }) - /* - * @tc.number: ActsSetEnable_test_0200 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsSetEnable_test_0200', 0, async function (done) { - var promise = await notify.enableNotification({ - bundle:"com.example.actsanslocalnotificationtest" - },100) - expect(promise).assertEqual(undefined) - done(); - }) - /* - * @tc.number: ActsSetEnable_test_0300 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsSetEnable_test_0300', 0, async function (done) { - await notify.enableNotification({ - bundle:"Wrong BundleName" - },true,(err) => { - console.log("===>ActsSetEnable_test_0300 success===>"+err.code) - expect(err.code).assertEqual(ERR_ANS_INVALID_BUNDLE) - }) - done(); - }) - /* - * @tc.number: ActsSetEnable_test_0400 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsSetEnable_test_0400', 0, async function (done) { - notify.enableNotification({ - bundle:"Wrong BundleName" - },true).then().catch((err)=>{ - console.log("===>ActsSetEnable_test_0400 err===>"+err.code) - expect(err.code != 0).assertEqual(true); - done(); - }) - }) - - /* - * @tc.number: ActsSetEnable_test_0700 - * @tc.name: enableNotification() - * @tc.desc: verify the function of enableNotification - */ - it('ActsSetEnable_test_0700', 0, async function (done) { - await notify.enableNotification({ - bundle:"com.example.actsanslocalnotificationtest" - },false,async(err) => { - await notify.isNotificationEnabled({ - bundle:"com.example.actsanslocalnotificationtest", - },(err,data) => { - console.log("===>ActsSetEnable_test_0700 success===>"+err+data) - expect(typeof(data)).assertEqual('boolean') - expect(data).assertEqual(false) - done(); - }) - }) - setTimeout(function(){ - console.debug("====>time out ActsSetEnable_test_0700====>"); - }, time); - }) -}) - -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/test/List.test.js deleted file mode 100644 index af9b34a25bc8a7d7b4c20b91edd14823d2df7948..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsEnableNotificationTest from './EnableNotification.js' -export default function testsuite() { -ActsAnsEnableNotificationTest() -} diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/resources/base/element/string.json deleted file mode 100644 index 8731524ba446c908d20b89f621f92e0cccfd4422..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "EnNoti" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotification/enablenotification/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/BUILD.gn b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/BUILD.gn deleted file mode 100644 index 0f7a8752336fb155503df26364ab1511ce33f0d3..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("ActsAnsLocalNotificationTest") { - hap_profile = "./entry/src/main/config.json" - hap_name = "ActsAnsLocalNotificationTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" - testonly = true - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/config.json b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/config.json deleted file mode 100644 index c755e60e839bbc614402d9f4c698210bfe3ea657..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/config.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanslocalnotificationtest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanslocalnotificationtest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsanslocalnotificationtest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index ebe2633f2d5b202e78ea431d3464b6323cbb43df..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - Test Enabling of Local Notification - -
diff --git a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index 6e1cc7770a86a2b0add36fa1bdeaa1e0673ef31e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 2a3c6ad694f9de382ca3663a50c4caccdfafa42a..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "LocNotiEn" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/enablenotification/localnotificationenable/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/enablenotification/localnotificationenable/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/getactive/BUILD.gn b/notification/ans_standard/publish_test/getactive/BUILD.gn deleted file mode 100644 index 720bd35c5c1f2c6bfacec0211a42ad9cc6ea6b78..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/BUILD.gn +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -group("getactive") { - testonly = true - if (is_standard_system) { - deps = [ - "actsansgetactive:ActsAnsActiveTest", - #"actsansgetallactive:ActsAnsAllActiveTestOne", - #"getactiveotherapp:ActsAnsGetActiveOtherApp" - ] - } -} diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/BUILD.gn b/notification/ans_standard/publish_test/getactive/actsansgetactive/BUILD.gn deleted file mode 100644 index 35a3b2d7d6b68d8a9004ce2323eef0f72e979290..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetactive/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsActiveTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsActiveTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/Test.json b/notification/ans_standard/publish_test/getactive/actsansgetactive/Test.json deleted file mode 100644 index bbaa35d5da3f1df4d3324508ee605d08b15491f9..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetactive/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "shell-timeout": "180000", - "bundle-name": "com.example.actsansgetactivetest", - "package-name": "com.example.actsansgetactivetest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsActiveTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/getactive/actsansgetactive/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getactive/actsansgetactive/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/config.json b/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/config.json deleted file mode 100644 index f0251327ed960ef20e6efd3e96fdd4a0daeba812..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansgetactivetest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansgetactivetest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 89445cdd2b10712aa18502331d603a48d938f012..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - active - -
diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/test/List.test.js deleted file mode 100644 index bc49a557754e3b61201e34636c8eb0d95e6767b6..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsActiveTest from './getActive.js' -export default function testsuite() { -ActsAnsActiveTest() -} diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/test/getActive.js b/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/test/getActive.js deleted file mode 100644 index d2a1fb5bcab23230006294ea9e27c99eea99149e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/js/test/getActive.js +++ /dev/null @@ -1,1087 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -var time = 300 -var ERR_ANS_NON_SYSTEM_APP = 67108877 -var cancalAllFlag = false -export default function ActsAnsActiveTest() { -describe('ActsAnsActiveTest', function () { - console.info("===========ActsAnsActiveTest start====================>"); - function getCallback(err, data){ - console.log("Ans_GetActive_0100 getCallback ============>"); - var i; - console.log("Ans_GetActive_0100 getCallback data.length============>"+data.length); - console.log("Ans_GetActive_0100 getCallback data============>"+JSON.stringify(data)); - for (i = 0; i < data.length; i++) { - expect(data[i].content.contentType).assertEqual(notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT); - console.log("Ans_GetActive_0100 getCallback contentType============>"+data[i].content.contentType) - expect(data[i].content.normal.title).assertEqual("test_title"); - console.log("=========Ans_GetActive_0100 getCallback title============>"+data[i].content.normal.title) - expect(data[i].content.normal.text).assertEqual("test_text"); - console.log("==========Ans_GetActive_0100 getCallback text============>"+data[i].content.normal.text) - expect(data[i].content.normal.additionalText).assertEqual("test_additionalText"); - console.log("========Ans_GetActive_0100 getCallback text========>"+data[i].content.normal.additionalText) - expect(data[i].id).assertEqual(1); - console.log("============Ans_GetActive_0100 getCallback id============>"+data[i].id) - expect(data[i].slotType).assertEqual(notify.SlotType.OTHER_TYPES); - console.log("============Ans_GetActive_0100 getCallback slotType============>"+data[i].slotType) - expect(data[i].deliveryTime).assertEqual(1624950453); - console.log("============Ans_GetActive_0100 getCallback deliveryTime========>"+data[i].deliveryTime) - expect(data[i].autoDeletedTime).assertEqual(1625036817); - console.log("===========Ans_GetActive_0100 getCallback autoDeletedTime=====>"+data[i].autoDeletedTime) - expect(data[i].statusBarText).assertEqual("statusBarText"); - console.log("============Ans_GetActive_0100 getCallback statusBarText=====>"+data[i].statusBarText) - expect(data[i].label).assertEqual("0100"); - console.log("============Ans_GetActive_0100 getCallback label=====>"+data[i].label) - expect(data[i].badgeIconStyle).assertEqual(1); - console.log("============Ans_GetActive_0100 getCallback badgeIconStyle=====>"+data[i].badgeIconStyle) - } - } - - function cancelAllCallback(err) { - cancalAllFlag = true - console.info("===>cancelAllCallback===>"); - } - - /* - * @tc.number: Ans_GetActive_0100 - * @tc.name: getActiveNotifications(callback: AsyncCallback>): void; - * @tc.desc: Verify: after publishing a notification, get all active notification info(callback) - */ - it('Ans_GetActive_0100', 0, async function (done) { - console.debug("===============Ans_GetActive_0100 start==================>"); - await notify.cancelAll(); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 1, - slotType : notify.SlotType.OTHER_TYPES, - deliveryTime : 1624950453, - autoDeletedTime: 1625036817, - statusBarText: "statusBarText", - label: "0100", - badgeIconStyle: 1, - } - await notify.publish(notificationRequest); - console.debug("===============Ans_GetActive_0100 publish end==================>"); - notify.getActiveNotifications(getCallback); - console.debug("===============Ans_GetActive_0100 getActiveNotifications end==================>"); - setTimeout(async function(){ - console.debug("===============Ans_GetActive_0100 done==================>"); - done(); - }, time); - }) - - /* - * @tc.number: Ans_GetActive_0200 - * @tc.name: getActiveNotifications(): Promise>; - * @tc.desc: Verify: after publishing a notification, get all active notification info(promise) - */ - it('Ans_GetActive_0200', 0, async function (done) { - console.debug("===============Ans_GetActive_0200 start==================>"); - await notify.cancelAll(); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 2, - slotType : notify.SlotType.OTHER_TYPES, - deliveryTime : 1624950453, - autoDeletedTime: 1625036817, - color: 2, - statusBarText: "statusBarText", - label: "0200", - badgeIconStyle: 1, - } - await notify.publish(notificationRequest); - console.debug("===============Ans_GetActive_0200 publish end==================>"); - var promiseData = await notify.getActiveNotifications(); - var i; - for (i = 0; i < promiseData.length; i++) { - expect(promiseData[i].content.contentType).assertEqual(notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT); - console.log("Ans_GetActive_0200 getCallback contentType============>"+promiseData[i].content.contentType) - expect(promiseData[i].content.normal.title).assertEqual("test_title"); - console.log("====Ans_GetActive_0200 getCallback title============>"+promiseData[i].content.normal.title) - expect(promiseData[i].content.normal.text).assertEqual("test_text"); - console.log("=====Ans_GetActive_0200 getCallback text============>"+promiseData[i].content.normal.text) - expect(promiseData[i].content.normal.additionalText).assertEqual("test_additionalText"); - console.log("==Ans_GetActive_0200 getCallback text========>"+promiseData[i].content.normal.additionalText) - expect(promiseData[i].id).assertEqual(2); - console.log("============Ans_GetActive_0200 getCallback id============>"+promiseData[i].id) - expect(promiseData[i].slotType).assertEqual(notify.SlotType.OTHER_TYPES); - console.log("============Ans_GetActive_0200 getCallback slotType============>"+promiseData[i].slotType) - expect(promiseData[i].deliveryTime).assertEqual(1624950453); - console.log("=======Ans_GetActive_0200 getCallback deliveryTime========>"+promiseData[i].deliveryTime) - expect(promiseData[i].autoDeletedTime).assertEqual(1625036817); - console.log("=======Ans_GetActive_0200 getCallback autoDeletedTime=====>"+promiseData[i].autoDeletedTime) - // expect(data[i].color).assertEqual(2); - console.log("============Ans_GetActive_0200 getCallback color=====>"+promiseData[i].color) - expect(promiseData[i].statusBarText).assertEqual("statusBarText"); - console.log("=======Ans_GetActive_0200 getCallback statusBarText=====>"+promiseData[i].statusBarText) - expect(promiseData[i].label).assertEqual("0200"); - console.log("============Ans_GetActive_0200 getCallback label=====>"+promiseData[i].label) - expect(promiseData[i].badgeIconStyle).assertEqual(1); - console.log("=======Ans_GetActive_0200 getCallback badgeIconStyle=====>"+promiseData[i].badgeIconStyle) - } - console.debug("===============Ans_GetActive_0200 getActiveNotifications end==================>"); - setTimeout(async function(){ - console.debug("===============Ans_GetActive_0200 done==================>"); - done(); - }, time); - }) - - function getCallbackTwo(err, data){ - console.log("Ans_GetActive_0300 getCallback data.length============>"+data.length); - expect(data.length).assertEqual(2); - console.log("Ans_GetActive_0300 getCallback data============>"+JSON.stringify(data)); - var i; - for (i = 0; i < data.length; i++) { - if (i == 0){ - expect(data[i].content.normal.title).assertEqual("test_title_1"); - console.log("==========Ans_GetActive_0300 getCallback title=========>"+data[i].content.normal.title) - expect(data[i].content.normal.text).assertEqual("test_text_1"); - console.log("==========Ans_GetActive_0300 getCallback text============>"+data[i].content.normal.text) - expect(data[i].content.normal.additionalText).assertEqual("test_additionalText_1"); - console.log("======Ans_GetActive_0300 getCallback text=======>"+data[i].content.normal.additionalText) - expect(data[i].id).assertEqual(1); - console.log("============Ans_GetActive_0300 getCallback id============>"+data[i].id) - expect(data[i].label).assertEqual("0300_1"); - console.log("============Ans_GetActive_0300 getCallback label=====>"+data[i].label) - }else if(i == 1){ - expect(data[i].content.normal.title).assertEqual("test_title_2"); - console.log("==========Ans_GetActive_0300 getCallback title=========>"+data[i].content.normal.title) - expect(data[i].content.normal.text).assertEqual("test_text_2"); - console.log("==========Ans_GetActive_0300 getCallback text============>"+data[i].content.normal.text) - expect(data[i].content.normal.additionalText).assertEqual("test_additionalText_2"); - console.log("======Ans_GetActive_0300 getCallback text=======>"+data[i].content.normal.additionalText) - expect(data[i].id).assertEqual(2); - console.log("============Ans_GetActive_0300 getCallback id============>"+data[i].id) - expect(data[i].label).assertEqual("0300_2"); - console.log("============Ans_GetActive_0300 getCallback label=====>"+data[i].label) - } - } - } - - /* - * @tc.number: Ans_GetActive_0300 - * @tc.name: getActiveNotifications(callback: AsyncCallback>): void; - * @tc.desc: Verify: after publishing two notifications, get all active notifications info(callback) - */ - it('Ans_GetActive_0300', 0, async function (done) { - console.debug("===============Ans_GetActive_0300 start==================>"); - await notify.cancelAll(); - var notificationRequest1 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_1", - text: "test_text_1", - additionalText: "test_additionalText_1" - }, - }, - id: 1, - label: "0300_1", - } - var notificationRequest2 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_2", - text: "test_text_2", - additionalText: "test_additionalText_2" - }, - }, - id: 2, - label: "0300_2", - } - await notify.publish(notificationRequest1); - console.debug("===============Ans_GetActive_0300 publish1 end==================>"); - await notify.publish(notificationRequest2); - console.debug("===============Ans_GetActive_0300 publish2 end==================>"); - notify.getActiveNotifications(getCallbackTwo); - console.debug("===============Ans_GetActive_0300 getActiveNotifications end==================>"); - setTimeout(async function(){ - console.debug("===============Ans_GetActive_0300 done==================>"); - done(); - }, time); - }) - - /* - * @tc.number: Ans_GetActive_0400 - * @tc.name: getActiveNotifications(): Promise>; - * @tc.desc: Verify: after publishing two notifications, get all active notifications info(promise) - */ - it('Ans_GetActive_0400', 0, async function (done) { - console.debug("===============Ans_GetActive_0400 start==================>"); - await notify.cancelAll(); - var notificationRequest1 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_1", - text: "test_text_1", - additionalText: "test_additionalText_1" - }, - }, - id: 1, - label: "0400_1", - } - var notificationRequest2 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_2", - text: "test_text_2", - additionalText: "test_additionalText_2" - }, - }, - id: 2, - label: "0400_2", - } - await notify.publish(notificationRequest1); - console.debug("===============Ans_GetActive_0400 publish1 end==================>"); - await notify.publish(notificationRequest2); - console.debug("===============Ans_GetActive_0400 publish2 end==================>"); - var promiseData = await notify.getActiveNotifications(); - expect(promiseData.length).assertEqual(2); - var i; - for (i = 0; i < promiseData.length; i++) { - if (i == 0){ - expect(promiseData[i].content.normal.title).assertEqual("test_title_1"); - console.log("====Ans_GetActive_0400 getCallback title=====>"+promiseData[i].content.normal.title) - expect(promiseData[i].content.normal.text).assertEqual("test_text_1"); - console.log("===Ans_GetActive_0400 getCallback text========>"+promiseData[i].content.normal.text) - expect(promiseData[i].content.normal.additionalText).assertEqual("test_additionalText_1"); - console.log("Ans_GetActive_0400 getCallback text=====>"+promiseData[i].content.normal.additionalText) - expect(promiseData[i].id).assertEqual(1); - console.log("============Ans_GetActive_0400 getCallback id============>"+promiseData[i].id) - expect(promiseData[i].label).assertEqual("0400_1"); - console.log("============Ans_GetActive_0400 getCallback label=====>"+promiseData[i].label) - }else if(i == 1){ - expect(promiseData[i].content.normal.title).assertEqual("test_title_2"); - console.log("===Ans_GetActive_0400 getCallback title=========>"+promiseData[i].content.normal.title) - expect(promiseData[i].content.normal.text).assertEqual("test_text_2"); - console.log("====Ans_GetActive_0400 getCallback text============>"+promiseData[i].content.normal.text) - expect(promiseData[i].content.normal.additionalText).assertEqual("test_additionalText_2"); - console.log("Ans_GetActive_0400 getCallback text=====>"+promiseData[i].content.normal.additionalText) - expect(promiseData[i].id).assertEqual(2); - console.log("============Ans_GetActive_0400 getCallback id============>"+promiseData[i].id) - expect(promiseData[i].label).assertEqual("0400_2"); - console.log("============Ans_GetActive_0400 getCallback label=====>"+promiseData[i].label) - } - } - console.debug("===============Ans_GetActive_0400 getActiveNotifications end==================>"); - setTimeout(async function(){ - console.debug("===============Ans_GetActive_0400 done==================>"); - done(); - }, time); - }) - - /* - * @tc.number: Ans_GetActive_0500 - * @tc.name: getActiveNotifications(callback: AsyncCallback>): void; - * @tc.desc: Verify: before publishing any notifications, no active notifications can be get(callback) - */ - it('Ans_GetActive_0500', 0, async function (done) { - console.debug("===============Ans_GetActive_0500 start==================>"); - await notify.cancelAll(); - notify.getActiveNotifications((err, data)=>{ - console.log("Ans_GetActive_0500 getCallback data.length============>" + data.length); - console.log("Ans_GetActive_0500 getCallback JSON.stringify(data)============>" + JSON.stringify(data)); - expect(data.length).assertEqual(0); - setTimeout(function(){ - console.debug("===============Ans_GetActive_0500 done==================>"); - done(); - }, time); - }); - }) - - /* - * @tc.number: Ans_GetActive_0600 - * @tc.name: getActiveNotifications(): Promise>; - * @tc.desc: Verify: before publishing any notifications, no active notifications can be get(promise) - */ - it('Ans_GetActive_0600', 0, async function (done) { - console.debug("===============Ans_GetActive_0600 start==================>"); - await notify.cancelAll(); - var promiseData = await notify.getActiveNotifications(); - console.debug("===============Ans_GetActive_0600 getActiveNotifications end==================>"); - expect(promiseData.length).assertEqual(0); - console.debug("=========Ans_GetActive_0600 promiseData.length=============>"+promiseData.length); - console.debug("==Ans_GetActivcae_0600 JSON.stringify(promiseData)========>"+JSON.stringify(promiseData)); - setTimeout(function(){ - console.debug("===============Ans_GetActive_0600 done==================>"); - done(); - }, time); - }) - - function getCallbackFour(err, data){ - console.log("Ans_GetActive_0700 getCallback ============>"); - console.log("Ans_GetActive_0700 getCallback data.length============>"+data.length); - console.log("Ans_GetActive_0700 getCallback data============>"+JSON.stringify(data)); - expect(data.length).assertEqual(1); - var i; - for (i = 0; i < data.length; i++) { - expect(data[i].content.normal.title).assertEqual("test_title_2"); - console.log("==========Ans_GetActive_0700 getCallback title=========>"+data[i].content.normal.title) - expect(data[i].content.normal.text).assertEqual("test_text_2"); - console.log("==========Ans_GetActive_0700 getCallback text============>"+data[i].content.normal.text) - expect(data[i].content.normal.additionalText).assertEqual("test_additionalText_2"); - console.log("======Ans_GetActive_0700 getCallback text=======>"+data[i].content.normal.additionalText) - expect(data[i].id).assertEqual(2); - console.log("============Ans_GetActive_0700 getCallback id============>"+data[i].id) - expect(data[i].label).assertEqual("0700_2"); - console.log("============Ans_GetActive_0700 getCallback label=====>"+data[i].label) - } - } - - /* - * @tc.number: Ans_GetActive_0700 - * @tc.name: getActiveNotifications(callback: AsyncCallback>): void; - * @tc.desc: Verify: after publishing two notifications, - cancel one of the notifications, get all active notifications info(callback) - */ - it('Ans_GetActive_0700', 0, async function (done) { - console.debug("===============Ans_GetActive_0700 start==================>"); - await notify.cancelAll(); - var notificationRequest1 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_1", - text: "test_text_1", - additionalText: "test_additionalText_1" - }, - }, - id: 1, - label: "0700_1", - } - var notificationRequest2 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_2", - text: "test_text_2", - additionalText: "test_additionalText_2" - }, - }, - id: 2, - label: "0700_2", - } - await notify.publish(notificationRequest1); - console.debug("===============Ans_GetActive_0700 publish1 end==================>"); - await notify.publish(notificationRequest2); - console.debug("===============Ans_GetActive_0700 publish2 end==================>"); - await notify.cancel(1, "0700_1"); - console.debug("===============Ans_GetActive_0700 cancel end==================>"); - notify.getActiveNotifications(getCallbackFour); - console.debug("===============Ans_GetActive_0700 getActiveNotifications end==================>"); - setTimeout(async function(){ - console.debug("===============Ans_GetActive_0700 done==================>"); - done(); - }, time); - }) - - /* - * @tc.number: Ans_GetActive_0800 - * @tc.name: getActiveNotifications(): Promise>; - * @tc.desc: Verify: after publishing two notifications, - cancel one of the notifications, get all active notifications info(promise) - */ - it('Ans_GetActive_0800', 0, async function (done) { - console.debug("===============Ans_GetActive_0800 start==================>"); - await notify.cancelAll(); - var notificationRequest1 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_1", - text: "test_text_1", - additionalText: "test_additionalText_1" - }, - }, - id: 1, - label: "0800_1", - } - var notificationRequest2 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_2", - text: "test_text_2", - additionalText: "test_additionalText_2" - }, - }, - id: 2, - label: "0800_2", - } - await notify.publish(notificationRequest1); - console.debug("===============Ans_GetActive_0800 publish1 end==================>"); - await notify.publish(notificationRequest2); - console.debug("===============Ans_GetActive_0800 publish2 end==================>"); - await notify.cancel(1, "0800_1"); - console.debug("===============Ans_GetActive_0700 cancel end==================>"); - var promiseData = await notify.getActiveNotifications(); - var i; - for (i = 0; i < promiseData.length; i++) { - expect(promiseData[i].content.normal.title).assertEqual("test_title_2"); - console.log("======Ans_GetActive_0800 getCallback title=========>"+promiseData[i].content.normal.title) - expect(promiseData[i].content.normal.text).assertEqual("test_text_2"); - console.log("======Ans_GetActive_0800 getCallback text============>"+promiseData[i].content.normal.text) - expect(promiseData[i].content.normal.additionalText).assertEqual("test_additionalText_2"); - console.log("==Ans_GetActive_0800 getCallback text=======>"+promiseData[i].content.normal.additionalText) - expect(promiseData[i].id).assertEqual(2); - console.log("============Ans_GetActive_0800 getCallback id============>"+promiseData[i].id) - expect(promiseData[i].label).assertEqual("0800_2"); - console.log("============Ans_GetActive_0800 getCallback label=====>"+promiseData[i].label) - } - console.debug("===============Ans_GetActive_0800 getActiveNotifications end==================>"); - setTimeout(function(){ - console.debug("===============Ans_GetActive_0800 done==================>"); - done(); - }, time); - }) - - function getCallbackFive(err, data){ - console.log("Ans_GetActive_0900 getCallback ============>"); - console.log("Ans_GetActive_0900 getCallback data.length============>"+data.length); - console.log("Ans_GetActive_0900 getCallback data============>"+JSON.stringify(data)); - expect(data.length).assertEqual(0); - } - - /* - * @tc.number: Ans_GetActive_0900 - * @tc.name: getActiveNotifications(callback: AsyncCallback>): void; - * @tc.desc: Verify: after publishing two notifications, - cancel all the notifications, get all active notifications info(callback) - */ - it('Ans_GetActive_0900', 0, async function (done) { - console.debug("===============Ans_GetActive_0900 start==================>"); - await notify.cancelAll(); - var notificationRequest1 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_1", - text: "test_text_1", - additionalText: "test_additionalText_1" - }, - }, - id: 1, - label: "0900_1", - } - var notificationRequest2 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_2", - text: "test_text_2", - additionalText: "test_additionalText_2" - }, - }, - id: 2, - label: "0900_2", - } - await notify.publish(notificationRequest1); - console.debug("===============Ans_GetActive_0900 publish1 end==================>"); - await notify.publish(notificationRequest2); - console.debug("===============Ans_GetActive_0900 publish2 end==================>"); - await notify.cancelAll(); - console.debug("===============Ans_GetActive_0900 cancelAll end==================>"); - notify.getActiveNotifications(getCallbackFive); - console.debug("===============Ans_GetActive_0900 getActiveNotifications end==================>"); - setTimeout(function(){ - console.debug("===============Ans_GetActive_0900 done==================>"); - done(); - }, time); - }) - - /* - * @tc.number: Ans_GetActive_1000 - * @tc.name: getActiveNotifications(): Promise>; - * @tc.desc: Verify: after publishing two notifications, - cancel all the notifications, get all active notifications info(promise) - */ - it('Ans_GetActive_1000', 0, async function (done) { - console.debug("===============Ans_GetActive_1000 start==================>"); - await notify.cancelAll(); - var notificationRequest1 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_1", - text: "test_text_1", - additionalText: "test_additionalText_1" - }, - }, - id: 1, - label: "1000_1", - } - var notificationRequest2 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_2", - text: "test_text_2", - additionalText: "test_additionalText_2" - }, - }, - id: 2, - label: "1000_2", - } - await notify.publish(notificationRequest1); - console.debug("===============Ans_GetActive_1000 publish1 end==================>"); - await notify.publish(notificationRequest2); - console.debug("===============Ans_GetActive_1000 publish2 end==================>"); - await notify.cancelAll(); - console.debug("===============Ans_GetActive_1000 cancelAll end==================>"); - var promiseData = await notify.getActiveNotifications(); - console.log("Ans_GetActive_1000 getCallback data.length============>"+promiseData.length); - console.log("Ans_GetActive_1000 getCallback data============>"+JSON.stringify(promiseData)); - expect(promiseData.length).assertEqual(0); - console.debug("===============Ans_GetActive_1000 getActiveNotifications end==================>"); - setTimeout(function(){ - console.debug("===============Ans_GetActive_1000 done==================>"); - done(); - }, time); - }) - - function getCountCallback(err, count){ - console.debug("===============Ans_GetActive_1100 getNumCallback count==================>"+count); - expect(count).assertEqual(1); - } - - /* - * @tc.number: Ans_GetActive_1100 - * @tc.name: getActiveNotificationCount(callback: AsyncCallback): void; - * @tc.desc: Verify: after publishing a notification, get active notification count(callback) - */ - it('Ans_GetActive_1100', 0, async function (done) { - console.debug("===============Ans_GetActive_1100 start==================>"); - await notify.cancelAll(); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 1, - slotType : notify.SlotType.OTHER_TYPES, - deliveryTime : 1624950453, - autoDeletedTime: 1625036817, - color: 2, - statusBarText: "statusBarText", - label: "1100", - badgeIconStyle: 1, - } - await notify.publish(notificationRequest); - console.debug("===============Ans_GetActive_1100 publish end==================>"); - notify.getActiveNotificationCount(getCountCallback); - console.debug("===============Ans_GetActive_1100 getActiveNotificationCount end==================>"); - setTimeout(function(){ - console.debug("===============Ans_GetActive_1100 done==================>"); - done(); - }, time); - }) - - /* - * @tc.number: Ans_GetActive_1200 - * @tc.name: getActiveNotificationCount(): Promise; - * @tc.desc: Verify: after publishing a notification, get active notification number(promise) - */ - it('Ans_GetActive_1200', 0, async function (done) { - console.debug("===============Ans_GetActive_1200 start==================>"); - await notify.cancelAll(); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 1, - slotType : notify.SlotType.OTHER_TYPES, - deliveryTime : 1624950453, - autoDeletedTime: 1625036817, - color: 2, - statusBarText: "statusBarText", - label: "1200", - badgeIconStyle: 1, - } - await notify.publish(notificationRequest); - console.debug("===============Ans_GetActive_1200 publish end==================>"); - var promiseCount = await notify.getActiveNotificationCount(); - expect(promiseCount).assertEqual(1); - console.debug("===============Ans_GetActive_1200 promiseCount==================>"+promiseCount); - setTimeout(function(){ - console.debug("===============Ans_GetActive_1200 done==================>"); - done(); - }, time); - }) - - - function getCountCallbackTwo(err, count){ - console.debug("===============Ans_GetActive_1300 getCountCallbackTwo count==================>"+count); - expect(count).assertEqual(2); - } - - /* - * @tc.number: Ans_GetActive_1300 - * @tc.name: getActiveNotificationCount(callback: AsyncCallback): void; - * @tc.desc: Verify: after publishing two notifications, get active notification count(callback) - */ - it('Ans_GetActive_1300', 0, async function (done) { - console.debug("===============Ans_GetActive_1300 start==================>"); - await notify.cancelAll(); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 1, - slotType : notify.SlotType.OTHER_TYPES, - deliveryTime : 1624950453, - autoDeletedTime: 1625036817, - color: 2, - statusBarText: "statusBarText", - label: "1300_1", - badgeIconStyle: 1, - } - var notificationRequest1 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 2, - slotType : notify.SlotType.OTHER_TYPES, - deliveryTime : 1624950453, - autoDeletedTime: 1625036817, - color: 2, - statusBarText: "statusBarText", - label: "1300_2", - badgeIconStyle: 1, - } - await notify.publish(notificationRequest); - console.debug("===============Ans_GetActive_1300 publish end==================>"); - await notify.publish(notificationRequest1); - console.debug("===============Ans_GetActive_1300 publish end==================>"); - notify.getActiveNotificationCount(getCountCallbackTwo); - console.debug("===============Ans_GetActive_1300 getActiveNotificationCount end==================>"); - setTimeout(function(){ - console.debug("===============Ans_GetActive_1300 done==================>"); - done(); - }, time); - }) - - /* - * @tc.number: Ans_GetActive_1400 - * @tc.name: getActiveNotificationCount(): Promise; - * @tc.desc: Verify: after publishing two notifications, get active notification number(promise) - */ - it('Ans_GetActive_1400', 0, async function (done) { - console.debug("===============Ans_GetActive_1400 start==================>"); - await notify.cancelAll(); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 1, - slotType : notify.SlotType.OTHER_TYPES, - deliveryTime : 1624950453, - autoDeletedTime: 1625036817, - color: 2, - statusBarText: "statusBarText", - label: "1400_1", - badgeIconStyle: 1, - } - var notificationRequest1 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 2, - slotType : notify.SlotType.OTHER_TYPES, - deliveryTime : 1624950453, - autoDeletedTime: 1625036817, - color: 2, - statusBarText: "statusBarText", - label: "1400_2", - badgeIconStyle: 1, - } - await notify.publish(notificationRequest); - console.debug("===============Ans_GetActive_1400 publish1 end==================>"); - await notify.publish(notificationRequest1); - console.debug("===============Ans_GetActive_1400 publish2 end==================>"); - var promiseCount = await notify.getActiveNotificationCount(); - expect(promiseCount).assertEqual(2); - console.debug("===============Ans_GetActive_1400 promiseCount==================>"+promiseCount); - setTimeout(function(){ - console.debug("===============Ans_GetActive_1400 done==================>"); - done(); - }, time); - }) - - function getCountCallbackThree(err, count){ - console.debug("===============Ans_GetActive_1500 getCountCallbackThree count==================>"+count); - expect(count).assertEqual(0); - } - - /* - * @tc.number: Ans_GetActive_1500 - * @tc.name: getActiveNotificationCount(callback: AsyncCallback): void; - * @tc.desc: Verify: before publishing any notifications, no active notifications count can be get(callback) - */ - it('Ans_GetActive_1500', 0, async function (done) { - console.debug("===============Ans_GetActive_1500 start==================>"); - await notify.cancelAll(); - notify.getActiveNotificationCount(getCountCallbackThree); - console.debug("===============Ans_GetActive_1500 getActiveNotificationCount end==================>"); - setTimeout(function(){ - console.debug("===============Ans_GetActive_1500 done==================>"); - done(); - }, time); - }) - - /* - * @tc.number: Ans_GetActive_1600 - * @tc.name: getActiveNotificationCount(): Promise; - * @tc.desc: Verify: before publishing any notifications, no active notifications count can be get(promise) - */ - it('Ans_GetActive_1600', 0, async function (done) { - console.debug("===============Ans_GetActive_1600 start==================>"); - await notify.cancelAll(); - var promiseCount = await notify.getActiveNotificationCount(); - expect(promiseCount).assertEqual(0); - console.debug("===============Ans_GetActive_1600 promiseCount==================>"+promiseCount); - setTimeout(function(){ - console.debug("===============Ans_GetActive_1600 done==================>"); - done(); - }, time); - }) - - - function getCountCallbackFour(err, count){ - console.debug("===============Ans_GetActive_1700 getCountCallbackFour count==================>"+count); - expect(count).assertEqual(1); - } - - /* - * @tc.number: Ans_GetActive_1700 - * @tc.name: getActiveNotificationCount(callback: AsyncCallback): void; - * @tc.desc: Verify: after publishing two notifications, - cancel one of the notifications, get all active notifications count(callback) - */ - it('Ans_GetActive_1700', 0, async function (done) { - console.debug("===============Ans_GetActive_1700 start==================>"); - await notify.cancelAll(); - var notificationRequest1 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_1", - text: "test_text_1", - additionalText: "test_additionalText_1" - }, - }, - id: 1, - label: "1700_1", - } - var notificationRequest2 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_2", - text: "test_text_2", - additionalText: "test_additionalText_2" - }, - }, - id: 2, - label: "1700_2", - } - await notify.publish(notificationRequest1); - console.debug("===============Ans_GetActive_1700 publish1 end==================>"); - await notify.publish(notificationRequest2); - console.debug("===============Ans_GetActive_1700 publish2 end==================>"); - await notify.cancel(1, "1700_1"); - console.debug("===============Ans_GetActive_1700 cancel end==================>"); - notify.getActiveNotificationCount(getCountCallbackFour); - console.debug("===============Ans_GetActive_1700 getActiveNotifications end==================>"); - setTimeout(function(){ - console.debug("===============Ans_GetActive_1700 done==================>"); - done(); - }, time); - }) - - /* - * @tc.number: Ans_GetActive_1800 - * @tc.name: getActiveNotificationCount(): Promise; - * @tc.desc: Verify: after publishing two notifications, - cancel one of the notifications, get all active notifications count(promise) - */ - it('Ans_GetActive_1800', 0, async function (done) { - console.debug("===============Ans_GetActive_1800 start==================>"); - await notify.cancelAll(); - var notificationRequest1 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_1", - text: "test_text_1", - additionalText: "test_additionalText_1" - }, - }, - id: 1, - label: "1800_1", - } - var notificationRequest2 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_2", - text: "test_text_2", - additionalText: "test_additionalText_2" - }, - }, - id: 2, - label: "1800_2", - } - await notify.publish(notificationRequest1); - console.debug("===============Ans_GetActive_1800 publish1 end==================>"); - await notify.publish(notificationRequest2); - console.debug("===============Ans_GetActive_1800 publish2 end==================>"); - await notify.cancel(1, "1800_1"); - console.debug("===============Ans_GetActive_1800 cancel end==================>"); - var promiseCount = await notify.getActiveNotificationCount(); - expect(promiseCount).assertEqual(1); - console.debug("===============Ans_GetActive_1800 promiseCount===========>"+promiseCount); - setTimeout(function(){ - console.debug("===============Ans_GetActive_1800 done==================>"); - done(); - }, time); - }) - - function getCountCallbackFive(err, count){ - console.debug("===============Ans_GetActive_1900 getCountCallbackFour count==================>"+count); - expect(count).assertEqual(0); - } - - /* - * @tc.number: Ans_GetActive_1900 - * @tc.name: getActiveNotificationCount(callback: AsyncCallback): void; - * @tc.desc: Verify: after publishing two notifications, - cancel one of the notifications, get all active notifications count(callback) - */ - it('Ans_GetActive_1900', 0, async function (done) { - console.debug("===============Ans_GetActive_1900 start==================>"); - await notify.cancelAll(); - var notificationRequest1 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_1", - text: "test_text_1", - additionalText: "test_additionalText_1" - }, - }, - id: 1, - label: "1900_1", - } - var notificationRequest2 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_2", - text: "test_text_2", - additionalText: "test_additionalText_2" - }, - }, - id: 2, - label: "1900_2", - } - await notify.publish(notificationRequest1); - console.debug("===============Ans_GetActive_1900 publish1 end==================>"); - await notify.publish(notificationRequest2); - console.debug("===============Ans_GetActive_1900 publish2 end==================>"); - await notify.cancelAll(cancelAllCallback); - expect(cancalAllFlag).assertEqual(false); - console.debug("===============Ans_GetActive_1900 cancel end==================>"); - await notify.getActiveNotificationCount(getCountCallbackFive); - console.debug("===============Ans_GetActive_1900 getActiveNotifications end==================>"); - setTimeout(function(){ - console.debug("===============Ans_GetActive_1900 done==================>"); - done(); - }, time); - - - }) - - /* - * @tc.number: Ans_GetActive_2000 - * @tc.name: getActiveNotificationCount(): Promise; - * @tc.desc: Verify: after publishing two notifications, - cancel one of the notifications, get all active notifications count(promise) - */ - it('Ans_GetActive_2000', 0, async function (done) { - console.debug("===============Ans_GetActive_2000 start==================>"); - await notify.cancelAll(); - var notificationRequest1 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_1", - text: "test_text_1", - additionalText: "test_additionalText_1" - }, - }, - id: 1, - label: "2000_1", - } - var notificationRequest2 = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_2", - text: "test_text_2", - additionalText: "test_additionalText_2" - }, - }, - id: 2, - label: "2000_2", - } - await notify.publish(notificationRequest1); - console.debug("===============Ans_GetActive_2000 publish1 end==================>"); - await notify.publish(notificationRequest2); - console.debug("===============Ans_GetActive_2000 publish2 end==================>"); - await notify.cancelAll(cancelAllCallback); - expect(cancalAllFlag).assertEqual(true); - console.debug("===============Ans_GetActive_2000 cancelAll end==================>"); - var promiseCount = await notify.getActiveNotificationCount(); - expect(promiseCount).assertEqual(0); - console.debug("===============Ans_GetActive_2000 promiseCount===========>"+promiseCount); - setTimeout(function(){ - console.debug("===============Ans_GetActive_2000 done==================>"); - done(); - }, time); - }) - - function getAllCallbackNine(err,data){ - console.debug("===========Ans_GetAllActive_0900 getAllCallbackNine data.length============>"+data.length); - console.debug("===========Ans_GetAllActive_0900 getAllCallbackNine err.code============>"+err.code); - expect(err.code).assertEqual(0); - } - - /* - * @tc.number: Ans_GetAllActive_0900 - * @tc.name: getAllActiveNotifications(callback: AsyncCallback>): void; - * @tc.desc: Verify: Under non system permission, after the current app publish a notification, - get all active notifications in the system(callback) - */ - it('Ans_GetAllActive_0900', 0, async function (done) { - console.debug("===============Ans_GetAllActive_0900 start==================>"); - await notify.cancelAll(); - var notificationRequestOfCurrentApp = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_currentApp", - text: "test_text_currentApp", - additionalText: "test_additionalText_currentApp" - }, - }, - id: 1, - label: "currentApp_0900", - } - await notify.publish(notificationRequestOfCurrentApp); - console.debug("===============Ans_GetAllActive_0900 publish CurrentApp notify end==================>"); - notify.getAllActiveNotifications(getAllCallbackNine); - console.debug("===============Ans_GetAllActive_0900 getAllActiveNotifications end==================>"); - setTimeout(function(){ - console.debug("===============Ans_GetAllActive_0900 done==================>"); - done(); - }, time); - }) - - /* - * @tc.number: Ans_GetAllActive_1000 - * @tc.name: getAllActiveNotifications(): Promise>; - * @tc.desc: Verify: Under non system permission, after the current app publish a notification, - get all active notifications in the system(promise) - */ - it('Ans_GetAllActive_1000', 0, async function (done) { - console.debug("===============Ans_GetAllActive_1000 start==================>"); - await notify.cancelAll(); - var notificationRequestOfCurrentApp = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_currentApp", - text: "test_text_currentApp", - additionalText: "test_additionalText_currentApp" - }, - }, - id: 1, - label: "currentApp_1000", - } - await notify.publish(notificationRequestOfCurrentApp); - console.debug("===============Ans_GetAllActive_1000 publish CurrentApp notify end==================>"); - await notify.getAllActiveNotifications().then(()=>{ - console.debug("=======Ans_GetAllActive_1000 then========>"); - expect(err.code).assertEqual(0); - }).catch((err)=>{ - console.debug("=======Ans_GetAllActive_1000 err==========>"+err.code); - }); - setTimeout(function(){ - console.debug("===============Ans_GetAllActive_1000 done==================>"); - done(); - }, time); - }) -}) - -} diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/resources/base/element/string.json deleted file mode 100644 index e1be3afb18f88c0d67a8b711abaeb8a59bc4d6a7..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "getActive" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getactive/actsansgetactive/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/BUILD.gn b/notification/ans_standard/publish_test/getactive/actsansgetallactive/BUILD.gn deleted file mode 100644 index ba274c48ffa652a42800bc2aedb8892812f0abd8..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetallactive/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsAllActiveTestOne") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsAllActiveTestOne" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/Test.json b/notification/ans_standard/publish_test/getactive/actsansgetallactive/Test.json deleted file mode 100644 index 4d9b39f9da8ac867dda1c5fd8f3b23bd97b2b360..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetallactive/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "shell-timeout": "180000", - "bundle-name": "com.example.actsansgetallactivetest", - "package-name": "com.example.actsansgetallactivetest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsAllActiveTestOne.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/getactive/actsansgetallactive/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getactive/actsansgetallactive/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/config.json b/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/config.json deleted file mode 100644 index f3f54ddde18c4a57853262a16546291c6c1afcf7..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansgetallactivetest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansgetallactivetest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 50933d90e341bfd1da4cb62c7db8e07b6de2a643..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - currentApp - - - ForGetAllActive - -
diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/test/List.test.js deleted file mode 100644 index 8047919c7b38ba56d9b774e0f89de871b16158b3..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsAllActiveTestOne from './getAllActive.js' -export default function testsuite() { -ActsAnsAllActiveTestOne() -} diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/test/getAllActive.js b/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/test/getAllActive.js deleted file mode 100644 index 6222636a5c0c5c7f6a23b182889327df1aacc056..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/js/test/getAllActive.js +++ /dev/null @@ -1,352 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -var time = 500 -export default function ActsAnsAllActiveTestOne() { -describe('ActsAnsAllActiveTestOne', function () { - console.info("===========ActsAnsAllActiveTestOne start====================>"); - function getAllCallback(err, data){ - console.log("Ans_GetAllActive_0100 getAllCallback ============>"); - var i; - console.log("Ans_GetAllActive_0100 getAllCallback data.length============>"+data.length); - expect(data.length).assertEqual(2); - console.log("Ans_GetAllActive_0100 getAllCallback data============>"+JSON.stringify(data)); - for (i = 0; i < data.length; i++) { - if (i == 0){ - expect(data[i].content.normal.title).assertEqual("test_title_otherApp"); - console.log("=======Ans_GetAllActive_0100 getCallback title=====>"+data[i].content.normal.title) - expect(data[i].content.normal.text).assertEqual("test_text_otherApp"); - console.log("=======Ans_GetAllActive_0100 getCallback text========>"+data[i].content.normal.text) - expect(data[i].content.normal.additionalText).assertEqual("test_additionalText_otherApp"); - console.log("===Ans_GetAllActive_0100 getCallback text====>"+data[i].content.normal.additionalText) - expect(data[i].id).assertEqual(2); - console.log("============Ans_GetAllActive_0100 getCallback id============>"+data[i].id) - expect(data[i].label).assertEqual("otherApp"); - console.log("============Ans_GetAllActive_0100 getCallback label=====>"+data[i].label) - }else if(i == 1){ - expect(data[i].content.normal.title).assertEqual("test_title_currentApp"); - console.log("======Ans_GetAllActive_0100 getCallback title=========>"+data[i].content.normal.title) - expect(data[i].content.normal.text).assertEqual("test_text_currentApp"); - console.log("==========Ans_GetAllActive_0100 getCallback text=======>"+data[i].content.normal.text) - expect(data[i].content.normal.additionalText).assertEqual("test_additionalText_currentApp"); - console.log("===Ans_GetAllActive_0100 getCallback text=====>"+data[i].content.normal.additionalText) - expect(data[i].id).assertEqual(1); - console.log("============Ans_GetAllActive_0100 getCallback id============>"+data[i].id) - expect(data[i].label).assertEqual("currentApp_0100"); - console.log("============Ans_GetAllActive_0100 getCallback label=====>"+data[i].label) - } - } - } - - /* - * @tc.number: Ans_GetAllActive_0100 - * @tc.name: getAllActiveNotifications(callback: AsyncCallback>): void; - * @tc.desc: Verify: After the current app and other apps publish two notifications, - get all active notifications in the system(callback) - */ - it('Ans_GetAllActive_0100', 0, async function (done) { - console.debug("===============Ans_GetAllActive_0100 start==================>"); - await notify.cancelAll(); - var notificationRequestOfCurrentApp = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_currentApp", - text: "test_text_currentApp", - additionalText: "test_additionalText_currentApp" - }, - }, - id: 1, - label: "currentApp_0100", - } - await notify.publish(notificationRequestOfCurrentApp); - console.debug("===============Ans_GetAllActive_0100 publish CurrentApp notify end==================>"); - notify.getAllActiveNotifications(getAllCallback); - console.debug("===============Ans_GetAllActive_0100 getAllActiveNotifications end==================>"); - setTimeout(function(){ - console.debug("===============Ans_GetAllActive_0100 setTimeout==================>"); - done(); - }, time); - }) - - /* - * @tc.number: Ans_GetAllActive_0200 - * @tc.name: getAllActiveNotifications(): Promise> - * @tc.desc: Verify: After the current app and other apps publish two notifications, - get all active notifications in the system(promise) - */ - it('Ans_GetAllActive_0200', 0, async function (done) { - console.debug("===============Ans_GetAllActive_0200 start==================>"); - await notify.cancelAll(); - var notificationRequestOfCurrentApp = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_currentApp", - text: "test_text_currentApp", - additionalText: "test_additionalText_currentApp" - }, - }, - id: 1, - label: "currentApp_0200", - } - await notify.publish(notificationRequestOfCurrentApp); - console.debug("===============Ans_GetAllActive_0200 publish CurrentApp notify end==================>"); - var promiseData = await notify.getAllActiveNotifications(); - console.debug("===============Ans_GetAllActive_0200 getActiveNotifications end==================>"); - expect(promiseData.length).assertEqual(2); - var i; - for (i = 0; i < promiseData.length; i++) { - if (i == 0){ - expect(promiseData[i].content.normal.title).assertEqual("test_title_otherApp"); - console.log("=======Ans_GetAllActive_0200 title=====>"+promiseData[i].content.normal.title) - expect(promiseData[i].content.normal.text).assertEqual("test_text_otherApp"); - console.log("=======Ans_GetAllActive_0200 text========>"+promiseData[i].content.normal.text) - expect(promiseData[i].content.normal.additionalText).assertEqual("test_additionalText_otherApp"); - console.log("===Ans_GetAllActive_0200 text====>"+promiseData[i].content.normal.additionalText) - expect(promiseData[i].id).assertEqual(2); - console.log("============Ans_GetAllActive_0200 id============>"+promiseData[i].id) - expect(promiseData[i].label).assertEqual("otherApp"); - console.log("============Ans_GetAllActive_0200 label=====>"+promiseData[i].label) - }else if(i == 1){ - expect(promiseData[i].content.normal.title).assertEqual("test_title_currentApp"); - console.log("====Ans_GetAllActive_0200 title=====>"+promiseData[i].content.normal.title) - expect(promiseData[i].content.normal.text).assertEqual("test_text_currentApp"); - console.log("======Ans_GetAllActive_0200 text=====>"+promiseData[i].content.normal.text) - expect(promiseData[i].content.normal.additionalText).assertEqual("test_additionalText_currentApp"); - console.log("Ans_GetAllActive_0200 text===>"+promiseData[i].content.normal.additionalText) - expect(promiseData[i].id).assertEqual(1); - console.log("============Ans_GetAllActive_0200 id============>"+promiseData[i].id) - expect(promiseData[i].label).assertEqual("currentApp_0200"); - console.log("============Ans_GetAllActive_0200 label=====>"+promiseData[i].label) - } - } - setTimeout(function(){ - console.debug("===============Ans_GetAllActive_0200 setTimeout==================>"); - done(); - }, time); - }) - - function getAllCallbackThree(err, data){ - console.log("Ans_GetAllActive_0300 getAllCallbackThree ============>"); - console.log("Ans_GetAllActive_0300 getAllCallbackThree data.length============>"+data.length); - console.log("Ans_GetAllActive_0300 getAllCallbackThree data============>"+JSON.stringify(data)); - expect(data.length).assertEqual(1); - var i; - for (i = 0; i < data.length; i++) { - expect(data[i].content.normal.title).assertEqual("test_title_otherApp"); - console.log("==========Ans_GetAllActive_0300 getCallback title=========>"+data[i].content.normal.title) - expect(data[i].content.normal.text).assertEqual("test_text_otherApp"); - console.log("==========Ans_GetAllActive_0300 getCallback text============>"+data[i].content.normal.text) - expect(data[i].content.normal.additionalText).assertEqual("test_additionalText_otherApp"); - console.log("======Ans_GetAllActive_0300 getCallback text=======>"+data[i].content.normal.additionalText) - expect(data[i].id).assertEqual(2); - console.log("============Ans_GetAllActive_0300 getCallback id============>"+data[i].id) - expect(data[i].label).assertEqual("otherApp"); - console.log("============Ans_GetAllActive_0300 getCallback label=====>"+data[i].label) - } - } - - /* - * @tc.number: Ans_GetAllActive_0300 - * @tc.name: getAllActiveNotifications(callback: AsyncCallback>): void; - * @tc.desc: Verify: After the current app and other apps publish two notifications, cancel the notifications - of the current app, get all active notifications in the system(callback) - */ - it('Ans_GetAllActive_0300', 0, async function (done) { - console.debug("===============Ans_GetAllActive_0300 start==================>"); - await notify.cancelAll(); - var notificationRequestOfCurrentApp = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_currentApp", - text: "test_text_currentApp", - additionalText: "test_additionalText_currentApp" - }, - }, - id: 1, - label: "currentApp_0300", - } - await notify.publish(notificationRequestOfCurrentApp); - console.debug("===============Ans_GetAllActive_0300 publish CurrentApp notify end==================>"); - await notify.cancel(1, "currentApp_0300"); - notify.getAllActiveNotifications(getAllCallbackThree); - console.debug("===============Ans_GetAllActive_0300 getAllActiveNotifications end==================>"); - setTimeout(function(){ - console.debug("===============Ans_GetAllActive_0300 setTimeout==================>"); - done(); - }, time); - }) - - /* - * @tc.number: Ans_GetAllActive_0400 - * @tc.name: getAllActiveNotifications(): Promise>; - * @tc.desc: Verify: after publishing two notifications, - cancel one of the notifications, get all active notifications info(promise) - */ - it('Ans_GetAllActive_0400', 0, async function (done) { - console.debug("===============Ans_GetAllActive_0400 start==================>"); - await notify.cancelAll(); - var notificationRequestOfCurrentApp = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_currentApp", - text: "test_text_currentApp", - additionalText: "test_additionalText_currentApp" - }, - }, - id: 1, - label: "currentApp_0400", - } - await notify.publish(notificationRequestOfCurrentApp); - console.debug("===============Ans_GetAllActive_0400 publish CurrentApp notify end==================>"); - await notify.cancel(1, "currentApp_0400"); - console.debug("===============Ans_GetAllActive_0400 cancel end==================>"); - var promiseData = await notify.getAllActiveNotifications(); - var i; - for (i = 0; i < promiseData.length; i++) { - expect(promiseData[i].content.normal.title).assertEqual("test_title_otherApp"); - console.log("=======Ans_GetAllActive_0400 title=====>"+promiseData[i].content.normal.title) - expect(promiseData[i].content.normal.text).assertEqual("test_text_otherApp"); - console.log("=======Ans_GetAllActive_0400 text========>"+promiseData[i].content.normal.text) - expect(promiseData[i].content.normal.additionalText).assertEqual("test_additionalText_otherApp"); - console.log("===Ans_GetAllActive_0400 text====>"+promiseData[i].content.normal.additionalText) - expect(promiseData[i].id).assertEqual(2); - console.log("============Ans_GetAllActive_0400 id============>"+promiseData[i].id) - expect(promiseData[i].label).assertEqual("otherApp"); - console.log("============Ans_GetAllActive_0400 label=====>"+promiseData[i].label) - } - console.debug("===============Ans_GetAllActive_0400 getAllActiveNotifications end==================>"); - setTimeout(function(){ - console.debug("===============Ans_GetAllActive_0400 setTimeout==================>"); - done(); - }, time); - }) - - function getAllCallbackFive(err, data){ - console.log("Ans_GetAllActive_0500 getAllCallbackFive data.length============>"+data.length); - console.log("Ans_GetAllActive_0500 getAllCallbackFive data============>"+JSON.stringify(data)); - expect(data.length).assertEqual(0); - } - /* - * @tc.number: Ans_GetAllActive_0500 - * @tc.name: getAllActiveNotifications(callback: AsyncCallback>): void; - * @tc.desc: Verify: After the current app and other apps publish two notifications, remove all the notifications - of the system, get all active notifications in the system(callback) - */ - it('Ans_GetAllActive_0500', 0, async function (done) { - console.debug("===============Ans_GetAllActive_0500 start==================>"); - await notify.cancelAll(); - var notificationRequestOfCurrentApp = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_currentApp", - text: "test_text_currentApp", - additionalText: "test_additionalText_currentApp" - }, - }, - id: 1, - label: "currentApp_0500", - } - await notify.publish(notificationRequestOfCurrentApp); - console.debug("===============Ans_GetAllActive_0500 publish CurrentApp notify end==================>"); - await notify.removeAll(); - notify.getAllActiveNotifications(getAllCallbackFive); - console.debug("===============Ans_GetAllActive_0500 getAllActiveNotifications end==================>"); - setTimeout(function(){ - console.debug("===============Ans_GetAllActive_0500 setTimeout==================>"); - done(); - }, time); - }) - - /* - * @tc.number: Ans_GetAllActive_0600 - * @tc.name: getAllActiveNotifications(): Promise>; - * @tc.desc: Verify: After the current app and other apps publish two notifications, remove all the notifications - of the system, get all active notifications in the system(promise) - */ - it('Ans_GetAllActive_0600', 0, async function (done) { - console.debug("===============Ans_GetAllActive_0600 start==================>"); - await notify.cancelAll(); - var notificationRequestOfCurrentApp = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_currentApp", - text: "test_text_currentApp", - additionalText: "test_additionalText_currentApp" - }, - }, - id: 1, - label: "currentApp_0600", - } - await notify.publish(notificationRequestOfCurrentApp); - console.debug("==========Ans_GetAllActive_0600 publish CurrentApp notify end==================>"); - await notify.removeAll(); - var promiseData = await notify.getAllActiveNotifications(); - expect(promiseData.length).assertEqual(0); - console.debug("=======Ans_GetAllActive_0600 promiseData.length==========>"+promiseData.length); - console.debug("=======Ans_GetAllActive_0600 promiseData==========>"+JSON.stringify(promiseData)); - setTimeout(function(){ - console.debug("===============Ans_GetAllActive_0600 setTimeout==================>"); - done(); - }, time); - }) - - function getAllCallbackSeven(err, data){ - console.log("Ans_GetAllActive_0700 getAllCallbackSeven data.length============>"+data.length); - console.log("Ans_GetAllActive_0700 getAllCallbackSeven data============>"+JSON.stringify(data)); - expect(data.length).assertEqual(0); - } - /* - * @tc.number: Ans_GetAllActive_0700 - * @tc.name: getAllActiveNotifications(callback: AsyncCallback>): void; - * @tc.desc: Verify:No active notifications in the system, get all active notifications in the system(callback) - */ - it('Ans_GetAllActive_0700', 0, async function (done) { - console.debug("===============Ans_GetAllActive_0700 start==================>"); - await notify.removeAll(); - notify.getAllActiveNotifications(getAllCallbackSeven); - console.debug("===============Ans_GetAllActive_0700 getAllActiveNotifications end==================>"); - setTimeout(function(){ - console.debug("===============Ans_GetAllActive_0700 setTimeout==================>"); - done(); - }, time); - }) - - /* - * @tc.number: Ans_GetAllActive_0800 - * @tc.name: getAllActiveNotifications(): Promise>; - * @tc.desc: Verify: No active notifications in the system, get all active notifications in the system(promise) - */ - it('Ans_GetAllActive_0800', 0, async function (done) { - console.debug("==========Ans_GetAllActive_0800 start==================>"); - await notify.removeAll(); - var promiseData = await notify.getAllActiveNotifications(); - console.debug("=========Ans_GetAllActive_0800 promiseData.length=============>"+promiseData.length); - expect(promiseData.length).assertEqual(0); - setTimeout(function(){ - console.debug("===============Ans_GetAllActive_0800 setTimeout==================>"); - done(); - }, time); - }) -}) - -} diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/resources/base/element/string.json deleted file mode 100644 index 7f71c81573e31b291ddd76d3c37c7eba4a6da7dc..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "getAllActive" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getactive/actsansgetallactive/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/BUILD.gn b/notification/ans_standard/publish_test/getactive/getactiveotherapp/BUILD.gn deleted file mode 100644 index d502d56eac49ced3ebda4a6bf1510898ff5276c2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactiveotherapp/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("ActsAnsGetActiveOtherApp") { - hap_profile = "./entry/src/main/config.json" - hap_name = "ActsAnsGetActiveOtherApp" - subsystem_name = "notification" - part_name = "distributed_notification_service" - testonly = true - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/config.json b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/config.json deleted file mode 100644 index efe01039421a4468084276e5747367d052de0300..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/config.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansgetactiveotherapp", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansgetactiveotherapp", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsansgetactiveotherapp.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 3195e9aa737cc1fbf99beb25548635d4508bc9be..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - otherAppForPublish - -
diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index e32f166fc6b1c4b9db2f1199b306e154d837b997..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - this.timeout = 120000 - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index b416327547106048167f800df4b1b79f1804376d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "activeotherapp" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/test/List.test.js deleted file mode 100644 index 8f93037489a3bfbef3415aab8b9ff3f88501e87d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -require('./activeotherapp.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/test/activeotherapp.js b/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/test/activeotherapp.js deleted file mode 100644 index ee1320ad52914d08f8784e2ba7c3c7215fdedb4d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getactive/getactiveotherapp/entry/src/main/js/test/activeotherapp.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsGetActiveOtherApp', function () { - console.info("===========ActsAnsAllActiveTestOne start====================>"); - - /* - * @tc.number: Ans_GetAllActive_0100(publish) - * @tc.name: getAllActiveNotifications(callback: AsyncCallback>): void; - * @tc.desc: Send notification as other apps. - */ - it('ActPublish_0100', 0, async function (done) { - console.debug("===============ActPublish_0100 start==================>"); - await notify.removeAll(); - var notificationRequestOfOtherApp = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title_otherApp", - text: "test_text_otherApp", - additionalText: "test_additionalText_otherApp" - }, - }, - id: 2, - label: "otherApp", - } - await notify.publish(notificationRequestOfOtherApp); - console.debug("===============ActPublish_0100 publish CurrentApp notify end==================>"); - done(); - setTimeout(async function(){ - console.debug("===============ActPublish_0100 done==================>"); - }, time); - }) - -}) - diff --git a/notification/ans_standard/publish_test/getactive/getactiveotherapp/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/getactive/getactiveotherapp/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getactive/getactiveotherapp/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/getwantagentinfo/BUILD.gn b/notification/ans_standard/publish_test/getwantagentinfo/BUILD.gn deleted file mode 100644 index 715ab1e02b4eda746ce0498436ed9fddc2f2c2a2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsGetWantAgentInfoTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsGetWantAgentInfoTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/Test.json b/notification/ans_standard/publish_test/getwantagentinfo/Test.json deleted file mode 100644 index b2ebc55f8c441821abf69d693bd486d0afb53574..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "60000", - "shell-timeout": "60000", - "bundle-name": "com.example.actsansgetwantagentinfotest", - "package-name": "com.example.actsansgetwantagentinfotest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsGetWantAgentInfoTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/getwantagentinfo/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getwantagentinfo/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/getwantagentinfo/src/main/config.json b/notification/ans_standard/publish_test/getwantagentinfo/src/main/config.json deleted file mode 100644 index 3c669e73321dca8ad40821c514e174d8afb96694..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansgetwantagentinfotest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansgetwantagentinfotest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 95d57c848c7e3460a862eefe96bd1c2381563842..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - Test of Getting AgentInfo - -
diff --git a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/test/List.test.js deleted file mode 100644 index 7f72f8983a95bd2377d7afdb0c186149a64466de..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsGetWantAgentInfoTest from './WantAgent.test.js' -export default function testsuite() { -ActsAnsGetWantAgentInfoTest() -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/test/WantAgent.test.js deleted file mode 100644 index 7f9923fb5cb89d9cd8caffba8502bb0a948ae0e1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/src/main/js/test/WantAgent.test.js +++ /dev/null @@ -1,1063 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import wantAgent from '@ohos.wantAgent'; - -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'; - -var WantAgenta; -var WantAgentb; -var WantAgentc; -var WantAgentd; -var WantAgente; -var time = 1000 -export default function ActsAnsGetWantAgentInfoTest() { -describe('ActsAnsGetWantAgentInfoTest', function () { - console.info('----ActsGetWantAgentInfoTest----'); - - /* - * @tc.number: ACTS_SetWantInfo_0100 - * @tc.name: getWantAgent(),getBundleName(),getUid(),getWant(),cancel() - * @tc.desc: verify the function of getWantAgent(),getBundleName(),getUid(),getWant(),cancel() - */ - it('ACTS_SetWantInfo_0100', 0, async function (done) { - console.info('----ACTS_SetWantInfo_0100----'); - var agentInfoa = { - wants: [ - { - bundleName: "com.example.WantAgentTest", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] - } - wantAgent.getWantAgent(agentInfoa, - (err, data) => { - if (err.code == 0) { - WantAgenta = data; - console.info('----getWantAgenta success!----'+data); - expect(typeof(data)).assertEqual("object"); - - wantAgent.getBundleName(data, - (err1, data1) => { - if (err1.code == 0) { - console.info('----getBundleNameA success!----'+err.code+data1); - expect(typeof(data1)).assertEqual('string') - } else { - console.info('----getBundleNameA failed!----'); - } - } - ); - wantAgent.getUid(data, - (err2, data2) => { - if (err2.code == 0) { - console.info('----getUidA success!----'+err.code+data2); - expect(typeof(data2)).assertEqual('number') - } else { - console.info('----getUidA failed!----'); - } - } - ); - wantAgent.getWant(data,(err3, data3) => { - if (err3.code == 0) { - console.info('----getWantA success!----'+err.code+data3); - expect(typeof(data3)).assertEqual('object') - } else { - console.info('----getWantA failed!----'); - } - }); - wantAgent.cancel(data,(err)=>{ - console.info("========cancelA========"+err.code) - }); - } else { - console.info('----getWantAgenta failed!----'+err.code+data); - expect(typeof(data)).assertEqual("object"); - } - done(); - }), - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0100====>"); - }, time); - console.info('----getWantAgenta after----'); - }) - - /* - * @tc.number: ACTS_SetWantInfo_0200 - * @tc.name: getWantAgent(),getBundleName(),getUid(),getWant(),cancel() - * @tc.desc: verify the function of getWantAgent(),getBundleName(),getUid(),getWant(),cancel() promise - */ - it('ACTS_SetWantInfo_0200', 0, async function (done) { - var agentInfod = { - wants: [ - { - bundleName: "com.example.WantAgentTest", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] - } - wantAgent.getWantAgent(agentInfod).then( - (data) => { - console.info('----getWantAgent Promise success!----'+data); - expect(typeof(data)).assertEqual("object"); - wantAgent.getBundleName(data).then( - (data1) => { - console.info('----getBcanundleName Promise success!----'+data1); - expect(typeof(data1)).assertEqual('string') - } - ); - wantAgent.getUid(data).then( - (data2) => { - console.info('----getUid Promise success!----'+data2); - expect(typeof(data2)).assertEqual('number') - } - ); - wantAgent.getWant(data).then( - (data3) => { - console.info('----getWant Promise success!----'+data3); - console.info('Want = ' + data3); - expect(typeof(data3)).assertEqual('object') - } - ); - wantAgent.cancel(data).then( - console.info("========cancelPromise========") - ); - }) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0200====>"); - }, time) - }) - - /* - * @tc.number: ACTS_SetWantInfo_0300 - * @tc.name: equal(normal) - * @tc.desc: verify the function of equal(normal)Callback - */ - it('ACTS_SetWantInfo_0300', 0, async function (done) { - var agentInfob = { - wants: [ - { - bundleName: "bundleName", - abilityName: "abilityName", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] - } - wantAgent.getWantAgent(agentInfob,(err,data)=>{ - WantAgentb = data - }) - - var agentInfoc = { - wants: [ - { - bundleName: "com.example.WantAgentTest", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] - } - setTimeout(function(){ - wantAgent.getWantAgent(agentInfoc, - (err, data) => { - if (err.code == 0) { - WantAgentc = data; - console.log("=======WantAgentb======="+JSON.stringify(WantAgentb)) - console.log("=======WantAgentc======="+JSON.stringify(WantAgentc)) - expect(typeof(data)).assertEqual("object"); - wantAgent.equal(WantAgentb,WantAgentc, - (error,data) => { - if(error.code == 0) { - console.info('----equala success!----'+data) - expect(typeof(data)).assertEqual("boolean"); - expect(data).assertEqual(false); - } - else{ - console.info('----equala failed!----') - } - } - ) - wantAgent.equal(WantAgentb,WantAgentb, - (error,data) => { - if(error.code == 0) { - console.info('----equalb success!----'+data) - expect(typeof(data)).assertEqual("boolean"); - expect(data).assertEqual(true); - } - else{ - console.info('----equalb failed!----') - } - } - ) - } - else{ - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0300====>"); - done(); - }, time); - }); - }, 1000); - - }) - - /* - * @tc.number: ACTS_SetWantInfo_0400 - * @tc.name: equal(normal) - * @tc.desc: verify the function of equal(normal) promise - */ - it('ACTS_SetWantInfo_0400', 0, async function (done) { - var agentInfoe = { - wants: [ - { - bundleName: "bundleName", - abilityName: "abilityName", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] - } - wantAgent.getWantAgent(agentInfoe,(err,data)=>{ - console.log("=======agentInfoe======="+err.code+JSON.stringify(data)) - WantAgentd = data - }) - - var agentInfof = { - wants: [ - { - bundleName: "com.example.WantAgentTest", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] - } - setTimeout(function(){ - wantAgent.getWantAgent(agentInfof, - (err, data) => { - console.log("=======agentInfof======="+err.code+JSON.stringify(data)) - if (err.code == 0) { - WantAgente = data; - console.log("=======WantAgente======="+JSON.stringify(WantAgentd)) - console.log("=======WantAgentf======="+JSON.stringify(WantAgente)) - wantAgent.equal(WantAgentd,WantAgente).then( - (data) => { - console.info('----equalc success!----'+data) - expect(typeof(data)).assertEqual("boolean"); - expect(data).assertEqual(false); - } - ) - wantAgent.equal(WantAgentd,WantAgentd).then( - (data) => { - console.info('----equald success!----'+data) - expect(typeof(data)).assertEqual("boolean"); - expect(data).assertEqual(true); - } - ) - } - else{ - console.info('----getWantAgent failed!----'+err.code+data); - } - - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0400====>"); - done(); - }, time); - }); - }, 1000); - }) - - /* - * @tc.number: ACTS_SetWantInfo_0500 - * @tc.name: equal(),cancel() - * @tc.desc: verify the function of equal(),cancel() promise - */ - it('ACTS_SetWantInfo_0500', 0, async function (done) { - var agentInfoe = { - wants: [ - { - bundleName: "$%^%^%&^%&", - abilityName: "$%^&%&*^&*^", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] - } - wantAgent.getWantAgent(agentInfoe,(err,data)=>{ - WantAgentd = data - }) - - var agentInfof = { - wants: [ - { - bundleName: "com.neu.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] - } - setTimeout(function(){ - wantAgent.getWantAgent(agentInfof, - (err, data) => { - if (err.code == 0) { - WantAgente = data; - console.log("=======WantAgente======="+JSON.stringify(WantAgentd)) - console.log("=======WantAgentf======="+JSON.stringify(WantAgente)) - expect(typeof(data)).assertEqual("object"); - wantAgent.equal(WantAgentd,WantAgente).then( - (data) => { - console.info('----equale success!----'+data) - expect(typeof(data)).assertEqual("boolean"); - } - ) - wantAgent.cancel(WantAgentd).then( - console.info("========cancelPromise========") - ); - wantAgent.equal(WantAgentd,WantAgente).then( - (data) => { - console.info('----equalf success!----'+data) - expect(typeof(data)).assertEqual("boolean"); - } - ) - wantAgent.equal(WantAgentd,WantAgentd).then( - (data) => { - console.info('----equalg success!----'+data) - expect(typeof(data)).assertEqual("boolean"); - } - ) - } - else{ - console.info('----getWantAgent failed!----'+err.code); - } - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0500====>"); - }, time); - }); - }, 1000); - }) - - /* - * @tc.number: ACTS_SetWantInfo_0600 - * @tc.name: equal() - * @tc.desc: verify the function of equal("$%$%^$%^","$%$%^$%^")callback - */ - it('ACTS_SetWantInfo_0600', 0, async function (done) { - wantAgent.equal("$%$%^$%^","$%$%^$%^", - (error,data) => { - if(error.code == 0) { - console.info('----equalh success!----'+data) - expect(typeof(data)).assertEqual("boolean"); - } - else{ - console.info('----equalh failed!----') - } - } - ) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0600====>"); - }, time); - }); - - /* - * @tc.number: ACTS_SetWantInfo_0700 - * @tc.name: equal() - * @tc.desc: verify the function of equal("$%$%^$%^","$%$%^$%^")promise - */ - it('ACTS_SetWantInfo_0700', 0, async function (done) { - wantAgent.equal("$%$%^$%^","$%$%^$%^").then((error, data)=>{ - if(error.code) { - expect(error.code).assertEqual(-1) - } - }) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0700====>"); - }, time); - }); - - /* - * @tc.number: ACTS_SetWantInfo_0800 - * @tc.name: equal() - * @tc.desc: verify the function of equal({},{})callback - */ - it('ACTS_SetWantInfo_0800', 0, async function (done) { - wantAgent.equal({},{}, - (err,data) => { - console.info('----equalj success!----'+err.code+data) - expect(typeof(data)).assertEqual("boolean"); - } - ) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0800====>"); - }, time); - }); - - /* - * @tc.number: ACTS_SetWantInfo_0900 - * @tc.name: equal() - * @tc.desc: verify the function of equal({},{})promise - */ - it('ACTS_SetWantInfo_0900', 0, async function (done) { - wantAgent.equal({},{}).then((error, data)=>{ - if(error.code) { - expect(error.code).assertEqual(-1) - } - }) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_0900====>"); - }, time); - }); - - /* - * @tc.number: ACTS_SetWantInfo_1000 - * @tc.name: equal() - * @tc.desc: verify the function of equal(100,100)callback - */ - it('ACTS_SetWantInfo_1000', 0, async function (done) { - wantAgent.equal(100,100, - (err,data) => { - console.info('----equalm success!----'+err.code+data) - expect(typeof(data)).assertEqual("boolean"); - } - ) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_1000====>"); - }, time); - }); - - /* - * @tc.number: ACTS_SetWantInfo_1100 - * @tc.name: equal() - * @tc.desc: verify the function of equal(100,100)promise - */ - it('ACTS_SetWantInfo_1100', 0, async function (done) { - wantAgent.equal(100,100).then((error, data)=>{ - if(error.code) { - expect(error.code).assertEqual(-1) - } - }) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_1100====>"); - }, time); - }); - - /* - * @tc.number: ACTS_SetWantInfo_1200 - * @tc.name: getWantAgent() - * @tc.desc: verify the function of getWantAgent("")callback - */ - it('ACTS_SetWantInfo_1200', 0, async function (done) { - console.info('----ACTS_SetWantInfo_0300 begin----'); - wantAgent.getWantAgent("",(err,data) => { - console.log("===getWantAgenta==="+err.code+data)}) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_1200====>"); - }, time); - }) - - /* - * @tc.number: ACTS_SetWantInfo_1300 - * @tc.name: getWantAgent() - * @tc.desc: verify the function of getWantAgent("")promise - */ - it('ACTS_SetWantInfo_1300', 0, async function (done) { - console.info('----ACTS_SetWantInfo_0300 begin----'); - wantAgent.getWantAgent("").then((error, data)=>{ - if(error.code) { - expect(error.code).assertEqual(-1) - } - }) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_1300====>"); - }, time); - }) - - /* - * @tc.number: ACTS_SetWantInfo_1400 - * @tc.name: getBundleName() - * @tc.desc: verify the function of getBundleName("")callback - */ - it('ACTS_SetWantInfo_1400', 0, async function (done) { - wantAgent.getBundleName("",(err,data) => { - console.info('----getBundleNamea success!----'+err.code+data); - expect(typeof(data)).assertEqual('string')}); - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_1400====>"); - }, time); - }) - - /* - * @tc.number: ACTS_SetWantInfo_1500 - * @tc.name: getBundleName() - * @tc.desc: verify the function of getBundleName("")promise - */ - it('ACTS_SetWantInfo_1500', 0, async function (done) { - wantAgent.getBundleName("").then((error, data)=>{ - if(error.code) { - expect(error.code).assertEqual(-1) - } - }) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_1500====>"); - }, time); - }) - - /* - * @tc.number: ACTS_SetWantInfo_1600 - * @tc.name: getUid() - * @tc.desc: verify the function of getUid("")callback - */ - it('ACTS_SetWantInfo_1600', 0, async function (done) { - wantAgent.getUid("",(err,data) => { - console.info('----getUida success!----'+err.code+data); - expect(typeof(data)).assertEqual('number')}); - done() - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_1600====>"); - }, time); - }) - - /* - * @tc.number: ACTS_SetWantInfo_1700 - * @tc.name: getUid() - * @tc.desc: verify the function of getUid("")promise - */ - it('ACTS_SetWantInfo_1700', 0, async function (done) { - wantAgent.getUid("").then((error, data)=>{ - if(error.code) { - expect(error.code).assertEqual(-1) - } - }) - done() - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_1700====>"); - }, time); - }) - - /* - * @tc.number: ACTS_SetWantInfo_1800 - * @tc.name: getWant() - * @tc.desc: verify the function of getWant("")callback - */ - it('ACTS_SetWantInfo_1800', 0, async function (done) { - wantAgent.getWant("",(err,data) => { - console.info('----getWanta success!----'+err.code+data); - expect(typeof(data)).assertEqual('object') - }); - done() - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_1800====>"); - }, time); - }) - - /* - * @tc.number: ACTS_SetWantInfo_1900 - * @tc.name: getWant() - * @tc.desc: verify the function of getWant("")promise - */ - it('ACTS_SetWantInfo_1900', 0, async function (done) { - wantAgent.getWant("").then((error, data)=>{ - if(error.code) { - expect(error.code).assertEqual(-1) - } - }) - done() - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_1900====>"); - }, time); - }) - - /* - * @tc.number: ACTS_SetWantInfo_2000 - * @tc.name: getWantAgent() - * @tc.desc: verify the function of getWantAgent(100)callback - */ - it('ACTS_SetWantInfo_2000', 0, async function (done) { - console.info('----ACTS_SetWantInfo_1000 begin----'); - wantAgent.getWantAgent(100,(err,data) => { - console.log('----getWantAgenta success!----'+err.code+data) - }) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_2000====>"); - }, time); - }) - - /* - * @tc.number: ACTS_SetWantInfo_2100 - * @tc.name: getWantAgent() - * @tc.desc: verify the function of getWantAgent(100)promises - */ - it('ACTS_SetWantInfo_2100', 0, async function (done) { - wantAgent.getWantAgent(100).then((error, data)=>{ - if(error.code) { - expect(error.code).assertEqual(-1) - } - }) - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_2100====>"); - }, time); - }) - - /* - * @tc.number: ACTS_SetWantInfo_2200 - * @tc.name: getBundleName() - * @tc.desc: verify the function of getBundleName(100)callback - */ - it('ACTS_SetWantInfo_2200', 0, async function (done) { - wantAgent.getBundleName(100,(err,data) => { - console.info('----getBundleNamec success!----'+err.code+data); - expect(typeof(data)).assertEqual('string') - }); - done() - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_2200====>"); - }, time); - }) - - /* - * @tc.number: ACTS_SetWantInfo_2300 - * @tc.name: getBundleName() - * @tc.desc: verify the function of getBundleName(100)promise - */ - it('ACTS_SetWantInfo_2300', 0, async function (done) { - wantAgent.getBundleName(100).then((error, data)=>{ - if(error.code) { - expect(error.code).assertEqual(-1) - } - }) - done() - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_2300====>"); - }, time); - }) - - /* - * @tc.number: ACTS_SetWantInfo_2400 - * @tc.name: getUid() - * @tc.desc: verify the function of getUid(100)callback - */ - it('ACTS_SetWantInfo_2400', 0, async function (done) { - wantAgent.getUid(100,(err,data) => { - console.info('----getUidc success!----'+err.code+data); - }); - done() - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_2400====>"); - }, time); - }) - - /* - * @tc.number: ACTS_SetWantInfo_2500 - * @tc.name: getUid() - * @tc.desc: verify the function of getUid(100)promise - */ - it('ACTS_SetWantInfo_2500', 0, async function (done) { - wantAgent.getUid(100).then((error, data)=>{ - if(error.code) { - expect(error.code).assertEqual(-1) - } - }) - done() - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_2500====>"); - }, time); - }) - - /* - * @tc.number: ACTS_SetWantInfo_2600 - * @tc.name: getWant() - * @tc.desc: verify the function of getWant(100)callback - */ - it('ACTS_SetWantInfo_2600', 0, async function (done) { - wantAgent.getWant(100,(err,data) => { - console.info('----getWantc success!----'+err.code+data); - expect(typeof(data)).assertEqual('object') - }); - done() - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_2600====>"); - }, time); - }) - - /* - * @tc.number: ACTS_SetWantInfo_2700 - * @tc.name: getWant() - * @tc.desc: verify the function of getWant(100)promise - */ - it('ACTS_SetWantInfo_2700', 0, async function (done) { - wantAgent.getWant(100).then((error, data)=>{ - if(error.code) { - expect(error.code).assertEqual(-1) - } - }) - done() - setTimeout(function(){ - console.debug("====>time out ACTS_SetWantInfo_2700====>"); - }, time); - }) - - /* - * @tc.number: ACTS_SetWantInfo_2800 - * @tc.name: getWantAgent() - * @tc.desc: verify the function of getWantAgent({})callback - */ - it('ACTS_SetWantInfo_2800', 0, async function (done) { - console.info('----ACTS_SetWantInfo_2800 begin----'); - wantAgent.getWantAgent({},(err,data) => { - console.log("----getWantAgentc success!----"+err.code+data) - }) - done(); - }) - - /* - * @tc.number: ACTS_SetWantInfo_2900 - * @tc.name: getWantAgent() - * @tc.desc: verify the function of getWantAgent({})promise - */ - it('ACTS_SetWantInfo_2900', 0, async function (done) { - console.info('----ACTS_SetWantInfo_2900 begin----'); - wantAgent.getWantAgent({}).then((data)=>{ - console.log("----getWantAgentd success!----"+data) - expect(data).assertEqual("object") - }) - done(); - }) - - /* - * @tc.number: ACTS_SetWantInfo_3000 - * @tc.name: getBundleName() - * @tc.desc: verify the function of getBundleName({})callback - */ - it('ACTS_SetWantInfo_3000', 0, async function (done) { - wantAgent.getBundleName({},(err,data) => { - console.info('----getBundleNamee success!----'+err.code+data); - expect(typeof(data)).assertEqual('string') - }); - done() - }) - - /* - * @tc.number: ACTS_SetWantInfo_3100 - * @tc.name: getBundleName() - * @tc.desc: verify the function of getBundleName({})promise - */ - it('ACTS_SetWantInfo_3100', 0, async function (done) { - wantAgent.getBundleName({}).then((error, data)=>{ - if(error.code) { - expect(error.code).assertEqual(-1) - } - }) - done() - }) - - /* - * @tc.number: ACTS_SetWantInfo_3200 - * @tc.name: getUid() - * @tc.desc: verify the function of getUid({})callback - */ - it('ACTS_SetWantInfo_3200', 0, async function (done) { - wantAgent.getUid({},(err,data) => { - console.info('----getUide success!----'+err.code+data); - }); - done() - }) - - /* - * @tc.number: ACTS_SetWantInfo_3300 - * @tc.name: getUid() - * @tc.desc: verify the function of getUid({})promise - */ - it('ACTS_SetWantInfo_3300', 0, async function (done) { - wantAgent.getUid({}).then((error, data)=>{ - if(error.code) { - expect(error.code).assertEqual(-1) - } - }) - done() - }) - - /* - * @tc.number: ACTS_SetWantInfo_3400 - * @tc.name: getWant() - * @tc.desc: verify the function of getWant({})callback - */ - it('ACTS_SetWantInfo_3400', 0, async function (done) { - wantAgent.getWant({},(err,data) => { - console.info('----getWante success!----'+err.code+data); - }); - done() - }) - - /* - * @tc.number: ACTS_SetWantInfo_3500 - * @tc.name: getWant() - * @tc.desc: verify the function of getWant({})promise - */ - it('ACTS_SetWantInfo_3500', 0, async function (done) { - wantAgent.getWant({}).then((error, data)=>{ - if(error.code) { - expect(error.code).assertEqual(-1) - } - }) - done() - }) - - /* - * @tc.number: ACTS_SetWantInfo_3600 - * @tc.name: cancel() - * @tc.desc: verify the function of cancel({})callback - */ - it('ACTS_SetWantInfo_3600', 0, async function (done) { - wantAgent.cancel({},(err,data) => { - console.info('----cancela success!----'+err.code+data); - }); - done() - }) - - /* - * @tc.number: ACTS_SetWantInfo_3700 - * @tc.name: cancel() - * @tc.desc: verify the function of cancel({})promise - */ - it('ACTS_SetWantInfo_3700', 0, async function (done) { - wantAgent.cancel({}).then((error, data)=>{ - if(error.code) { - expect(error.code).assertEqual(-1) - } - }) - done() - }) - - /* - * @tc.number: ACTS_SetWantInfo_3800 - * @tc.name: cancel() - * @tc.desc: verify the function of cancel(100)callback - */ - it('ACTS_SetWantInfo_3800', 0, async function (done) { - wantAgent.cancel(100,(err) => { - console.info('----cancelc success!----'+err.code); - }); - done() - }) - - /* - * @tc.number: ACTS_SetWantInfo_3900 - * @tc.name: cancel() - * @tc.desc: verify the function of cancel(100)promise - */ - it('ACTS_SetWantInfo_3900', 0, async function (done) { - wantAgent.cancel(100).then((error, data)=>{ - if(error.code) { - expect(error.code).assertEqual(-1) - } - }) - done() - }) - - /* - * @tc.number: ACTS_SetWantInfo_4000 - * @tc.name: getWant() - * @tc.desc: verify the function of cancel("")callback - */ - it('ACTS_SetWantInfo_4000', 0, async function (done) { - wantAgent.cancel("",(err) => { - console.info('----cancele success!----'+err.code); - }); - done() - }) - - /* - * @tc.number: ACTS_SetWantInfo_4100 - * @tc.name: cancel() - * @tc.desc: verify the function of cancel("")promise - */ - it('ACTS_SetWantInfo_4100', 0, async function (done) { - wantAgent.cancel("").then((error, data)=>{ - if(error.code) { - expect(error.code).assertEqual(-1) - } - }) - done() - }) - - /* - * @tc.number: ACTS_SetWantInfo_4200 - * @tc.name: cancel() - * @tc.desc: verify the function of cancel("%^%^%^")callback - */ - it('ACTS_SetWantInfo_4200', 0, async function (done) { - wantAgent.cancel("%^%^%^",(err) => { - console.info('----cancelg success!----'+err.code); - }); - done() - }) - - /* - * @tc.number: ACTS_SetWantInfo_4300 - * @tc.name: cancel() - * @tc.desc: verify the function of cancel("%^%^%^")promise - */ - it('ACTS_SetWantInfo_4300', 0, async function (done) { - wantAgent.cancel("%^%^%^").then((error, data)=>{ - if(error.code) { - expect(error.code).assertEqual(-1) - } - }) - done() - }) -}) - - -} diff --git a/notification/ans_standard/publish_test/getwantagentinfo/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/getwantagentinfo/src/main/resources/base/element/string.json deleted file mode 100644 index a39207ead4b88047d694c44847f2476d27c358d4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/getwantagentinfo/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "AgentInfo" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/getwantagentinfo/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/getwantagentinfo/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/getwantagentinfo/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/publish/BUILD.gn b/notification/ans_standard/publish_test/publish/BUILD.gn deleted file mode 100644 index 8efa587562507a09d7949e1ef0a85354dd4dd3bb..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publish/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsNotificationPublishXts") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsNotificationPublishTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/publish/Test.json b/notification/ans_standard/publish_test/publish/Test.json deleted file mode 100644 index a1121d5e661637c27ce941a2f1f206083c1615bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publish/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "shell-timeout": "180000", - "bundle-name": "com.example.actsanspublishtest", - "package-name": "com.example.actsanspublishtest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsNotificationPublishTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publish/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/publish/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/publish/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/publish/src/main/config.json b/notification/ans_standard/publish_test/publish/src/main/config.json deleted file mode 100644 index 8d951bae417945e2888194944a269dd43a863f0a..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publish/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanspublishtest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanspublishtest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publish/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/publish/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publish/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/publish/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/publish/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publish/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publish/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/publish/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publish/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publish/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/publish/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publish/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/publish/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/publish/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 6d94c7966669bab00cdd140fe2a72e0a0c2c4be8..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publish/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - Publishing ICON Notifiction - -
diff --git a/notification/ans_standard/publish_test/publish/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/publish/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publish/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/publish/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/publish/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publish/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/publish/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/publish/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publish/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publish/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/publish/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publish/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publish/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/publish/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publish/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publish/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/publish/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publish/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/publish/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/publish/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publish/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/publish/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/publish/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publish/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/publish/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/publish/src/main/js/test/List.test.js deleted file mode 100644 index 39c51da6d6061193e1c019823eed8f7fd956f22a..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publish/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsNotificationPublishXts from './publish.js' -export default function testsuite() { -ActsAnsNotificationPublishXts() -} diff --git a/notification/ans_standard/publish_test/publish/src/main/js/test/publish.js b/notification/ans_standard/publish_test/publish/src/main/js/test/publish.js deleted file mode 100644 index ecb31758c4c2d685ce3b45032cd632b349c1dc57..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publish/src/main/js/test/publish.js +++ /dev/null @@ -1,2394 +0,0 @@ -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ - -import notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -var timeout = 1000; -export default function ActsAnsNotificationPublishXts() { -describe('ActsAnsNotificationPublishXts', function () { - console.info("===========ActsAnsNotificationPublish start====================>"); - function onConsumeA(data) { - console.info("===ACTS_PublishMULTILINEContent_0100 onConsume start===>"); - console.info("===ACTS_PublishMULTILINEContent_0100 onConsume data:===>" + JSON.stringify(data)); - expect(data.request.label).assertEqual("ACTS_PublishMULTILINEContent_0100"); - expect(data.request.creatorUserId).assertEqual(100); - console.info("===ACTS_PublishMULTILINEContent_0100 onConsume end===>"); - } - - /* - * @tc.number: ACTS_PublishMULTILINEContent_xts_0100 - * @tc.name: function publish(request: NotificationRequest, callback: AsyncCallback): void; - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_MULTILINE) - */ - it('ACTS_PublishMULTILINEContent_xts_0100', 0, async function (done) { - console.info("===ACTS_PublishMULTILINEContent_0100 start===>"); - var subscriber ={ - onConsume:onConsumeA - } - await notify.subscribe(subscriber); - console.info("===========ACTS_PublishMULTILINEContent_0100 subscribe promise=======>"); - var notificationRequest = { - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_MULTILINE, - multiLine: { - title: "test1_title", - text: "test1_text", - additionalText: "test1_additionalText", - briefText: "briefText1", - longTitle: "longTitle1", - lines: ["thrive", "democracy", "civilization", "harmonious"] - }, - }, - id: 1, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_PublishMULTILINEContent_0100", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest,(err)=>{ - console.info("===ACTS_PublishMULTILINEContent_0100 err===>"+err.code); - }); - setTimeout((async function(){ - console.info("===ACTS_PublishMULTILINEContent_0100 setTimeout===>"); - await notify.unsubscribe(subscriber); - console.info("===ACTS_PublishMULTILINEContent_0100 setTimeout unsubscribe===>"); - done(); - }),timeout); - }) - - function onConsumeB(data) { - console.info("===ACTS_PublishMULTILINEContent_0200 onConsume start===>"); - console.info("===ACTS_PublishMULTILINEContent_0200 onConsume data:===>" + JSON.stringify(data)); - console.info("===ACTS_PublishMULTILINEContent_0200 onConsume end===>"); - } - - /* - * @tc.number: ACTS_PublishMULTILINEContent_xts_0200 - * @tc.name: function publish(request: NotificationRequest, callback: AsyncCallback): void; - * @tc.desc: verify the function of publish() - */ - it('ACTS_PublishMULTILINEContent_xts_0200', 0, async function (done) { - console.info("===ACTS_PublishMULTILINEContent_0200 start===>"); - var subscriber ={ - onConsume:onConsumeB - } - await notify.subscribe(subscriber); - console.info("===ACTS_PublishMULTILINEContent_0200 subscribe promise===>"); - var notificationRequest = { - content:{ -// contentType: notify.ContentType.NOTIFICATION_CONTENT_MULTILINE, - multiLine: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - briefText: "briefText", - longTitle: "longTitle", - lines: ["thrive", "democracy", "civilization", "harmonious"] - }, - }, - id: 2, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_PublishMULTILINEContent_0200", - badgeIconStyle: 1, - showDeliveryTime: true, - } - try { - await notify.publish(notificationRequest, (err) => { - console.info("===ACTS_PublishMULTILINEContent_0200 err===>" + err.code); - }); - }catch(err){ - console.info("===ACTS_PublishMULTILINEContent_0200 err===>" + err.code); - } - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("===ACTS_PublishMULTILINEContent_0200 setTimeout unsubscribe end===>"); - done(); - }),timeout); - }) - - function onConsumeC(data) { - console.info("===ANS_Publish_0300 onConsume start===>"); - console.info("===ANS_Publish_0300 onConsume data:===>" + JSON.stringify(data)); - console.info("===ANS_Publish_0300 onConsume end===>"); - } - - /* - * @tc.number: ACTS_PublishMULTILINEContent_xts_0300 - * @tc.name: function publish(request: NotificationRequest, callback: AsyncCallback): void; - * @tc.desc: verify the function of publish() - */ - it('ACTS_PublishMULTILINEContent_xts_0300', 0, async function (done) { - console.info("===============ACTS_PublishMULTILINEContent_0300 start==========================>"); - var subscriber ={ - onConsume:onConsumeC - } - await notify.subscribe(subscriber); - console.info("===============ACTS_PublishMULTILINEContent_0300 subscribe promise===============>"); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_PICTURE, - multiLine: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - briefText: "briefText", - longTitle: "longTitle", - lines: ["thrive", "democracy", "civilization", "harmonious"] - }, - }, - id: 3, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_PublishMULTILINEContent_0300", - badgeIconStyle: 1, - showDeliveryTime: true, - } - try { - await notify.publish(notificationRequest, (err) => { - console.info("==========ACTS_PublishMULTILINEContent_0300 err==================>" + err.code); - }); - }catch(err){ - console.info("==========ACTS_PublishMULTILINEContent_0300 err==================>" + err.code); - } - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishMULTILINEContent_0300 setTimeout unsubscribe end==================>"); - done(); - }),timeout); - }) - - function onConsumeD(data) { - console.info("===ACTS_PublishMULTILINEContent_0400 onConsume===>"); - console.info("===ACTS_PublishMULTILINEContent_0400 onConsume data:===>" + JSON.stringify(data)); - expect(data.request.label).assertEqual("ACTS_PublishMULTILINEContent_0400"); - console.info("===ACTS_PublishMULTILINEContent_0400 onConsume end===>"); - } - - /* - * @tc.number: ACTS_PublishMULTILINEContent_xts_0400 - * @tc.name: function publish(request: NotificationRequest): Promise; - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_MULTILINE) promise - */ - it('ACTS_PublishMULTILINEContent_xts_0400', 0, async function (done) { - console.info("===============ACTS_PublishMULTILINEContent_0400 start==========================>"); - var subscriber ={ - onConsume:onConsumeD - } - await notify.subscribe(subscriber); - console.info("================ACTS_PublishMULTILINEContent_0400 subscribe promise=============>"); - var notificationRequest = { - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_MULTILINE, - multiLine: { - title: "test4_title", - text: "test4_text", - additionalText: "test4_additionalText", - briefText: "briefText4", - longTitle: "longTitle4", - lines: ["thrive", "democracy", "civilization", "harmonious"] - }, - }, - id: 4, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_PublishMULTILINEContent_0400", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(console.info("======ACTS_PublishMULTILINEContent_0400 promise==================>")); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishMULTILINEContent_0400 setTimeout unsubscribe end==================>"); - done(); - }),timeout); - - }) - - function onConsumeE(data) { - console.info("===ACTS_PublishMULTILINEContent_0500 onConsume start===>"); - console.info("===ACTS_PublishMULTILINEContent_0500 onConsume data:===>" + JSON.stringify(data)); - console.info("===ACTS_PublishMULTILINEContent_0500 onConsume end===>"); - } - - /* - * @tc.number: ACTS_PublishMULTILINEContent_xts_0500 - * @tc.name: function publish(request: NotificationRequest): Promise; - * @tc.desc: function publish(request: NotificationRequest): Promise; - */ - it('ACTS_PublishMULTILINEContent_xts_0500', 0, async function (done) { - console.info("============ACTS_PublishMULTILINEContent_0500 start==================>"); - var subscriber ={ - onConsume:onConsumeE - } - await notify.subscribe(subscriber); - console.info("============ACTS_PublishMULTILINEContent_0500 subscribe promise======>"); - var notificationRequest = { - content: { -// contentType: notify.ContentType.NOTIFICATION_CONTENT_MULTILINE, - multiLine: { - title: "test5_title", - text: "test5_text", - additionalText: "test5_additionalText", - briefText: "briefText5", - longTitle: "longTitle5", - lines: ["thrive", "democracy", "civilization", "harmonious"] - }, - }, - id: 5, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_PublishMULTILINEContent_0500", - badgeIconStyle: 1, - showDeliveryTime: true, - } - try{ - await notify.publish(notificationRequest) - }catch(err){ - console.info("======ACTS_PublishMULTILINEContent_0500 err==================>"+err.code); - } - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishMULTILINEContent_0500 setTimeout unsubscribe end==================>"); - done(); - }),timeout); - }) - - function onConsumeF(data) { - console.info("===ACTS_PublishMULTILINEContent_0600 onConsume start===>"); - console.info("===ACTS_PublishMULTILINEContent_0600 onConsume data===>" + JSON.stringify(data)); - console.info("===ACTS_PublishMULTILINEContent_0600 onConsume end===>"); - } - - /* - * @tc.number: ACTS_PublishMULTILINEContent_xts_0600 - * @tc.name: cancelAll(): Promise; - * @tc.desc: Verify that all notifications are cancelled successfully by calling the - cancelAll(): Promise interface, and then cancel the notification again - */ - it('ACTS_PublishMULTILINEContent_xts_0600', 0, async function (done) { - console.info("===============ACTS_PublishMULTILINEContent_0600 start==========================>"); - var subscriber ={ - onConsume:onConsumeF - } - await notify.subscribe(subscriber); - console.info("==================ACTS_PublishMULTILINEContent_0600 subscribe promise==================>"); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_PICTURE, - multiLine: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - briefText: "briefText", - longTitle: "longTitle", - lines: ["thrive", "democracy", "civilization", "harmonious"] - }, - }, - id: 6, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_PublishMULTILINEContent_0600", - badgeIconStyle: 1, - showDeliveryTime: true, - } - try { - await notify.publish(notificationRequest); - }catch(err){ - console.info("==================ACTS_PublishMULTILINEContent_0600 err==================>"+err.code); - } - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishMULTILINEContent_0600 setTimeout unsubscribe end==================>"); - done(); - }),timeout); - }) - - function onConsumeG(data) { - console.info("===ACTS_PublishLONGContent_0100 onConsume start===>"); - console.info("===ACTS_PublishLONGContent_0100 onConsume data: ===>" + JSON.stringify(data)); - expect(data.request.label).assertEqual("ACTS_PublishLONGContent_0100"); - console.info("===ACTS_PublishLONGContent_0100 onConsume end===>"); - } - - /* - * @tc.number: ACTS_PublishLONGContent_xts_0100 - * @tc.name: function publish(request: NotificationRequest, callback: AsyncCallback): void; - * @tc.desc: function publish(request: NotificationRequest, callback: AsyncCallback): void; - */ - it('ACTS_PublishLONGContent_xts_0100', 0, async function (done) { - console.info("===============ACTS_PublishLONGContent_0100 start==========================>"); - var subscriber ={ - onConsume:onConsumeG - } - await notify.subscribe(subscriber); - console.info("========ACTS_PublishLONGContent_0100 subscribe promise==================>"); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, - longText: { - title: "test7_title", - text: "test7_text", - additionalText: "test7_additionalText", - longText:"longText7", - briefText:"briefText7", - expandedTitle:"expandedTitle7" - }, - }, - id: 7, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : true, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_PublishLONGContent_0100", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest,(err)=>{ - console.info("===========ACTS_PublishLONGContent_0100 err==================>"+err.code); - }); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishLONGContent_0100 setTimeout unsubscribe end==================>"); - done(); - }),timeout); - }) - - function onConsumeH(data) { - console.info("===ACTS_PublishLONGContent_0200 onConsume start===>"); - console.info("===ACTS_PublishLONGContent_0200 onConsume data:===>" + JSON.stringify(data)); - console.info("===ACTS_PublishLONGContent_0200 onConsume end===>"); - } - - /* - * @tc.number: ACTS_PublishLONGContent_xts_0200 - * @tc.name: function publish(request: NotificationRequest, callback: AsyncCallback): void; - * @tc.desc: function publish(request: NotificationRequest, callback: AsyncCallback): void; - */ - it('ACTS_PublishLONGContent_xts_0200', 0, async function (done) { - console.info("===============ACTS_PublishLONGContent_0200 start==========================>"); - var subscriber ={ - onConsume:onConsumeH - } - await notify.subscribe(subscriber); - console.info("==================ACTS_PublishLONGContent_0200 subscribe promise==================>"); - var notificationRequest = { - content:{ -// contentType: notify.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, - longText: { - title: "test8_title", - text: "test8_text", - additionalText: "test8_additionalText", - longText:"longText8", - briefText:"briefText8", - expandedTitle:"expandedTitle8" - }, - }, - id: 8, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : true, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_PublishLONGContent_0200", - badgeIconStyle: 1, - showDeliveryTime: true, - } - try{ - await notify.publish(notificationRequest,(err)=>{ - console.info("=========ACTS_PublishLONGContent_0200 err==================>"+err.code); - }); - }catch(err){ - console.info("=========ACTS_PublishLONGContent_0200 err==================>"+err.code); - } - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishLONGContent_0200 setTimeout unsubscribe end==================>"); - done(); - }),timeout); - }) - - function onConsumeI(data) { - console.info("===ACTS_PublishLONGContent_0300 onConsume start===>"); - console.info("===ACTS_PublishLONGContent_0300 onConsume data:===>" + JSON.stringify(data)); - console.info("===ACTS_PublishLONGContent_0300 onConsume end===>"); - } - - /* - * @tc.number: ACTS_PublishLONGContent_xts_0300 - * @tc.name: function publish(request: NotificationRequest, callback: AsyncCallback): void; - * @tc.desc: function publish(request: NotificationRequest, callback: AsyncCallback): void; - */ - it('ACTS_PublishLONGContent_xts_0300', 0, async function (done) { - console.info("===============ACTS_PublishLONGContent_0300 start==========================>"); - var subscriber ={ - onConsume:onConsumeI - } - await notify.subscribe(subscriber); - console.info("==================ACTS_PublishLONGContent_0300 subscribe promise==================>"); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_MEDIA, - longText: { - title: "test9_title", - text: "test9_text", - additionalText: "test9_additionalText", - longText:"longText9", - briefText:"briefText9", - expandedTitle:"expandedTitle9" - }, - }, - id: 9, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : true, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_PublishLONGContent_0300", - badgeIconStyle: 1, - showDeliveryTime: true, - } - try { - await notify.publish(notificationRequest,(err)=>{ - console.info("==================ACTS_PublishLONGContent_0300 err==================>"+err.code); - }); - }catch(err){ - console.info("==================ACTS_PublishLONGContent_0300 err==================>"+err.code); - } - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishLONGContent_0300 setTimeout unsubscribe end==================>"); - done(); - }),timeout); - }) - - function onConsumeJ(data) { - console.info("===ACTS_PublishLONGContent_0400 onConsume start===>"); - console.info("===ACTS_PublishLONGContent_0400 onConsume data:===>" + JSON.stringify(data)); - expect(data.request.label).assertEqual("ACTS_PublishLONGContent_0400"); - console.info("===ACTS_PublishLONGContent_0400 onConsume end===>"); - } - - /* - * @tc.number: ACTS_PublishLONGContent_xts_0400 - * @tc.name: cancel(id: number, callback: AsyncCallback): void; - * @tc.desc: Verify that when the cancel(id: number, callback: AsyncCallback): void - interface is called, when the id is wrong, no notification information is cancelled at this time - */ - it('ACTS_PublishLONGContent_xts_0400', 0, async function (done) { - console.info("===============ACTS_PublishLONGContent_0400 start==========================>"); - var subscriber ={ - onConsume:onConsumeJ - } - await notify.subscribe(subscriber); - console.info("================ACTS_PublishLONGContent_0400 subscribe promise==================>"); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, - longText: { - title: "test10_title", - text: "test10_text", - additionalText: "test10_additionalText", - longText:"longText10", - briefText:"briefText10", - expandedTitle:"expandedTitle10" - }, - }, - id: 10, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : true, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_PublishLONGContent_0400", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("===========ACTS_PublishLONGContent_0400 publish promise==================>"); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishLONGContent_0400 setTimeout unsubscribe end==================>"); - done(); - }),timeout); - }) - - function onConsumeK(data) { - console.info("===ACTS_PublishLONGContent_0500 onConsume start===>"); - console.info("===ACTS_PublishLONGContent_0500 onConsume data:===>" + JSON.stringify(data)); - console.info("===ACTS_PublishLONGContent_0500 onConsume end===>"); - } - - /* - * @tc.number: ACTS_PublishLONGContent_xts_0500 - * @tc.name: cancel(id: number, callback: AsyncCallback): void; - * @tc.desc: Verify the success of canceling the notification with the notification attribute isUnremovable - being true by calling the cancel(id: number, callback: AsyncCallback): void interface - */ - it('ACTS_PublishLONGContent_xts_0500', 0, async function (done) { - console.info("===============ACTS_PublishLONGContent_0500 start==========================>"); - var subscriber ={ - onConsume:onConsumeK - } - await notify.subscribe(subscriber); - console.info("===============ACTS_PublishLONGContent_0500 subscribe promise=============>"); - var notificationRequest = { - content:{ -// contentType: notify.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, - longText: { - title: "test11_title", - text: "test11_text", - additionalText: "test11_additionalText", - longText:"longText11", - briefText:"briefText11", - expandedTitle:"expandedTitle11" - }, - }, - id: 11, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : true, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_PublishLONGContent_0500", - badgeIconStyle: 1, - showDeliveryTime: true, - } - try { - await notify.publish(notificationRequest); - }catch(err){ - console.info("============ACTS_PublishLONGContent_0500 err===========>"+err.code); - } - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishLONGContent_0500 setTimeout unsubscribe end==================>"); - done(); - }),timeout); - }) - - function onConsumeL(data) { - console.info("===ACTS_PublishLONGContent_0600 onConsume start===>"); - console.info("===ACTS_PublishLONGContent_0600 onConsume data:===>" + JSON.stringify(data)); - console.info("===ACTS_PublishLONGContent_0600 onConsume end===>"); - } - - /* - * @tc.number: ACTS_PublishLONGContent_xts_0600 - * @tc.name: cancel(id: number, callback: AsyncCallback): void; - * @tc.desc: Verify that the cancel(id: number, callback: AsyncCallback): void - interface is called twice in a row to cancel the notification - */ - it('ACTS_PublishLONGContent_xts_0600', 0, async function (done) { - console.info("=============ACTS_PublishLONGContent_0600 start==========================>"); - var subscriber ={ - onConsume:onConsumeL - } - await notify.subscribe(subscriber); - console.info("=============ACTS_PublishLONGContent_0600 subscribe promise==================>"); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_MEDIA, - longText: { - title: "test12_title", - text: "test12_text", - additionalText: "test12_additionalText", - longText:"longText12", - briefText:"briefText12", - expandedTitle:"expandedTitle12" - }, - }, - id: 12, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : true, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_PublishLONGContent_0600", - badgeIconStyle: 1, - showDeliveryTime: true, - } - try { - await notify.publish(notificationRequest); - }catch(err){ - console.info("========ACTS_PublishLONGContent_0600 err=================>"+err.code); - } - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishLONGContent_0600 setTimeout unsubscribe end==================>"); - done(); - }),1500); - }) - - function onConsumeM(data) { - console.info("===ANS_Cancel_1300 onConsume start===>"); - console.info("===ANS_Cancel_1300 onConsume data:===>" + JSON.stringify(data)); - expect(data.request.label).assertEqual("ACTS_Publish_SlotTypeContent_0100"); - console.info("===ANS_Cancel_1300 onConsume end===>"); - } - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_xts_0100 - * @tc.name: cancel(id: number, label: string, callback: AsyncCallback): void; - * @tc.desc: Verify that the cancel notification is successful by calling the - cancel(id: number, label: string, callback: AsyncCallback): void; interface - */ - it('ACTS_Publish_SlotTypeContent_xts_0100', 0, async function (done) { - console.info("===ACTS_Publish_SlotTypeContent_0100 start===>"); - var subscriber ={ - onConsume:onConsumeM - } - await notify.subscribe(subscriber); - console.info("===ACTS_Publish_SlotTypeContent_0100 subscribe promise===>"); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 13, - slotType : notify.SlotType.CONTENT_INFORMATION, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_Publish_SlotTypeContent_0100", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest,(err)=>{ - console.info("===ACTS_Publish_SlotTypeContent_0100 err===>"+err.code); - }); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("===ACTS_Publish_SlotTypeContent_0100 setTimeout unsubscribe end===>"); - done(); - }),timeout); - }) - - function onConsumeN(data) { - console.info("===ACTS_Publish_SlotTypeContent_0200 onConsume start===>"); - console.info("===ACTS_Publish_SlotTypeContent_0200 onConsume data:===>" + JSON.stringify(data)); - console.info("===ACTS_Publish_SlotTypeContent_0200 onConsume end===>"); - } - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_xts_0200 - * @tc.name: cancel(id: number, label?: string): Promise - * @tc.desc: Verify that the cancel notification is successful by calling the - cancel(id: number, label?: string): Promise interface - */ - it('ACTS_Publish_SlotTypeContent_xts_0200', 0, async function (done) { - console.info("===============ACTS_Publish_SlotTypeContent_0200 start==========================>"); - var subscriber ={ - onConsume:onConsumeN - } - await notify.subscribe(subscriber); - console.info("==========ACTS_Publish_SlotTypeContent_0200 subscribe promise==================>"); - var notificationRequest = { - content:{ -// contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 14, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_Publish_SlotTypeContent_0200", - badgeIconStyle: 1, - showDeliveryTime: true, - } - try { - await notify.publish(notificationRequest,(err)=>{ - console.info("===============ACTS_Publish_SlotTypeContent_0200 err==============>"+err.code); - }); - }catch(err){ - console.info("===============ACTS_Publish_SlotTypeContent_0200 err==============>"+err.code); - } - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_Publish_SlotTypeContent_0200 setTimeout unsubscribe end==================>"); - done(); - }),timeout); - }) - - function onConsumeO(data) { - console.info("===ACTS_Publish_SlotTypeContent_0300 onConsume start===>"); - console.info("===ACTS_Publish_SlotTypeContent_0300 onConsume data:===>" + JSON.stringify(data)); - console.info("===ACTS_Publish_SlotTypeContent_0300 onConsume end===>"); - } - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_xts_0300 - * @tc.name: cancel(id: number, label: string, callback: AsyncCallback): void - * @tc.desc: Verify that the notification whose notification property isUnremovable is true is canceled - successfully by calling the cancel(id: number, label: string, callback: AsyncCallback): void interface - */ - it('ACTS_Publish_SlotTypeContent_xts_0300', 0, async function (done) { - console.info("===============ACTS_Publish_SlotTypeContent_0300 start==========================>"); - var subscriber ={ - onConsume:onConsumeO - } - await notify.subscribe(subscriber); - console.info("=======ACTS_Publish_SlotTypeContent_0300 subscribe promise==================>"); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 15, - isOngoing : true, - isUnremovable : true, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_Publish_SlotTypeContent_0300", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest,(err)=>{ - console.info("===========ACTS_Publish_SlotTypeContent_0300 publish promise=============>"+err.code); - }); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_Publish_SlotTypeContent_0300 setTimeout unsubscribe end==================>"); - done(); - }),timeout); - }) - - function onConsumeP(data) { - console.info("===ACTS_Publish_SlotTypeContent_0400 onConsume start===>"); - console.info("===ACTS_Publish_SlotTypeContent_0400 onConsume data:===>" + JSON.stringify(data)); - expect(data.request.label).assertEqual("ACTS_Publish_SlotTypeContent_0400"); - console.info("===ACTS_Publish_SlotTypeContent_0400 onConsume end===>"); - } - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_xts_0400 - * @tc.name: cancel(id: number, label?: string): Promise - * @tc.desc: Verify that the notification whose notification property isUnremovable is true - is canceled successfully by calling the cancel(id: number, label?: string): Promise interface - */ - it('ACTS_Publish_SlotTypeContent_xts_0400', 0, async function (done) { - console.info("===ACTS_Publish_SlotTypeContent_0400 start===>"); - var subscriber ={ - onConsume:onConsumeP - } - await notify.subscribe(subscriber); - console.info("===ACTS_Publish_SlotTypeContent_0400 subscribe promise===>"); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 16, - slotType : notify.SlotType.SERVICE_INFORMATION, - isOngoing : true, - isUnremovable : true, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_Publish_SlotTypeContent_0400", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest,(err)=>{ - console.info("===ACTS_Publish_SlotTypeContent_0400 err===>"+err.code); - }); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("===ACTS_Publish_SlotTypeContent_0400 setTimeout unsubscribe end===>"); - done(); - }),timeout); - }) - - function onConsumeQ(data) { - console.info("===ACTS_Publish_SlotTypeContent_0500 onConsume start===>"); - console.info("===ACTS_Publish_SlotTypeContent_0500 onConsume data:===>" + JSON.stringify(data)); - expect(data.request.label).assertEqual("ACTS_Publish_SlotTypeContent_0500"); - console.info("===ACTS_Publish_SlotTypeContent_0500 onConsume end===>"); - } - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_xts_0500 - * @tc.name: cancel(id: number, label: string, callback: AsyncCallback): void; - * @tc.desc: Verify that the cancel(id: number, label: string, callback: AsyncCallback): void - interface is called, the label is wrong and the ID is correct. - */ - it('ACTS_Publish_SlotTypeContent_xts_0500', 0, async function (done) { - console.info("===============ACTS_Publish_SlotTypeContent_0500 start==========================>"); - var subscriber ={ - onConsume:onConsumeQ - } - await notify.subscribe(subscriber); - console.info("==============ACTS_Publish_SlotTypeContent_0500 subscribe promise==================>"); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 17, - slotType : notify.SlotType.CONTENT_INFORMATION, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_Publish_SlotTypeContent_0500", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("==============ACTS_Publish_SlotTypeContent_0500 publish promise==================>"); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_Publish_SlotTypeContent_0500 setTimeout unsubscribe end==================>"); - done(); - }),timeout); - }) - - function onConsumeR(data) { - console.info("===ACTS_Publish_SlotTypeContent_0600 onConsume start===>"); - console.info("===ACTS_Publish_SlotTypeContent_0600 onConsume data:===>" + JSON.stringify(data)); - console.info("===ACTS_Publish_SlotTypeContent_0600 onConsume end===>"); - } - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_xts_0600 - * @tc.name: cancel(id: number, label?: string): Promise - * @tc.desc: Verify that the cancel(id: number, label?: string): Promise interface is called, - the label is wrong and the ID is correct. - */ - it('ACTS_Publish_SlotTypeContent_xts_0600', 0, async function (done) { - console.info("===============ACTS_Publish_SlotTypeContent_0600 start==========================>"); - var subscriber ={ - onConsume:onConsumeR - } - await notify.subscribe(subscriber); - console.info("==============ACTS_Publish_SlotTypeContent_0600 subscribe promise==================>"); - var notificationRequest = { - content:{ -// contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 18, - slotType : notify.SlotType.CONTENT_INFORMATION, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_Publish_SlotTypeContent_0600", - badgeIconStyle: 1, - showDeliveryTime: true, - } - try { - await notify.publish(notificationRequest); - }catch(err){ - console.info("===ACTS_Publish_SlotTypeContent_0600 publish promise===>"+err.code); - } - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_Publish_SlotTypeContent_0600 setTimeout unsubscribe end===>"); - done(); - }),timeout); - }) - - function onConsumeS(data) { - console.info("===ACTS_Publish_SlotTypeContent_0700 onConsume start===>"); - console.info("===ACTS_Publish_SlotTypeContent_0700 onConsume data:===>" + JSON.stringify(data)); - expect(data.request.label).assertEqual("ACTS_Publish_SlotTypeContent_0700"); - console.info("===ACTS_Publish_SlotTypeContent_0700 onConsume end===>"); - } - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_xts_0700 - * @tc.name: cancel(id: number, label: string, callback: AsyncCallback): void; - * @tc.desc: Verify that the cancel(id: number, label: string, callback: AsyncCallback): void - interface is called, and the label uses empty characters - */ - it('ACTS_Publish_SlotTypeContent_xts_0700', 0, async function (done) { - console.info("===============ACTS_Publish_SlotTypeContent_0700 start==========================>"); - var subscriber ={ - onConsume:onConsumeS - } - await notify.subscribe(subscriber); - console.info("=============ACTS_Publish_SlotTypeContent_0700 subscribe promise==================>"); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 19, -// slotType : notify.SlotType.CONTENT_INFORMATION, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_Publish_SlotTypeContent_0700", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("==========ACTS_Publish_SlotTypeContent_0700 publish promise==============>"); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_Publish_SlotTypeContent_0700 setTimeout unsubscribe end==================>"); - done(); - }),timeout); - }) - - function onConsumeT(data) { - console.info("===ACTS_Publish_SlotTypeContent_0800 onConsume start===>"); - console.info("===ACTS_Publish_SlotTypeContent_0800 onConsume data:===>" + JSON.stringify(data)); - expect(data.request.label).assertEqual("ACTS_Publish_SlotTypeContent_0800"); - console.info("===ACTS_Publish_SlotTypeContent_0800 onConsume end===>"); - } - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_xts_0800 - * @tc.name: cancel(id: number, label?: string): Promise; - * @tc.desc: Verify that the cancel(id: number, label?: string): Promise interface is called, - and the label uses empty characters - */ - it('ACTS_Publish_SlotTypeContent_xts_0800', 0, async function (done) { - console.info("===============ACTS_Publish_SlotTypeContent_0800 start==========================>"); - var subscriber ={ - onConsume:onConsumeT - } - await notify.subscribe(subscriber); - console.info("=========ACTS_Publish_SlotTypeContent_0800 subscribe promise==================>"); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 20, - slotType : notify.SlotType.SERVICE_INFORMATION, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_Publish_SlotTypeContent_0800", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("============ACTS_Publish_SlotTypeContent_0800 publish promise===============>"); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_Publish_SlotTypeContent_0800 setTimeout unsubscribe end==================>"); - done(); - }),timeout); - }) - - function onConsumeU(data) { - console.info("===ACTS_PublishSlotTypeOther_0100 onConsume start===>"); - console.info("===ACTS_PublishSlotTypeOther_0100 onConsume data:===>" + JSON.stringify(data)); - expect(data.request.label).assertEqual("ACTS_PublishSlotTypeOther_0100"); - console.info("===ACTS_PublishSlotTypeOther_0100 onConsume end===>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeOther_xts_0100 - * @tc.name: cancel(id: number, label: string, callback: AsyncCallback): void; - * @tc.desc: Verify that the cancel notification is successful by calling the - cancel(id: number, label: string, callback: AsyncCallback): void; interface - */ - it('ACTS_PublishSlotTypeOther_xts_0100', 0, async function (done) { - console.info("===ACTS_PublishSlotTypeOther_0100 start===>"); - var subscriber ={ - onConsume:onConsumeU - } - await notify.subscribe(subscriber); - console.info("===ACTS_PublishSlotTypeOther_0100 subscribe promise===>"); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 13, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_PublishSlotTypeOther_0100", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest,(err)=>{ - console.info("===ACTS_PublishSlotTypeOther_0100 err===>"+err.code); - }); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("===ACTS_PublishSlotTypeOther_0100 setTimeout unsubscribe end===>"); - done(); - }),timeout); - }) - - function onConsumeV(data) { - console.info("===ACTS_PublishSlotTypeOther_0200 onConsume start===>"); - console.info("===ACTS_PublishSlotTypeOther_0200 onConsume data:===>" + JSON.stringify(data)); - console.info("===ACTS_PublishSlotTypeOther_0200 onConsume end===>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeOther_xts_0200 - * @tc.name: cancel(id: number, label?: string): Promise - * @tc.desc: Verify that the cancel notification is successful by calling the - cancel(id: number, label?: string): Promise interface - */ - it('ACTS_PublishSlotTypeOther_xts_0200', 0, async function (done) { - console.info("===============ACTS_PublishSlotTypeOther_0200 start==========================>"); - var subscriber ={ - onConsume:onConsumeV - } - await notify.subscribe(subscriber); - console.info("==========ACTS_PublishSlotTypeOther_0200 subscribe promise==================>"); - var notificationRequest = { - content:{ - // contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 14, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_PublishSlotTypeOther_0200", - badgeIconStyle: 1, - showDeliveryTime: true, - } - try { - await notify.publish(notificationRequest,(err)=>{ - console.info("===============ACTS_PublishSlotTypeOther_0200 err==============>"+err.code); - }); - }catch(err){ - console.info("===============ACTS_PublishSlotTypeOther_0200 err==============>"+err.code); - } - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeOther_0200 setTimeout unsubscribe end==================>"); - done(); - }),timeout); - }) - - function onConsumeW(data) { - console.info("===ACTS_PublishSlotTypeOther_0300 onConsume start===>"); - console.info("===ACTS_PublishSlotTypeOther_0300 onConsume data:===>" + JSON.stringify(data)); - console.info("===ACTS_PublishSlotTypeOther_0300 onConsume end===>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeOther_xts_0300 - * @tc.name: cancel(id: number, label: string, callback: AsyncCallback): void - * @tc.desc: Verify that the notification whose notification property isUnremovable is true is canceled - successfully by calling the cancel(id: number, label: string, callback: AsyncCallback): void interface - */ - it('ACTS_PublishSlotTypeOther_xts_0300', 0, async function (done) { - console.info("===============ACTS_PublishSlotTypeOther_0300 start==========================>"); - var subscriber ={ - onConsume:onConsumeW - } - await notify.subscribe(subscriber); - console.info("=======ACTS_PublishSlotTypeOther_0300 subscribe promise==================>"); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 15, - isOngoing : true, - isUnremovable : true, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_PublishSlotTypeOther_0300", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest,(err)=>{ - console.info("===========ACTS_PublishSlotTypeOther_0300 err=============>"+err.code); - }); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeOther_0300 setTimeout unsubscribe end==================>"); - done(); - }),timeout); - }) - - function onConsumeX(data) { - console.info("===ACTS_PublishSlotTypeOther_0400 onConsume start===>"); - console.info("===ACTS_PublishSlotTypeOther_0400 onConsume data:===>" + JSON.stringify(data)); - expect(data.request.label).assertEqual("ACTS_PublishSlotTypeOther_0400"); - console.info("===ACTS_PublishSlotTypeOther_0400 onConsume end===>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeOther_xts_0400 - * @tc.name: cancel(id: number, label?: string): Promise - * @tc.desc: Verify that the notification whose notification property isUnremovable is true - is canceled successfully by calling the cancel(id: number, label?: string): Promise interface - */ - it('ACTS_PublishSlotTypeOther_xts_0400', 0, async function (done) { - console.info("===ACTS_PublishSlotTypeOther_0400 start===>"); - var subscriber ={ - onConsume:onConsumeX - } - await notify.subscribe(subscriber); - console.info("===ACTS_PublishSlotTypeOther_0400 subscribe promise===>"); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 16, - slotType : notify.SlotType.SERVICE_INFORMATION, - isOngoing : true, - isUnremovable : true, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_PublishSlotTypeOther_0400", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest,(err)=>{ - console.info("===ACTS_PublishSlotTypeOther_0400 err===>"+err.code); - }); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("===ACTS_PublishSlotTypeOther_0400 setTimeout unsubscribe end===>"); - done(); - }),timeout); - }) - - function onConsumeY(data) { - console.info("===ACTS_PublishSlotTypeOther_0500 onConsume start===>"); - console.info("===ACTS_PublishSlotTypeOther_0500 onConsume data:===>" + JSON.stringify(data)); - expect(data.request.label).assertEqual("ACTS_PublishSlotTypeOther_0500"); - console.info("===ACTS_PublishSlotTypeOther_0500 onConsume end===>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeOther_xts_0500 - * @tc.name: cancel(id: number, label: string, callback: AsyncCallback): void; - * @tc.desc: Verify that the cancel(id: number, label: string, callback: AsyncCallback): void - interface is called, the label is wrong and the ID is correct. - */ - it('ACTS_PublishSlotTypeOther_xts_0500', 0, async function (done) { - console.info("===============ACTS_PublishSlotTypeOther_0500 start==========================>"); - var subscriber ={ - onConsume:onConsumeY - } - await notify.subscribe(subscriber); - console.info("==============ACTS_PublishSlotTypeOther_0500 subscribe promise==================>"); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 17, - slotType : notify.SlotType.CONTENT_INFORMATION, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_PublishSlotTypeOther_0500", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("==============ACTS_PublishSlotTypeOther_0500 publish promise==================>"); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeOther_0500 setTimeout unsubscribe end==================>"); - done(); - }),timeout); - }) - - function onConsumeZ(data) { - console.info("===ACTS_PublishSlotTypeOther_0600 onConsume start===>"); - console.info("===ACTS_PublishSlotTypeOther_0600 onConsume data:===>" + JSON.stringify(data)); - console.info("===ACTS_PublishSlotTypeOther_0600 onConsume end===>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeOther_xts_0600 - * @tc.name: cancel(id: number, label?: string): Promise - * @tc.desc: Verify that the cancel(id: number, label?: string): Promise interface is called, - the label is wrong and the ID is correct. - */ - it('ACTS_PublishSlotTypeOther_xts_0600', 0, async function (done) { - console.info("===============ACTS_PublishSlotTypeOther_0600 start==========================>"); - var subscriber ={ - onConsume:onConsumeZ - } - await notify.subscribe(subscriber); - console.info("==============ACTS_PublishSlotTypeOther_0600 subscribe promise==================>"); - var notificationRequest = { - content:{ - // contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 18, - slotType : notify.SlotType.CONTENT_INFORMATION, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_PublishSlotTypeOther_0600", - badgeIconStyle: 1, - showDeliveryTime: true, - } - try { - await notify.publish(notificationRequest); - }catch(err){ - console.info("===ACTS_PublishSlotTypeOther_0600 publish promise===>"+err.code); - } - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeOther_0600 setTimeout unsubscribe end===>"); - done(); - }),timeout); - }) - - function onConsumea(data) { - console.info("===ACTS_PublishSlotTypeOther_0700 onConsume start===>"); - console.info("===ACTS_PublishSlotTypeOther_0700 onConsume data:===>" + JSON.stringify(data)); - expect(data.request.label).assertEqual("ACTS_PublishSlotTypeOther_0700"); - console.info("===ACTS_PublishSlotTypeOther_0700 onConsume end===>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeOther_xts_0700 - * @tc.name: cancel(id: number, label: string, callback: AsyncCallback): void; - * @tc.desc: Verify that the cancel(id: number, label: string, callback: AsyncCallback): void - interface is called, and the label uses empty characters - */ - it('ACTS_PublishSlotTypeOther_xts_0700', 0, async function (done) { - console.info("===============ACTS_PublishSlotTypeOther_0700 start==========================>"); - var subscriber ={ - onConsume:onConsumea - } - await notify.subscribe(subscriber); - console.info("=============ACTS_PublishSlotTypeOther_0700 subscribe promise==================>"); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 19, - // slotType : notify.SlotType.CONTENT_INFORMATION, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_PublishSlotTypeOther_0700", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("==========ACTS_PublishSlotTypeOther_0700 publish promise==============>"); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeOther_0700 setTimeout unsubscribe end==================>"); - done(); - }),timeout); - }) - - function onConsumeb(data) { - console.info("===ACTS_PublishSlotTypeOther_0800 onConsume start===>"); - console.info("===ACTS_PublishSlotTypeOther_0800 onConsume data:===>" + JSON.stringify(data)); - expect(data.request.label).assertEqual("ACTS_PublishSlotTypeOther_0800"); - console.info("===ACTS_PublishSlotTypeOther_0800 onConsume end===>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeOther_xts_0800 - * @tc.name: cancel(id: number, label?: string): Promise; - * @tc.desc: Verify that the cancel(id: number, label?: string): Promise interface is called, - and the label uses empty characters - */ - it('ACTS_PublishSlotTypeOther_xts_0800', 0, async function (done) { - console.info("===============ACTS_PublishSlotTypeOther_0800 start==========================>"); - var subscriber ={ - onConsume:onConsumeb - } - await notify.subscribe(subscriber); - console.info("=========ACTS_PublishSlotTypeOther_0800 subscribe promise==================>"); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 20, - slotType : notify.SlotType.SERVICE_INFORMATION, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "ACTS_PublishSlotTypeOther_0800", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("============ACTS_PublishSlotTypeOther_0800 publish promise===============>"); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeOther_0800 setTimeout unsubscribe end==================>"); - done(); - }),timeout); - }) - function publishSlotSocialCallback001(error){ - console.log('=========ACTS_PublishSlotTypeSocial_0100 publish callback==========>'+JSON.stringify(error.code)); - } - function onConsume0100(data){ - console.info("===========ACTS_PublishSlotTypeSocial_0100 onConsume start===========>"); - console.info("===========ACTS_PublishSlotTypeSocial_0100 onConsume data:===========>" + JSON.stringify(data)); - expect(data.request.content.normal.title).assertEqual("test37_title"); - console.info("===========ACTS_PublishSlotTypeSocial_0100 onConsume end=============>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_xts_0100 - * @tc.name: publish() - * @tc.desc: verify publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SOCIAL_COMMUNICATION) - */ - it('ACTS_PublishSlotTypeSocial_xts_0100', 0,async function (done) { - console.info("===============ACTS_PublishSlotTypeSocial_0100================>"); - var subscriber ={ - onConsume:onConsume0100 - } - await notify.subscribe(subscriber); - console.info("===============ACTS_PublishSlotTypeSocial_0100 subscribe======>"); - await notify.publish({ - id: 37, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test37_title", - text: "test37_text", - additionalText: "test37_additionalText" - }, - slotType:notify.SlotType.SOCIAL_COMMUNICATION - } - },publishSlotSocialCallback001); - console.info("==========ACTS_PublishSlotTypeSocial_0100 publish======>"); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeSocial_0100 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function publishSlotSocialCallback002(error){ - console.log('=========ACTS_PublishSlotTypeSocial_0200 publish callback==========>'+JSON.stringify(error.code)); - } - - function onConsume0200(data){ - console.info("===========ACTS_PublishSlotTypeSocial_0200 onConsume start===========>"); - console.info("===========ACTS_PublishSlotTypeSocial_0200 onConsume data:===========>" + JSON.stringify(data)); - expect().assertFail(); - console.info("===========ACTS_PublishSlotTypeSocial_0200 onConsume end=============>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_xts_0200 - * @tc.name: publish() - * @tc.desc: verify the function of publish(slotType:SOCIAL_COMMUNICATION) - */ - it('ACTS_PublishSlotTypeSocial_xts_0200', 0,async function (done) { - console.info("===============ACTS_PublishSlotTypeSocial_0200================>"); - var subscriber ={ - onConsume:onConsume0200 - } - await notify.subscribe(subscriber); - try { - await notify.publish({ - id: 38, - content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - slotType: notify.SlotType.SOCIAL_COMMUNICATION - } - }, publishSlotSocialCallback002); - }catch(err){ - console.info("==========ACTS_PublishSlotTypeSocial_0200 publish======>"+err.code); - } - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeSocial_0200 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function publishSlotSocialCallback003(error){ - console.log('=========ACTS_PublishSlotTypeSocial_0300 publish callback==========>'+JSON.stringify(error.code)); - } - - function onConsume0300(data){ - console.info("===========ACTS_PublishSlotTypeSocial_0300 onConsume start===========>"); - console.info("===========ACTS_PublishSlotTypeSocial_0300 onConsume data:===========>" + JSON.stringify(data)); - expect(data.request.content.normal.title).assertEqual("test39_title"); - console.info("===========ACTS_PublishSlotTypeSocial_0300 onConsume end=============>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_xts_0300 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) - */ - it('ACTS_PublishSlotTypeSocial_xts_0300', 0,async function (done) { - console.info("===============ACTS_PublishSlotTypeSocial_0300================>"); - var subscriber ={ - onConsume:onConsume0300 - } - await notify.subscribe(subscriber); - await notify.publish({ - id: 39, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test39_title", - text: "test39_text", - additionalText: "test39_additionalText" - }, - // slotType:notification.SlotType.SOCIAL_COMMUNICATION - } - },publishSlotSocialCallback003); - console.info("==========ACTS_PublishSlotTypeSocial_0300 publish======>"); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeSocial_0300 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function publishSlotSocialCallback004(error){ - console.log('=========ACTS_PublishSlotTypeSocial_0400 publish callback==========>'+JSON.stringify(error.code)); - } - - function onConsume0400(data){ - console.info("===========ACTS_PublishSlotTypeSocial_0400 onConsume start===========>"); - console.info("===========ACTS_PublishSlotTypeSocial_0400 onConsume data:===========>" + JSON.stringify(data)); - expect(data.request.content.normal.title).assertEqual("test40_title"); - console.info("===========ACTS_PublishSlotTypeSocial_0400 onConsume end=============>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_xts_0400 - * @tc.name: publish() - * @tc.desc: verify the publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:CONTENT_INFORMATION) - */ - it('ACTS_PublishSlotTypeSocial_xts_0400', 0,async function (done) { - console.info("===============ACTS_PublishSlotTypeSocial_0400================>"); - var subscriber ={ - onConsume:onConsume0400 - } - await notify.subscribe(subscriber); - await notify.publish({ - id: 40, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test40_title", - text: "test40_text", - additionalText: "test40_additionalText" - }, - slotType:notify.SlotType.CONTENT_INFORMATION - } - },publishSlotSocialCallback004); - console.info("==========ACTS_PublishSlotTypeSocial_0400 publish======>"); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeSocial_0400 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume0500(data){ - console.info("===========ACTS_PublishSlotTypeSocial_0500 onConsume start===========>"); - console.info("===========ACTS_PublishSlotTypeSocial_0500 onConsume data:===========>" + JSON.stringify(data)); - expect(data.request.content.normal.title).assertEqual("test41_title"); - console.info("===========ACTS_PublishSlotTypeSocial_0500 onConsume end=============>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_xts_0500 - * @tc.name: publish() - * @tc.desc: verify publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SOCIAL_COMMUNICATION) promise - */ - it('ACTS_PublishSlotTypeSocial_xts_0500', 0,async function (done) { - console.info("===============ACTS_PublishSlotTypeSocial_0500================>"); - var subscriber ={ - onConsume:onConsume0500 - } - await notify.subscribe(subscriber); - notify.publish({ - id: 41, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test41_title", - text: "test41_text", - additionalText: "test41_additionalText" - }, - slotType:notify.SlotType.SOCIAL_COMMUNICATION - } - }).then(console.info("==========ACTS_PublishSlotTypeSocial_0500 publish then======>")); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeSocial_0500 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume0600(data){ - console.info("===========ACTS_PublishSlotTypeSocial_0600 onConsume start===========>"); - console.info("===========ACTS_PublishSlotTypeSocial_0600 onConsume data:===========>" + JSON.stringify(data)); - expect().assertFail(); - console.info("===========ACTS_PublishSlotTypeSocial_0600 onConsume end=============>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_xts_0600 - * @tc.name: publish() - * @tc.desc: verify the function of publish(slotType:SOCIAL_COMMUNICATION) promise - */ - it('ACTS_PublishSlotTypeSocial_xts_0600', 0,async function (done) { - console.info("===============ACTS_PublishSlotTypeSocial_0600================>"); - var subscriber ={ - onConsume:onConsume0600 - } - await notify.subscribe(subscriber); - try { - var promise = notify.publish({ - id: 42, - content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - slotType: notify.SlotType.SOCIAL_COMMUNICATION - } - }) - }catch(err){ - console.info("======ACTS_PublishSlotTypeSocial_0600 err===>"+err.code); - } - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeSocial_0600 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume0700(data){ - console.info("===========ACTS_PublishSlotTypeSocial_0700 onConsume start===========>"); - console.info("===========ACTS_PublishSlotTypeSocial_0700 onConsume data:===========>" + JSON.stringify(data)); - expect(data.request.content.normal.title).assertEqual("test43_title"); - console.info("===========ACTS_PublishSlotTypeSocial_0700 onConsume end=============>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_xts_0700 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) promise - */ - it('ACTS_PublishSlotTypeSocial_xts_0700', 0,async function (done) { - console.info("===============ACTS_PublishSlotTypeSocial_0700================>"); - var subscriber ={ - onConsume:onConsume0700 - } - await notify.subscribe(subscriber); - var notificationRequest = { - id: 43, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test43_title", - text: "test43_text", - additionalText: "test43_additionalText" - }, - //slotType:notification.SlotType.SOCIAL_COMMUNICATION - } - } - await notify.publish(notificationRequest); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeSocial_0700 setTimeout unsubscribe===>"); - done(); - }),timeout) - }); - - function onConsume0800(data){ - console.info("===========ACTS_PublishSlotTypeSocial_0800 onConsume start===========>"); - console.info("===========ACTS_PublishSlotTypeSocial_0800 onConsume data:===========>" + JSON.stringify(data)); - expect(data.request.content.normal.title).assertEqual("test44_title"); - console.info("===========ACTS_PublishSlotTypeSocial_0800 onConsume end=============>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_xts_0800 - * @tc.name: publish() - * @tc.desc: verify the publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:CONTENT_INFORMATION) promise - */ - it('ACTS_PublishSlotTypeSocial_xts_0800', 0,async function (done) { - console.info("===============ACTS_PublishSlotTypeSocial_0800================>"); - var subscriber ={ - onConsume:onConsume0800 - } - await notify.subscribe(subscriber); - await notify.publish({ - id: 44, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test44_title", - text: "test44_text", - additionalText: "test44_additionalText" - }, - slotType:notify.SlotType.CONTENT_INFORMATION - } - }) - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("===============ACTS_PublishSlotTypeSocial_0800 setTimeout unsubscribe================>"); - done(); - }),timeout) - }); - - function publishSlotServiceCallback001(error){ - console.log('=========ACTS_PublishSlotTypeSocial_0100 publish callback==========>'+JSON.stringify(error.code)); - } - function onConsume0900(data){ - console.info("===========ACTS_PublishSlotTypeSocial_0100 onConsume start===========>"); - console.info("===========ACTS_PublishSlotTypeSocial_0100 onConsume data:===========>" + JSON.stringify(data)); - expect(data.request.content.normal.title).assertEqual("test29_title"); - console.info("===========ACTS_PublishSlotTypeSocial_0100 onConsume end=============>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeService_xts_0100 - * @tc.name: publish() - * @tc.desc: verify the publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SERVICE_INFORMATION) - */ - it('ACTS_PublishSlotTypeService_xts_0100', 0,async function (done) { - console.info("===============ACTS_PublishSlotTypeService_0100================>"); - var subscriber ={ - onConsume:onConsume0900 - } - await notify.subscribe(subscriber); - console.info("===============ACTS_PublishSlotTypeService_0100 subscribe======>"); - await notify.publish({ - id:29, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test29_title", - text: "test29_text", - additionalText: "test29_additionalText" - }, - }, - slotType:notify.SlotType.SERVICE_INFORMATION - },publishSlotServiceCallback001); - console.info("==========ACTS_PublishSlotTypeService_0100 publish======>"); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeService_0100 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function publishSlotServiceCallback002(error){ - console.log('========ACTS_PublishSlotTypeService_0200 publish callback========>'+JSON.stringify(error.code)); - } - function onConsume1000(data){ - console.info("=======ACTS_PublishSlotTypeService_0200 onConsume start=========>"); - console.info("===========ACTS_PublishSlotTypeService_0200 onConsume data:=========>" + JSON.stringify(data)); - expect().assertFail(); - console.info("===========ACTS_PublishSlotTypeService_0200 onConsume end===========>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeService_xts_0200 - * @tc.name: publish() - * @tc.desc: verify the function of publish(slotType:SERVICE_INFORMATION) - */ - it('ACTS_PublishSlotTypeService_xts_0200', 0,async function (done) { - console.info("===============ACTS_PublishSlotTypeService_0200================>"); - var subscriber ={ - onConsume:onConsume1000 - } - await notify.subscribe(subscriber); - console.info("===============ACTS_PublishSlotTypeService_0200 subscribe======>"); - try { - await notify.publish({ - id: 30, - content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - slotType: notify.SlotType.SERVICE_INFORMATION - }, publishSlotServiceCallback002); - }catch(err){ - console.info("==========ACTS_PublishSlotTypeService_0200 err======>"+err.code); - } - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeService_0200 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function publishSlotServiceCallback003(error){ - console.log('========ACTS_PublishSlotTypeService_0300 publish callback========>'+JSON.stringify(error.code)); - } - function onConsume1100(data){ - console.info("=======ACTS_PublishSlotTypeService_0300 onConsume start=========>"); - console.info("=======ACTS_PublishSlotTypeService_0300 onConsume data:=========>" + JSON.stringify(data)); - expect(data.request.content.normal.title).assertEqual("test31_title"); - console.info("=======ACTS_PublishSlotTypeService_0300 onConsume end===========>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeService_xts_0300 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) - */ - it('ACTS_PublishSlotTypeService_xts_0300', 0,async function (done) { - console.info("===============ACTS_PublishSlotTypeService_0300================>"); - var subscriber ={ - onConsume:onConsume1100 - } - await notify.subscribe(subscriber); - console.info("===============ACTS_PublishSlotTypeService_0300 subscribe======>"); - await notify.publish({ - id: 31, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test31_title", - text: "test31_text", - additionalText: "test31_additionalText" - }, - }, - // slotType:notification.SlotType.SERVICE_INFORMATION - },publishSlotServiceCallback003); - console.info("==========ACTS_PublishSlotTypeService_0300 publish======>"); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeService_0300 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function publishSlotServiceCallback004(error){ - console.log('========ACTS_PublishSlotTypeService_0400 publish callback========>'+JSON.stringify(error.code)); - } - function onConsume1200(data){ - console.info("=======ACTS_PublishSlotTypeService_0400 onConsume start=========>"); - console.info("=======ACTS_PublishSlotTypeService_0400 onConsume data:=========>" + JSON.stringify(data)); - expect(data.request.content.normal.title).assertEqual("test32_title"); - console.info("=======ACTS_PublishSlotTypeService_0400 onConsume end===========>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeService_xts_0400 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:UNKNOWN_TYPE) - */ - it('ACTS_PublishSlotTypeService_xts_0400', 0,async function (done) { - console.info("===============ACTS_PublishSlotTypeService_0400================>"); - var subscriber ={ - onConsume:onConsume1200 - } - await notify.subscribe(subscriber); - console.info("===============ACTS_PublishSlotTypeService_0400 subscribe======>"); - await notify.publish({ - id: 32, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test32_title", - text: "test32_text", - additionalText: "test32_additionalText" - }, - }, - slotType:notify.SlotType.UNKNOWN_TYPE - },publishSlotServiceCallback004); - console.info("==========ACTS_PublishSlotTypeService_0400 publish======>"); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeService_0400 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume1300(data){ - console.info("=======ACTS_PublishSlotTypeService_0500 onConsume start=========>"); - console.info("=======ACTS_PublishSlotTypeService_0500 onConsume data:=========>" + JSON.stringify(data)); - expect(data.request.content.normal.title).assertEqual("test33_title"); - console.info("=======ACTS_PublishSlotTypeService_0500 onConsume end===========>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeService_xts_0500 - * @tc.name: publish() - * @tc.desc: verify the publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SERVICE_INFORMATION) promise - */ - it('ACTS_PublishSlotTypeService_xts_0500', 0,async function (done) { - console.info("===============ACTS_PublishSlotTypeService_0500================>"); - var subscriber ={ - onConsume:onConsume1300 - } - await notify.subscribe(subscriber); - console.info("===============ACTS_PublishSlotTypeService_0500 subscribe======>"); - notify.publish({ - id: 33, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test33_title", - text: "test33_text", - additionalText: "test33_additionalText" - }, - }, - slotType:notify.SlotType.SERVICE_INFORMATION - }).then(console.log("==========ACTS_PublishSlotTypeService_0500 publish then======>")) - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeService_0500 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume1400(data){ - console.info("=======ACTS_PublishSlotTypeService_0600 onConsume start=========>"); - console.info("=======ACTS_PublishSlotTypeService_0600 onConsume data:=========>" + JSON.stringify(data)); - expect().assertFail(); - console.info("=======ACTS_PublishSlotTypeService_0600 onConsume end===========>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeService_xts_0600 - * @tc.name: publish() - * @tc.desc: verify the function of publish(slotType:SERVICE_INFORMATION) promise - */ - it('ACTS_PublishSlotTypeService_xts_0600', 0,async function (done) { - console.info("===============ACTS_PublishSlotTypeService_0600================>"); - var subscriber ={ - onConsume:onConsume1400 - } - await notify.subscribe(subscriber); - console.info("===============ACTS_PublishSlotTypeService_0600 subscribe======>"); - try { - var promise = notify.publish({ - id: 34, - content: { - // contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - slotType: notify.SlotType.SERVICE_INFORMATION - }) - }catch(err){ - console.info("======ACTS_PublishSlotTypeService_0600 err===>"+err.code); - } - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeService_0600 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume1500(data){ - console.info("=======ACTS_PublishSlotTypeService_0700 onConsume start=========>"); - console.info("=======ACTS_PublishSlotTypeService_0700 onConsume data:=========>" + JSON.stringify(data)); - expect(data.request.content.normal.title).assertEqual("test35_title"); - console.info("=======ACTS_PublishSlotTypeService_0700 onConsume end===========>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeService_xts_0700 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) promise - */ - it('ACTS_PublishSlotTypeService_xts_0700', 0,async function (done) { - console.info("===============ACTS_PublishSlotTypeService_0700================>"); - var subscriber ={ - onConsume:onConsume1500 - } - await notify.subscribe(subscriber); - console.info("===============ACTS_PublishSlotTypeService_0700 subscribe======>"); - notify.publish({ - id: 35, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test35_title", - text: "test35_text", - additionalText: "test35_additionalText" - }, - }, - // slotType:notification.SlotType.SERVICE_INFORMATION - }).then(console.log("===ACTS_PublishSlotTypeService_0700 finished===")); - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeService_0700 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume1600(data){ - console.info("=======ACTS_PublishSlotTypeService_0800 onConsume start=========>"); - console.info("=======ACTS_PublishSlotTypeService_0800 onConsume data:=========>" + JSON.stringify(data)); - expect(data.request.content.normal.title).assertEqual("test36_title"); - console.info("=======ACTS_PublishSlotTypeService_0800 onConsume end===========>"); - } - - /* - * @tc.number: ACTS_PublishSlotTypeService_xts_0800 - * @tc.name: publish() - * @tc.desc: verify publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:UNKNOWN_TYPE) promise - */ - it('ACTS_PublishSlotTypeService_xts_0800', 0,async function (done) { - console.info("===============ACTS_PublishSlotTypeService_0800================>"); - var subscriber ={ - onConsume:onConsume1600 - } - await notify.subscribe(subscriber); - console.info("===============ACTS_PublishSlotTypeService_0800 subscribe======>"); - notify.publish({ - id: 36, - content: { - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test36_title", - text: "test36_text", - additionalText: "test36_additionalText" - }, - }, - slotType:notify.SlotType.UNKNOWN_TYPE - }).then(console.log("===ACTS_PublishSlotTypeService_0800 finished===")) - setTimeout((async function(){ - await notify.unsubscribe(subscriber); - console.info("======ACTS_PublishSlotTypeService_0800 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); -}) -} diff --git a/notification/ans_standard/publish_test/publish/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/publish/src/main/resources/base/element/string.json deleted file mode 100644 index ce7be5db08a9d272860338c518d13159dbdf5867..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publish/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "pubIcon" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publish/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/publish/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/publish/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/publishcontentype/BUILD.gn b/notification/ans_standard/publish_test/publishcontentype/BUILD.gn deleted file mode 100644 index fa77d654c499bfb6c4daf1496d4c9f31a185f7ce..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/BUILD.gn +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -group("publishcontentype") { - testonly = true - if (is_standard_system) { - deps = [ - #"publishtype:ActsAnsNotificationTest", - #"sub:ActsAnsCommonEventTest", - ] - } -} diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/BUILD.gn b/notification/ans_standard/publish_test/publishcontentype/publishtype/BUILD.gn deleted file mode 100644 index 7ce46a2a2583c5d516146367e0864c282f27caa2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsNotificationTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsNotificationTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/Test.json b/notification/ans_standard/publish_test/publishcontentype/publishtype/Test.json deleted file mode 100644 index e0779b0acdc7c4eb1b439e4db98464c83fea3c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "60000", - "shell-timeout": "60000", - "bundle-name": "com.example.actsansnotificationtest", - "package-name": "com.example.actsansnotificationtest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsNotificationTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/publishcontentype/publishtype/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/publishcontentype/publishtype/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/config.json b/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/config.json deleted file mode 100644 index 59c783a295865fe86cb57a9b0ec5afd2e4f947cf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansnotificationtest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansnotificationtest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index ec1c48a9cded2bbba6877686fae33ec14be32b8e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - Test of ANS Publishing - -
diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/test/ExampleJsunit.test.js deleted file mode 100644 index 6f716addd0061eec41aeb45510c421c7c0c553ce..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/test/ExampleJsunit.test.js +++ /dev/null @@ -1,1872 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import notification from '@ohos.notification' -import Subscriber from '@ohos.commonEvent' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -var time = 5000 -var multiLineDataOne -var multiLineDataTwo -var LongContentDataOne -var LongContentDataTwo -var SlotTypeDataOne -var SlotTypeDataTwo -var SlotTypeDataThree -var SlotTypeDataFour -var SlotTypeDataFive -var SlotTypeDataSix -var OtherDataOne -var OtherDataTwo -var OtherDataThree -var OtherDataFour -var OtherDataFive -var OtherDataSix -var ServiceDataOne -var ServiceDataTwo -var ServiceDataThree -var ServiceDataFour -var ServiceDataFive -var ServiceDataSix -var SocialDataOne -var SocialDataTwo -var SocialDataThree -var SocialDataFour -var SocialDataFive -var SocialDataSix -export default function ActsAnsNotificationTest() { -describe('ActsAnsNotificationTest', function () { - function publishMULTILINEContentCallback001(error){ - console.log('ActsNotificationTest ACTS_PublishMULTILINEContent_0100 asyncCallback'+JSON.stringify(error.code)) - } - function publishMULTILINEContentCallback002(error){ - console.log('ActsNotificationTest ACTS_PublishMULTILINEContent_0200 asyncCallback'+JSON.stringify(error.code)) - } - function publishMULTILINEContentCallback003(error){ - console.log('ActsNotificationTest ACTS_PublishMULTILINEContent_0300 asyncCallback'+JSON.stringify(error.code)) - } - function publishLONGContentCallback001(error){ - console.log('ActsNotificationTest ACTS_PublishLONGContent_0100 asyncCallback'+JSON.stringify(error.code)) - } - function publishLONGContentCallback002(error){ - console.log('ActsNotificationTest ACTS_PublishLONGContent_0200 asyncCallback'+JSON.stringify(error.code)) - } - function publishLONGContentCallback003(error){ - console.log('ActsNotificationTest ACTS_PublishLONGContent_0300 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotTypeContentCallback001(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeContent_0100 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotTypeContentCallback002(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeContent_0200 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotTypeContentCallback003(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeContent_0300 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotTypeContentCallback004(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeContent_0400 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotOtherCallback001(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeOther_0100 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotOtherCallback002(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeOther_0200 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotOtherCallback003(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeOther_0300 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotOtherCallback004(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeOther_0400 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotServiceCallback001(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0100 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotServiceCallback002(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0200 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotServiceCallback003(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0300 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotServiceCallback004(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0400 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotSocialCallback001(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0400 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotSocialCallback002(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0400 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotSocialCallback003(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0400 asyncCallback'+JSON.stringify(error.code)) - } - function publishSlotSocialCallback004(error){ - console.log('ActsNotificationTest ACTS_Publish_SlotTypeService_0400 asyncCallback'+JSON.stringify(error.code)) - } - function UnSubscribeCallBacka(err){ - console.log('===UnSubscribeCallBacka==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackb(err){ - console.log('===UnSubscribeCallBackb==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackc(err){ - console.log('===UnSubscribeCallBackc==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackd(err){ - console.log('===UnSubscribeCallBackd==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBacke(err){ - console.log('===UnSubscribeCallBacke==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackf(err){ - console.log('===UnSubscribeCallBackf==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackg(err){ - console.log('===UnSubscribeCallBackg==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackh(err){ - console.log('===UnSubscribeCallBackh==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBacki(err){ - console.log('===UnSubscribeCallBacki==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackj(err){ - console.log('===UnSubscribeCallBackj==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackl(err){ - console.log('===UnSubscribeCallBackl==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackm(err){ - console.log('===UnSubscribeCallBackm==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackn(err){ - console.log('===UnSubscribeCallBackn==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBacko(err){ - console.log('===UnSubscribeCallBacko==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackp(err){ - console.log('===UnSubscribeCallBackp==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackq(err){ - console.log('===UnSubscribeCallBackq==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackr(err){ - console.log('===UnSubscribeCallBackr==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBacks(err){ - console.log('===UnSubscribeCallBacks==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackt(err){ - console.log('===UnSubscribeCallBackt==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBacku(err){ - console.log('===UnSubscribeCallBacku==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackv(err){ - console.log('===UnSubscribeCallBackv==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackw(err){ - console.log('===UnSubscribeCallBackw==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackx(err){ - console.log('===UnSubscribeCallBackx==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBacky(err){ - console.log('===UnSubscribeCallBacky==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackz(err){ - console.log('===UnSubscribeCallBackz==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackA(err){ - console.log('===UnSubscribeCallBackA==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackB(err){ - console.log('===UnSubscribeCallBackB==='+err.code) - expect(err.code).assertEqual(0) - } - function UnSubscribeCallBackC(err){ - console.log('===UnSubscribeCallBackC==='+err.code) - expect(err.code).assertEqual(0) - } - /* - * @tc.number: ACTS_PublishMULTILINEContent_0100 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_MULTILINE) - */ - it('ACTS_PublishMULTILINEContent_0100', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishMULTILINEContent_0100"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo - , async (err,data) =>{ - console.info("===ACTS_PublishMULTILINEContent_0100===createSubscriber"+JSON.stringify(data)); - multiLineDataOne = data - await Subscriber.subscribe(data, subMultilineOneCallBack) - }) - function subMultilineOneCallBack(err,data){ - console.log('===subMultilineOneCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(multiLineDataOne,UnSubscribeCallBacka) - if(data.code == 1) { - expect(data.code).assertEqual(1); - done(); - } - else{ - expect().assertFail(); - done(); - } - } - await notification.publish({ - id: 1, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE, - multiLine: { - title: "test1_title", - text: "test1_text", - additionalText: "test1_additionalText", - briefText: "briefText1", - longTitle: "longTitle1", - lines: ["thrive", "democracy", "civilization", "harmonious"] - }, - } - }, async (err)=>{ - console.debug("====ACTS_PublishMULTILINEContent_0100===Callback==>") - }); - - }) - - /* - * @tc.number: ACTS_PublishMULTILINEContent_0200 - * @tc.name: publish() - * @tc.desc: verify the function of publish() - */ - it('ACTS_PublishMULTILINEContent_0200', 0,async function (done) { - var notificationInfo = { - id: 2, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE, - multiLine: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - briefText: "briefText", - longTitle: "longTitle", - lines: ["thrive", "democracy", "civilization", "harmonious"] - }, - } - } - await notification.publish(notificationInfo,publishMULTILINEContentCallback002) - done(); - }) - /* - * @tc.number: ACTS_PublishMULTILINEContent_0300 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_PICTURE) - */ - it('ACTS_PublishMULTILINEContent_0300', 0,async function (done) { - try { - await notification.publish({ - id: 3, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_PICTURE, - multiLine: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - briefText: "briefText", - longTitle: "longTitle", - lines: ["thrive", "democracy", "civilization", "harmonious"] - }, - } - }, publishMULTILINEContentCallback003); - }catch(error){ - console.log('ActsNotificationTest ACTS_PublishMULTILINEContent_0300 asyncCallback'+JSON.stringify(error.code)) - } - done(); - }) - - /* - * @tc.number: ACTS_PublishMULTILINEContent_0400 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_MULTILINE) promise - */ - it('ACTS_PublishMULTILINEContent_0400', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishMULTILINEContent_0400"] - }; - await Subscriber.createSubscriber(commonEventSubscribeInfo).then(async(data)=> { - console.info("===ACTS_PublishMULTILINEContent_0400===createSubscriber" + JSON.stringify(data)); - multiLineDataTwo = data - await Subscriber.subscribe(data, subMultilineTwoCallBack) - }) - console.info("===ACTS_PublishMULTILINEContent_0400===subMultilineTwoCallBack"); - async function subMultilineTwoCallBack(err,data){ - console.log('===subMultilineTwoCallBack==='+err.code+JSON.stringify(data)) - await Subscriber.unsubscribe(multiLineDataTwo,UnSubscribeCallBackb) - if(data.code == 4) { - done(); - } - else{ - expect().assertFail(); - done(); - } - } - notification.publish({ - id: 4, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE, - multiLine: { - title: "test4_title", - text: "test4_text", - additionalText: "test4_additionalText", - briefText:"briefText4", - longTitle:"longTitle4", - lines: ["thrive", "democracy", "civilization", "harmonious"] - }, - } - }).then(console.debug("===ACTS_PublishMULTILINEContent_0400===Promise===>")) - setTimeout(function(){ - console.debug("====>time out ACTS_PublishMULTILINEContent_0400====>"); - }, time); - }) - /* - * @tc.number: ACTS_PublishMULTILINEContent_0500 - * @tc.name: publish() - * @tc.desc: verify the function of publish() promise - */ - it('ACTS_PublishMULTILINEContent_0500', 0,async function (done) { - var promise = notification.publish({ - id: 5, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE, - multiLine: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - briefText:"briefText", - longTitle:"longTitle", - lines: ["thrive", "democracy", "civilization", "harmonious"] - }, - } - }) - expect(typeof(promise)).assertEqual("object") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishMULTILINEContent_0500====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishMULTILINEContent_0600 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_PICTURE) promise - */ - it('ACTS_PublishMULTILINEContent_0600', 0,async function (done) { - var promise = notification.publish({ - id: 6, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_MULTILINE, - multiLine: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - briefText:"briefText", - longTitle:"longTitle", - lines: ["thrive", "civilization", "harmonious"] - }, - } - }) - expect(typeof(promise)).assertEqual("object") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishMULTILINEContent_0600====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishLONGContent_0100 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_LONG_TEXT) - */ - it('ACTS_PublishLONGContent_0100', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishLONGContent_0100"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async(data) =>{ - console.info("===ACTS_PublishLONGContent_0100===createSubscriber"+JSON.stringify(data)); - LongContentDataOne = data - await Subscriber.subscribe(data, subLoneOneCallBack) - }) - function subLoneOneCallBack(err,data){ - console.log('===subLoneOneCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(LongContentDataOne,UnSubscribeCallBackc) - if(data.code == 7) { - done(); - } - else{ - expect().assertFail(); - done(); - } - } - await notification.publish({ - id: 7, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, - longText: { - title: "test7_title", - text: "test7_text", - additionalText: "test7_additionalText", - longText:"longText7", - briefText:"briefText7", - expandedTitle:"expandedTitle7" - }} - },(err)=>{ - console.debug("===ACTS_PublishLONGContent_0100===Callback===>"); - }); - }) - - /* - * @tc.number: ACTS_PublishLONGContent_0200 - * @tc.name: publish() - * @tc.desc: verify the function of publish() - */ - it('ACTS_PublishLONGContent_0200', 0,async function (done) { - await notification.publish({ - id: 8, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, - longText: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - longText:"longText", - briefText:"briefText", - expandedTitle:"expandedTitle" - }} - },publishLONGContentCallback002); - console.log("===ACTS_PublishLONGContent_0200 finished===") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishLONGContent_0200====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishLONGContent_0300 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_LONG_TEXT) - */ - it('ACTS_PublishLONGContent_0300', 0,async function (done) { - await notification.publish({ - id: 9, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, - longText: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - longText:"longText", - briefText:"briefText", - expandedTitle:"expandedTitle" - }} - },publishLONGContentCallback003); - console.log("===ACTS_PublishLONGContent_0300 finished===") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishLONGContent_0300====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishLONGContent_0400 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_LONG_TEXT) promise - */ - it('ACTS_PublishLONGContent_0400', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishLONGContent_0400"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async (data) =>{ - console.info("===ACTS_PublishLONGContent_0400===createSubscriber"+JSON.stringify(data)); - LongContentDataTwo = data - await Subscriber.subscribe(data, subLoneTwoCallBack) - }) - function subLoneTwoCallBack(err,data){ - console.log('===subLoneTwoCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(LongContentDataTwo,UnSubscribeCallBackd) - if(data.code == 10) { - done(); - } - else{ - expect().assertFail(); - done(); - } - } - notification.publish({ - id: 10, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, - longText: { - title: "test10_title", - text: "test10_text", - additionalText: "test10_additionalText", - longText:"longText10", - briefText:"briefText10", - expandedTitle:"expandedTitle10" - }} - }).then(console.log("===ACTS_PublishLONGContent_0400 finished===")) - setTimeout(function(){ - console.debug("====>time out ACTS_PublishLONGContent_0400====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishLONGContent_0500 - * @tc.name: publish() - * @tc.desc: verify the function of publish() promise - */ - it('ACTS_PublishLONGContent_0500', 0,async function (done) { - var promise = await notification.publish({ - id: 11, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, - longText: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - longText:"longText", - briefText:"briefText", - expandedTitle:"expandedTitle" - }} - }) - expect(typeof(promise)).assertEqual("object") - done(); - }) - - /* - * @tc.number: ACTS_PublishLONGContent_0600 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_LONG_TEXT) promise - */ - it('ACTS_PublishLONGContent_0600', 0,async function (done) { - var promise = notification.publish({ - id: 12, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, - longText: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText", - longText:"longText", - briefText:"briefText", - expandedTitle:"expandedTitleing" - }} - }) - expect(typeof(promise)).assertEqual("object") - done(); - }) - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_0100 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:CONTENT_INFORMATION) - */ - it('ACTS_Publish_SlotTypeContent_0100', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_Publish_SlotTypeContent_0100"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async(data) =>{ - console.info("===ACTS_Publish_SlotTypeContent_0100===createSubscriber"+JSON.stringify(data)); - SlotTypeDataOne = data - await Subscriber.subscribe(data, subSlotTypeOneCallBack) - }) - function subSlotTypeOneCallBack(err,data){ - console.log('===subSlotTypeOneCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(SlotTypeDataOne,UnSubscribeCallBacke) - if(data.code == 13) { - expect(data.code).assertEqual(13) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - await notification.publish({ - id: 13, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test13_title", - text: "test13_text", - additionalText: "test13_additionalText" - } - }, - slotType:notification.SlotType.CONTENT_INFORMATION - },publishSlotTypeContentCallback001); - console.log("===ACTS_Publish_SlotTypeContent_0100 finished===") - setTimeout(function(){ - console.debug("====>time out ACTS_Publish_SlotTypeContent_0100====>"); - }, time); - }) - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_0200 - * @tc.name: publish() - * @tc.desc: verify the function of publish(slotType:CONTENT_INFORMATION) - */ - it('ACTS_Publish_SlotTypeContent_0200', 0,async function (done) { - await notification.publish({ - id: 14, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - } - }, - slotType:notification.SlotType.CONTENT_INFORMATION - },publishSlotTypeContentCallback002); - console.log("===ACTS_Publish_SlotTypeContent_0200 finished===") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_Publish_SlotTypeContent_0200====>"); - }, time); - }) - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_0300 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) - */ - it('ACTS_Publish_SlotTypeContent_0300', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_Publish_SlotTypeContent_0300"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async(data) =>{ - console.info("===ACTS_Publish_SlotTypeContent_0300===createSubscriber"+JSON.stringify(data)); - SlotTypeDataTwo = data - await Subscriber.subscribe(data, subSlotTypeTwoCallBack) - }) - function subSlotTypeTwoCallBack(err,data){ - console.log('===subSlotTypeTwoCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(SlotTypeDataTwo,UnSubscribeCallBackf) - if(data.code == 15) { - expect(data.code).assertEqual(15) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - await notification.publish({ - id: 15, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test15_title", - text: "test15_text", - additionalText: "test_additionalText" - } - }, - //slotType:notification.SlotType.CONTENT_INFORMATION - },publishSlotTypeContentCallback003); - console.log("===ACTS_Publish_SlotTypeContent_0300 finished===") - setTimeout(function(){ - console.debug("====>time out ACTS_Publish_SlotTypeContent_0300====>"); - }, time); - }) - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_0400 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SERVICE_INFORMATION) - */ - it('ACTS_Publish_SlotTypeContent_0400', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_Publish_SlotTypeContent_0400"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async (data) =>{ - console.info("===ACTS_Publish_SlotTypeContent_0400===createSubscriber"+JSON.stringify(data)); - SlotTypeDataThree = data - await Subscriber.subscribe(data, subSlotTypeThreeCallBack) - }) - function subSlotTypeThreeCallBack(err,data){ - console.log('===subSlotTypeThreeCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(SlotTypeDataThree,UnSubscribeCallBackg) - if(data.code == 16) { - expect(data.code).assertEqual(16) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - await notification.publish({ - id: 16, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test16_title", - text: "test16_text", - additionalText: "test16_additionalText" - } - }, - slotType:notification.SlotType.SERVICE_INFORMATION - },publishSlotTypeContentCallback004); - console.log("===ACTS_Publish_SlotTypeContent_0400 finished===") - setTimeout(function(){ - console.debug("====>time out ACTS_Publish_SlotTypeContent_0400====>"); - }, time); - }) - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_0500 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:CONTENT_INFORMATION) promise - */ - it('ACTS_Publish_SlotTypeContent_0500', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_Publish_SlotTypeContent_0500"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async(data) =>{ - console.info("===ACTS_Publish_SlotTypeContent_0500===createSubscriber"+JSON.stringify(data)); - SlotTypeDataFour = data - await Subscriber.subscribe(data, subSlotTypeFourCallBack) - }) - function subSlotTypeFourCallBack(err,data){ - console.log('===subSlotTypeFourCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(SlotTypeDataFour,UnSubscribeCallBackh) - if(data.code == 17) { - expect(data.code).assertEqual(17) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - notification.publish({ - id: 17, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test17_title", - text: "test17_text", - additionalText: "test17_additionalText" - } - }, - slotType:notification.SlotType.CONTENT_INFORMATION - }).then( console.log("===ACTS_Publish_SlotTypeContent_0500 finished===")) - setTimeout(function(){ - console.debug("====>time out ACTS_Publish_SlotTypeContent_0500====>"); - }, time); - }) - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_0600 - * @tc.name: publish() - * @tc.desc: verify the function of publish(slotType:CONTENT_INFORMATION) promise - */ - it('ACTS_Publish_SlotTypeContent_0600', 0,async function (done) { - var promise = notification.publish({ - id: 18, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - } - }, - slotType:notification.SlotType.CONTENT_INFORMATION - }) - expect(typeof(promise)).assertEqual("object") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_Publish_SlotTypeContent_0600====>"); - }, time); - }) - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_0700 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) promise - */ - it('ACTS_Publish_SlotTypeContent_0700', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_Publish_SlotTypeContent_0700"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async(data) =>{ - console.info("===ACTS_Publish_SlotTypeContent_0700===createSubscriber"+JSON.stringify(data)); - SlotTypeDataFive = data - await Subscriber.subscribe(data, subSlotTypeFiveCallBack) - }) - function subSlotTypeFiveCallBack(err,data){ - console.log('===subSlotTypeFiveCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(SlotTypeDataFive,UnSubscribeCallBacki) - if(data.code == 19) { - expect(data.code).assertEqual(19) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - notification.publish({ - id: 19, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test19_title", - text: "test19_text", - additionalText: "test19_additionalText" - } - }, - //slotType:notification.SlotType.CONTENT_INFORMATION - }).then(console.log("===ACTS_Publish_SlotTypeContent_0700 finished===")) - setTimeout(function(){ - console.debug("====>time out ACTS_Publish_SlotTypeContent_0700====>"); - }, time); - }) - - /* - * @tc.number: ACTS_Publish_SlotTypeContent_0800 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SERVICE_INFORMATION) promise - */ - it('ACTS_Publish_SlotTypeContent_0800', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_Publish_SlotTypeContent_0800"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async(data) =>{ - console.info("===ACTS_Publish_SlotTypeContent_0800===createSubscriber"+JSON.stringify(data)); - SlotTypeDataSix = data - await Subscriber.subscribe(data, subSlotTypeSixCallBack) - }) - function subSlotTypeSixCallBack(err,data){ - console.log('===subSlotTypeSixCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(SlotTypeDataSix,UnSubscribeCallBackj) - if(data.code == 20) { - expect(data.code).assertEqual(20) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - notification.publish({ - id: 20, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test20_title", - text: "test20_text", - additionalText: "test20_additionalText" - } - }, - slotType:notification.SlotType.SERVICE_INFORMATION - }).then(console.log("===ACTS_Publish_SlotTypeContent_0800 finished===")) - setTimeout(function(){ - console.debug("====>time out ACTS_Publish_SlotTypeContent_0800====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeOther_0100 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:OTHER_TYPES) - */ - it('ACTS_PublishSlotTypeOther_0100', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishSlotTypeOther_0100"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async (data) =>{ - console.info("===ACTS_PublishSlotTypeOther_0100===createSubscriber"+JSON.stringify(data)); - OtherDataOne = data - await Subscriber.subscribe(data, subOtherOneCallBack) - }) - function subOtherOneCallBack(err,data){ - console.log('===subOtherOneCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(OtherDataOne,UnSubscribeCallBackl) - if(data.code == 21) { - expect(data.code).assertEqual(21) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - await notification.publish({ - id:21, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test21_title", - text: "test21_text", - additionalText: "test21_additionalText" - }, - slotType:notification.SlotType.OTHER_TYPES - } - },publishSlotOtherCallback001); - console.log("===ACTS_PublishSlotTypeOther_0100 finished===") - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeOther_0100====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeOther_0200 - * @tc.name: publish() - * @tc.desc: verify the function of publish(slotType:OTHER_TYPES) - */ - it('ACTS_PublishSlotTypeOther_0200', 0,async function (done) { - await notification.publish({ - id:22, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - slotType:notification.SlotType.OTHER_TYPES - } - },publishSlotOtherCallback002); - console.log("===ACTS_PublishSlotTypeOther_0200 finished===") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeOther_0200====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeOther_0300 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) - */ - it('ACTS_PublishSlotTypeOther_0300', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishSlotTypeOther_0300"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async (data) =>{ - console.info("===ACTS_PublishSlotTypeOther_0300===createSubscriber"+JSON.stringify(data)); - OtherDataTwo = data - await Subscriber.subscribe(data, subOtherTwoCallBack) - }) - function subOtherTwoCallBack(err,data){ - console.log('===subOtherTwoCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(OtherDataTwo,UnSubscribeCallBackm) - if(data.code == 23) { - expect(data.code).assertEqual(23) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - await notification.publish({ - id:23, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test23_title", - text: "test23_text", - additionalText: "test23_additionalText" - }, - //slotType:notification.SlotType.OTHER_TYPES - } - },publishSlotOtherCallback003); - console.log("===ACTS_PublishSlotTypeOther_0300 finished===") - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeOther_0300====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeOther_0400 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SOCIAL_COMMUNICATION) - */ - it('ACTS_PublishSlotTypeOther_0400', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishSlotTypeOther_0400"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async (data) =>{ - console.info("===ACTS_PublishSlotTypeOther_0400===createSubscriber"+JSON.stringify(data)); - OtherDataThree = data - await Subscriber.subscribe(data, subOtherThreeCallBack) - }) - function subOtherThreeCallBack(err,data){ - console.log('===subOtherThreeCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(OtherDataThree,UnSubscribeCallBackn) - if(data.code == 24) { - expect(data.code).assertEqual(24) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - await notification.publish({ - id:24, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test24_title", - text: "test24_text", - additionalText: "test24_additionalText" - }, - slotType:notification.SlotType.SOCIAL_COMMUNICATION - } - },publishSlotOtherCallback004); - console.log("===ACTS_PublishSlotTypeOther_0400 finished===") - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeOther_0400====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeOther_0500 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:OTHER_TYPES) promise - */ - it('ACTS_PublishSlotTypeOther_0500', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishSlotTypeOther_0500"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async (data) =>{ - console.info("===ACTS_PublishSlotTypeOther_0500===createSubscriber"+JSON.stringify(data)); - OtherDataFour = data - await Subscriber.subscribe(data, subOtherFourCallBack) - }) - function subOtherFourCallBack(err,data){ - console.log('===subOtherFourCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(OtherDataFour,UnSubscribeCallBacko) - if(data.code == 25) { - expect(data.code).assertEqual(25) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - notification.publish({ - id:25, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test25_title", - text: "test25_text", - additionalText: "test25_additionalText" - }, - slotType:notification.SlotType.OTHER_TYPES - } - }).then(console.log("===ACTS_PublishSlotTypeOther_0500 finished===")) - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeOther_0500====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeOther_0600 - * @tc.name: publish() - * @tc.desc: verify the function of publish(slotType:OTHER_TYPES) promise - */ - it('ACTS_PublishSlotTypeOther_0600', 0,async function (done) { - var promise = notification.publish({ - id:26, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - slotType:notification.SlotType.OTHER_TYPES - } - }) - expect(typeof(promise)).assertEqual("object") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeOther_0600====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeOther_0700 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) promise - */ - it('ACTS_PublishSlotTypeOther_0700', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishSlotTypeOther_0700"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async(data) =>{ - console.info("===ACTS_PublishSlotTypeOther_0700===createSubscriber"+JSON.stringify(data)); - OtherDataFive = data - await Subscriber.subscribe(data, subOtherFiveCallBack) - }) - function subOtherFiveCallBack(err,data){ - console.log('===subOtherFiveCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(OtherDataFive,UnSubscribeCallBackp) - if(data.code == 27) { - expect(data.code).assertEqual(27) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - notification.publish({ - id:27, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test27_title", - text: "test27_text", - additionalText: "test27_additionalText" - }, - //slotType:notification.SlotType.OTHER_TYPES - } - }).then(console.log("===ACTS_PublishSlotTypeOther_0700 finished===")) - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeOther_0700====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeOther_0500 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SOCIAL_COMMUNICATION) promise - */ - it('ACTS_PublishSlotTypeOther_0800', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishSlotTypeOther_0800"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async(data) =>{ - console.info("===ACTS_PublishSlotTypeOther_0800===createSubscriber"+JSON.stringify(data)); - OtherDataSix = data - await Subscriber.subscribe(data, subOtherSixCallBack) - }) - function subOtherSixCallBack(err,data){ - console.log('===subOtherSixCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(OtherDataSix,UnSubscribeCallBackq) - if(data.code == 28) { - expect(data.code).assertEqual(28) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - notification.publish({ - id:28, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test28_title", - text: "test28_text", - additionalText: "test28_additionalText" - }, - slotType:notification.SlotType.SOCIAL_COMMUNICATION - } - }).then(console.log("===ACTS_PublishSlotTypeOther_0800 finished===")) - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeOther_0800====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeService_0100 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SERVICE_INFORMATION) - */ - it('ACTS_PublishSlotTypeService_0100', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishSlotTypeService_0100"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async (data) =>{ - console.info("===ACTS_PublishSlotTypeService_0100===createSubscriber"+JSON.stringify(data)); - ServiceDataOne = data - await Subscriber.subscribe(data, subServiceOneCallBack) - }) - function subServiceOneCallBack(err,data){ - console.log('===subServiceOneCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(ServiceDataOne,UnSubscribeCallBackr) - if(data.code == 29) { - expect(data.code).assertEqual(29) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - await notification.publish({ - id:29, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test29_title", - text: "test29_text", - additionalText: "test29_additionalText" - }, - }, - slotType:notification.SlotType.SERVICE_INFORMATION - },publishSlotServiceCallback001); - console.log("===ACTS_PublishSlotTypeService_0100 finished===") - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeService_0100====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeService_0200 - * @tc.name: publish() - * @tc.desc: verify the function of publish(slotType:SERVICE_INFORMATION) - */ - it('ACTS_PublishSlotTypeService_0200', 0,async function (done) { - await notification.publish({ - id: 30, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - slotType:notification.SlotType.SERVICE_INFORMATION - },publishSlotServiceCallback002); - console.log("===ACTS_PublishSlotTypeService_0200 finished===") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeService_0200====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeService_0300 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) - */ - it('ACTS_PublishSlotTypeService_0300', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishSlotTypeService_0300"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async(data) =>{ - console.info("===ACTS_PublishSlotTypeService_0300===createSubscriber"+JSON.stringify(data)); - ServiceDataTwo = data - await Subscriber.subscribe(data, subServiceTwoCallBack) - }) - function subServiceTwoCallBack(err,data){ - console.log('===subServiceTwoCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(ServiceDataTwo,UnSubscribeCallBacks) - if(data.code == 31) { - expect(data.code).assertEqual(31) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - await notification.publish({ - id: 31, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test31_title", - text: "test31_text", - additionalText: "test31_additionalText" - }, - }, - // slotType:notification.SlotType.SERVICE_INFORMATION - },publishSlotServiceCallback003); - console.log("===ACTS_PublishSlotTypeService_0300 finished===") - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeService_0300====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeService_0400 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:UNKNOWN_TYPE) - */ - it('ACTS_PublishSlotTypeService_0400', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishSlotTypeService_0400"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async(data) =>{ - console.info("===ACTS_PublishSlotTypeService_0400===createSubscriber"+JSON.stringify(data)); - ServiceDataThree = data - await Subscriber.subscribe(data, subServiceThreeCallBack) - }) - function subServiceThreeCallBack(err,data){ - console.log('===subServiceThreeCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(ServiceDataThree,UnSubscribeCallBackt) - if(data.code == 32) { - expect(data.code).assertEqual(32) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - await notification.publish({ - id: 32, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test32_title", - text: "test32_text", - additionalText: "test32_additionalText" - }, - }, - slotType:notification.SlotType.UNKNOWN_TYPE - },publishSlotServiceCallback004); - console.log("===ACTS_PublishSlotTypeService_0400 finished===") - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeService_0400====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeService_0500 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SERVICE_INFORMATION) promise - */ - it('ACTS_PublishSlotTypeService_0500', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishSlotTypeService_0500"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async (data) =>{ - console.info("===ACTS_PublishSlotTypeService_0500===createSubscriber"+JSON.stringify(data)); - ServiceDataFour = data - await Subscriber.subscribe(data, subServiceFourCallBack) - }) - function subServiceFourCallBack(err,data){ - console.log('===subServiceFourCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(ServiceDataFour,UnSubscribeCallBacku) - if(data.code == 33) { - expect(data.code).assertEqual(33) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - notification.publish({ - id: 33, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test33_title", - text: "test33_text", - additionalText: "test33_additionalText" - }, - }, - slotType:notification.SlotType.SERVICE_INFORMATION - }).then(console.log("===ACTS_PublishSlotTypeService_0500 finished===")) - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeService_0500====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeService_0600 - * @tc.name: publish() - * @tc.desc: verify the function of publish(slotType:SERVICE_INFORMATION) promise - */ - it('ACTS_PublishSlotTypeService_0600', 0,async function (done) { - var promise = notification.publish({ - id: 34, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - slotType:notification.SlotType.SERVICE_INFORMATION - }) - expect(typeof(promise)).assertEqual("object") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeService_0600====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeService_0700 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) promise - */ - it('ACTS_PublishSlotTypeService_0700', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishSlotTypeService_0700"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async (data) =>{ - console.info("===ACTS_PublishSlotTypeService_0700===createSubscriber"+JSON.stringify(data)); - ServiceDataFive = data - await Subscriber.subscribe(data, subServiceFiveCallBack) - }) - function subServiceFiveCallBack(err,data){ - console.log('===subServiceFourCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(ServiceDataFive,UnSubscribeCallBackv) - if(data.code == 35) { - expect(data.code).assertEqual(35) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - notification.publish({ - id: 35, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test35_title", - text: "test35_text", - additionalText: "test35_additionalText" - }, - }, - // slotType:notification.SlotType.SERVICE_INFORMATION - }).then(console.log("===ACTS_PublishSlotTypeService_0700 finished===")) - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeService_0700====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeService_0800 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:UNKNOWN_TYPE) promise - */ - it('ACTS_PublishSlotTypeService_0800', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishSlotTypeService_0800"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async (data) =>{ - console.info("===ACTS_PublishSlotTypeService_0800===createSubscriber"+JSON.stringify(data)); - ServiceDataSix = data - await Subscriber.subscribe(data, subServiceSixCallBack) - }) - function subServiceSixCallBack(err,data){ - console.log('===subServiceSixCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(ServiceDataSix,UnSubscribeCallBackw) - if(data.code == 36) { - expect(data.code).assertEqual(36) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - notification.publish({ - id: 36, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test36_title", - text: "test36_text", - additionalText: "test36_additionalText" - }, - }, - slotType:notification.SlotType.UNKNOWN_TYPE - }).then(console.log("===ACTS_PublishSlotTypeService_0800 finished===")) - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeService_0800====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_0100 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SOCIAL_COMMUNICATION) - */ - it('ACTS_PublishSlotTypeSocial_0100', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishSlotTypeSocial_0100"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async (data) =>{ - console.info("===ACTS_PublishSlotTypeSocial_0100===createSubscriber"+JSON.stringify(data)); - SocialDataOne = data - await Subscriber.subscribe(data, subSocialOneCallBack) - }) - function subSocialOneCallBack(err,data){ - console.log('===subSocialOneCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(SocialDataOne,UnSubscribeCallBackx) - if(data.code == 37) { - expect(data.code).assertEqual(37) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - await notification.publish({ - id: 37, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test37_title", - text: "test37_text", - additionalText: "test37_additionalText" - }, - slotType:notification.SlotType.SOCIAL_COMMUNICATION - } - },publishSlotSocialCallback001); - console.log("===ACTS_PublishSlotTypeSocial_0600 finished===") - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeSocial_0100====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_0200 - * @tc.name: publish() - * @tc.desc: verify the function of publish(slotType:SOCIAL_COMMUNICATION) - */ - it('ACTS_PublishSlotTypeSocial_0200', 0,async function (done) { - await notification.publish({ - id: 38, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - slotType:notification.SlotType.SOCIAL_COMMUNICATION - } - },publishSlotSocialCallback002); - console.log("===ACTS_PublishSlotTypeSocial_0600 finished===") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeSocial_0200====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_0300 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) - */ - it('ACTS_PublishSlotTypeSocial_0300', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishSlotTypeSocial_0300"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async (data) =>{ - console.info("===ACTS_PublishSlotTypeSocial_0300===createSubscriber"+JSON.stringify(data)); - SocialDataTwo = data - await Subscriber.subscribe(data, subSocialTwoCallBack) - }) - function subSocialTwoCallBack(err,data){ - console.log('===subSocialTwoCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(SocialDataTwo,UnSubscribeCallBacky) - if(data.code == 39) { - expect(data.code).assertEqual(39) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - await notification.publish({ - id: 39, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test39_title", - text: "test39_text", - additionalText: "test39_additionalText" - }, - // slotType:notification.SlotType.SOCIAL_COMMUNICATION - } - },publishSlotSocialCallback003); - console.log("===ACTS_PublishSlotTypeSocial_0300 finished===") - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeSocial_0300====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_0400 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:CONTENT_INFORMATION) - */ - it('ACTS_PublishSlotTypeSocial_0400', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishSlotTypeSocial_0400"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async (data) =>{ - console.info("===ACTS_PublishSlotTypeSocial_0400===createSubscriber"+JSON.stringify(data)); - SocialDataThree = data - await Subscriber.subscribe(data, subSocialThreeCallBack) - }) - function subSocialThreeCallBack(err,data){ - console.log('===subSocialThreeCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(SocialDataThree,UnSubscribeCallBackz) - if(data.code == 40) { - expect(data.code).assertEqual(40) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - await notification.publish({ - id: 40, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test40_title", - text: "test40_text", - additionalText: "test40_additionalText" - }, - slotType:notification.SlotType.CONTENT_INFORMATION - } - },publishSlotSocialCallback004); - console.log("===ACTS_PublishSlotTypeSocial_0400 finished===") - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeSocial_0400====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_0500 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:SOCIAL_COMMUNICATION) promise - */ - it('ACTS_PublishSlotTypeSocial_0500', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishSlotTypeSocial_0500"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async (data) =>{ - console.info("===ACTS_PublishSlotTypeSocial_0500===createSubscriber"+JSON.stringify(data)); - SocialDataFour = data - await Subscriber.subscribe(data, subSocialFourCallBack) - }) - function subSocialFourCallBack(err,data){ - console.log('===subSocialFourCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(SocialDataFour,UnSubscribeCallBackA) - if(data.code == 41) { - expect(data.code).assertEqual(41) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - notification.publish({ - id: 41, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test41_title", - text: "test41_text", - additionalText: "test41_additionalText" - }, - slotType:notification.SlotType.SOCIAL_COMMUNICATION - } - }).then(console.log("===ACTS_PublishSlotTypeSocial_0500 finished===")) - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeSocial_0500====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_0600 - * @tc.name: publish() - * @tc.desc: verify the function of publish(slotType:SOCIAL_COMMUNICATION) promise - */ - it('ACTS_PublishSlotTypeSocial_0600', 0,async function (done) { - var promise = notification.publish({ - id: 42, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - slotType:notification.SlotType.SOCIAL_COMMUNICATION - } - }) - expect(typeof(promise)).assertEqual("object") - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeSocial_0600====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_0700 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT) promise - */ - it('ACTS_PublishSlotTypeSocial_0700', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishSlotTypeSocial_0700"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async (data) =>{ - console.info("===ACTS_PublishSlotTypeSocial_0700===createSubscriber"+JSON.stringify(data)); - SocialDataFive = data - await Subscriber.subscribe(data, subSocialFiveCallBack) - }) - function subSocialFiveCallBack(err,data){ - console.log('===subSocialFiveCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(SocialDataFive,UnSubscribeCallBackB) - if(data.code == 43) { - expect(data.code).assertEqual(43) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - notification.publish({ - id: 43, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test43_title", - text: "test43_text", - additionalText: "test43_additionalText" - }, - //slotType:notification.SlotType.SOCIAL_COMMUNICATION - } - }).then(console.log("===ACTS_PublishSlotTypeSocial_0700 finished==="), - ) - setTimeout(function(){ - console.debug("====>time out ACTS_PublishSlotTypeSocial_0700====>"); - }, time); - }) - - /* - * @tc.number: ACTS_PublishSlotTypeSocial_0800 - * @tc.name: publish() - * @tc.desc: verify the function of publish(contentType:NOTIFICATION_CONTENT_BASIC_TEXT,slotType:CONTENT_INFORMATION) promise - */ - it('ACTS_PublishSlotTypeSocial_0800', 0,async function (done) { - var commonEventSubscribeInfo = { - events: ["ACTS_PublishSlotTypeSocial_0800"] - }; - await Subscriber.createSubscriber( - commonEventSubscribeInfo).then(async (data) =>{ - console.info("===ACTS_PublishSlotTypeSocial_0800===createSubscriber"+JSON.stringify(data)); - SocialDataSix = data - await Subscriber.subscribe(data, subSocialSixCallBack) - }) - function subSocialSixCallBack(err,data){ - console.log('===subSocialSixCallBack==='+err.code+JSON.stringify(data)) - Subscriber.unsubscribe(SocialDataSix,UnSubscribeCallBackC) - if(data.code == 44) { - expect(data.code).assertEqual(44) - done(); - } - else{ - expect().assertFail(); - done(); - } - } - notification.publish({ - id: 44, - content: { - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test44_title", - text: "test44_text", - additionalText: "test44_additionalText" - }, - slotType:notification.SlotType.CONTENT_INFORMATION - } - }).then(console.log("===ACTS_PublishSlotTypeSocial_0800 finished===")) - }) -})} diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/test/List.test.js deleted file mode 100644 index 8fc55ae2459c3f5b8a754e4d9fe991619eb36df7..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsNotificationTest from './ExampleJsunit.test.js' -export default function testsuite() { -ActsAnsNotificationTest() -} diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/resources/base/element/string.json deleted file mode 100644 index 502a089b01103c8b92804386164218e61745e4bd..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ContentType" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/publishcontentype/publishtype/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/BUILD.gn b/notification/ans_standard/publish_test/publishcontentype/sub/BUILD.gn deleted file mode 100644 index f11800a1d5bcceaf55b65719593d1df5ff4159d2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/sub/BUILD.gn +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("ActsAnsCommonEventTest") { - hap_profile = "./entry/src/main/config.json" - hap_name = "ActsAnsCommonEventTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" - testonly = true - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/config.json b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/config.json deleted file mode 100644 index 7318b0735593cd5ab0af6b9281729c67f3694c91..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/config.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanscommoneventtest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanscommoneventtest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsanscommoneventtest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 7f367d751c4d70d4adc241e94d92613b74bbc8be..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - Publishing CommonEvent - -
diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index 03d35a7573e3b6d8269ded8d41341a17e812391c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 6d530caefcdbe79f49db0b49fb864ed4daaeaac0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Sub1" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/test/List.test.js deleted file mode 100644 index 41999288d49304127387014dc88894130a148ab4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -require('./Subscriber.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/test/Subscriber.js b/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/test/Subscriber.js deleted file mode 100644 index c423113605fa3a8555673587ea9574b119a353c1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishcontentype/sub/entry/src/main/js/test/Subscriber.js +++ /dev/null @@ -1,578 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Subscriber from '@ohos.commonEvent' -import notification from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var multiLineDataOne -var multiLineDataTwo -var LongContentDataOne -var LongContentDataTwo -var SlotTypeDataOne -var SlotTypeDataTwo -var SlotTypeDataThree -var SlotTypeDataFour -var SlotTypeDataFive -var SlotTypeDataSix -var OtherDataOne -var OtherDataTwo -var OtherDataThree -var OtherDataFour -var OtherDataFive -var OtherDataSix -var ServiceDataOne -var ServiceDataTwo -var ServiceDataThree -var ServiceDataFour -var ServiceDataFive -var ServiceDataSix -var SocialDataOne -var SocialDataTwo -var SocialDataThree -var SocialDataFour -var SocialDataFive -var SocialDataSix -var time = 1000 -function publishCallbacka(err) { - console.info("===>publishCallbacka"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackb(err) { - console.info("===>publishCallbackb"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackc(err) { - console.info("===>publishCallbackc"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackd(err) { - console.info("===>publishCallbackd"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbacke(err) { - console.info("===>publishCallbacke"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackf(err) { - console.info("===>publishCallbackf"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackg(err) { - console.info("===>publishCallbackg"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackh(err) { - console.info("===>publishCallbackh"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbacki(err) { - console.info("===>publishCallbacki"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackj(err) { - console.info("===>publishCallbackj"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackl(err) { - console.info("===>publishCallbackl"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackm(err) { - console.info("===>publishCallbackm"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackn(err) { - console.info("===>publishCallbackn"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbacko(err) { - console.info("===>publishCallbacko"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackp(err) { - console.info("===>publishCallbackp"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackq(err) { - console.info("===>publishCallbackq"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackr(err) { - console.info("===>publishCallbackr"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbacks(err) { - console.info("===>publishCallbacks"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackt(err) { - console.info("===>publishCallbackt"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbacku(err) { - console.info("===>publishCallbacku"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackv(err) { - console.info("===>publishCallbackv"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackw(err) { - console.info("===>publishCallbackw"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackx(err) { - console.info("===>publishCallbackx"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbacky(err) { - console.info("===>publishCallbacky"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackz(err) { - console.info("===>publishCallbackz"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackA(err) { - console.info("===>publishCallbackA"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackB(err) { - console.info("===>publishCallbackB"+err.code); - expect(err.code).assertEqual(0); -} -function publishCallbackC(err) { - console.info("===>publishCallbackC"+err.code); - expect(err.code).assertEqual(0); -} -describe('ActsAnsCommonEventTest', function () { - console.info("==ActsAnsCommonEventTest start==>"); - //consume - function consumeCallback(data) { - console.debug("===>consumeCallback data===>" + JSON.stringify(data)); - if(data.request.id == 1) { - if(data.request.content.multiLine.title === "test1_title") - { - multiLineDataOne = { - code: 1 - } - } - else{ - multiLineDataOne = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishMULTILINEContent_0100", multiLineDataOne, publishCallbacka); - } - else if(data.request.id == 4){ - if(data.request.content.multiLine.title == "test4_title") - { - multiLineDataTwo = { - code: 4 - } - } - else{ - multiLineDataTwo = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishMULTILINEContent_0400", multiLineDataTwo, publishCallbackb); - }else if(data.request.id == 7){ - if(data.request.content.longText.title == "test7_title") - { - LongContentDataOne = { - code: 7 - } - } - else{ - LongContentDataOne = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishLONGContent_0100", LongContentDataOne, publishCallbackc); - } - else if(data.request.id == 10){ - if(data.request.content.longText.title == "test10_title") - { - LongContentDataTwo = { - code: 10 - } - } - else{ - LongContentDataTwo = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishLONGContent_0400", LongContentDataTwo, publishCallbackd); - } - else if(data.request.id == 13){ - if(data.request.content.normal.title == "test13_title") - { - SlotTypeDataOne = { - code: 13 - } - } - else{ - SlotTypeDataOne = { - code: 0 - } - } - Subscriber.publish("ACTS_Publish_SlotTypeContent_0100", SlotTypeDataOne, publishCallbacke); - } - else if(data.request.id == 15){ - if(data.request.content.normal.title == "test15_title") - { - SlotTypeDataTwo = { - code: 15 - } - } - else{ - SlotTypeDataTwo = { - code: 0 - } - } - Subscriber.publish("ACTS_Publish_SlotTypeContent_0300", SlotTypeDataTwo, publishCallbackf); - } - else if(data.request.id == 16){ - if(data.request.content.normal.title == "test16_title") - { - SlotTypeDataThree = { - code: 16 - } - } - else{ - SlotTypeDataThree = { - code: 0 - } - } - Subscriber.publish("ACTS_Publish_SlotTypeContent_0400", SlotTypeDataThree, publishCallbackg); - } - else if(data.request.id == 17){ - if(data.request.content.normal.title == "test17_title") - { - SlotTypeDataFour = { - code: 17 - } - } - else{ - SlotTypeDataFour = { - code: 0 - } - } - Subscriber.publish("ACTS_Publish_SlotTypeContent_0500", SlotTypeDataFour, publishCallbackh); - } - else if(data.request.id == 19){ - if(data.request.content.normal.title == "test19_title") - { - SlotTypeDataFive = { - code: 19 - } - } - else{ - SlotTypeDataFive = { - code: 0 - } - } - Subscriber.publish("ACTS_Publish_SlotTypeContent_0700", SlotTypeDataFive, publishCallbacki); - } - else if(data.request.id == 20){ - if(data.request.content.normal.title == "test20_title") - { - SlotTypeDataSix = { - code: 20 - } - } - else{ - SlotTypeDataSix = { - code: 0 - } - } - Subscriber.publish("ACTS_Publish_SlotTypeContent_0800", SlotTypeDataSix, publishCallbackj); - } - else if(data.request.id == 21){ - if(data.request.content.normal.title == "test21_title") - { - OtherDataOne = { - code: 21 - } - } - else{ - OtherDataOne = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishSlotTypeOther_0100", OtherDataOne, publishCallbackl); - } - else if(data.request.id == 23){ - if(data.request.content.normal.title == "test23_title") - { - OtherDataTwo = { - code: 23 - } - } - else{ - OtherDataTwo = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishSlotTypeOther_0300", OtherDataTwo, publishCallbackm); - } - else if(data.request.id == 24){ - if(data.request.content.normal.title == "test24_title") - { - OtherDataThree = { - code: 24 - } - } - else{ - OtherDataThree = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishSlotTypeOther_0400", OtherDataThree, publishCallbackn); - } - else if(data.request.id == 25){ - if(data.request.content.normal.title == "test25_title") - { - OtherDataFour = { - code: 25 - } - } - else{ - OtherDataFour = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishSlotTypeOther_0500", OtherDataFour, publishCallbacko); - } - else if(data.request.id == 27){ - if(data.request.content.normal.title == "test27_title") - { - OtherDataFive = { - code: 27 - } - } - else{ - OtherDataFive= { - code: 0 - } - } - Subscriber.publish("ACTS_PublishSlotTypeOther_0700", OtherDataFive, publishCallbackp); - } - else if(data.request.id == 28){ - if(data.request.content.normal.title == "test28_title") - { - OtherDataSix = { - code: 28 - } - } - else{ - OtherDataSix = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishSlotTypeOther_0800", OtherDataSix, publishCallbackq); - } - else if(data.request.id == 29){ - if(data.request.content.normal.title == "test29_title") - { - ServiceDataOne = { - code: 29 - } - } - else{ - ServiceDataOne = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishSlotTypeService_0100", ServiceDataOne, publishCallbackr); - } - else if(data.request.id == 31){ - if(data.request.content.normal.title == "test31_title") - { - ServiceDataTwo = { - code: 31 - } - } - else{ - ServiceDataTwo = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishSlotTypeService_0300", ServiceDataTwo, publishCallbacks); - } - else if(data.request.id == 32){ - if(data.request.content.normal.title == "test32_title") - { - ServiceDataThree = { - code: 32 - } - } - else{ - ServiceDataThree = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishSlotTypeService_0400", ServiceDataThree, publishCallbackt); - } - else if(data.request.id == 33){ - if(data.request.content.normal.title == "test33_title") - { - ServiceDataFour = { - code: 33 - } - } - else{ - ServiceDataFour = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishSlotTypeService_0500", ServiceDataFour, publishCallbacku); - } - else if(data.request.id == 35){ - if(data.request.content.normal.title == "test35_title") - { - ServiceDataFive = { - code: 35 - } - } - else{ - ServiceDataFive = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishSlotTypeService_0700", ServiceDataFive, publishCallbackv); - } - else if(data.request.id == 36){ - if(data.request.content.normal.title == "test36_title") - { - ServiceDataSix = { - code: 36 - } - } - else{ - ServiceDataSix = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishSlotTypeService_0800", ServiceDataSix, publishCallbackw); - } - else if(data.request.id == 37){ - if(data.request.content.normal.title == "test37_title") - { - SocialDataOne = { - code: 37 - } - } - else{ - SocialDataOne = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishSlotTypeSocial_0100", SocialDataOne, publishCallbackx); - } - else if(data.request.id == 39){ - if(data.request.content.normal.title == "test39_title") - { - SocialDataTwo= { - code: 39 - } - } - else{ - SocialDataTwo = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishSlotTypeSocial_0300", SocialDataTwo, publishCallbacky); - } - else if(data.request.id == 40){ - if(data.request.content.normal.title == "test40_title") - { - SocialDataThree = { - code: 40 - } - } - else{ - SocialDataThree = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishSlotTypeSocial_0400", SocialDataThree, publishCallbackz); - } - else if(data.request.id == 41){ - if(data.request.content.normal.title == "test41_title") - { - SocialDataFour = { - code: 41 - } - } - else{ - SocialDataFour = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishSlotTypeSocial_0500", SocialDataFour, publishCallbackA); - } - else if(data.request.id == 43){ - if(data.request.content.normal.title == "test43_title") - { - SocialDataFive = { - code: 43 - } - } - else{ - SocialDataFive = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishSlotTypeSocial_0700", SocialDataFive, publishCallbackB); - } - else if(data.request.id == 44){ - if(data.request.content.normal.title == "test44_title") - { - SocialDataSix = { - code: 44 - } - } - else{ - SocialDataSix = { - code: 0 - } - } - Subscriber.publish("ACTS_PublishSlotTypeSocial_0800", SocialDataSix, publishCallbackC); - } - } - //subscribeOn - function subscribeOnCallback() { - console.debug("===>onConnectCallback===>"); - } - /* - * @tc.number: ActsDoNotSubscriber_test_0100 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsCommonSubscriber_test_0100', 0, async function (done) { - console.debug("===ActsCommonSubscriber_test_0100====begin===>"); - var subInfo ={ - onConsume:consumeCallback, - onConnect:subscribeOnCallback, - } - await notification.subscribe(subInfo,(err) => { - console.debug("===>subscribeCallback===>"+err.code) - expect(err.code).assertEqual(0); - done() - }); - }) -}) - diff --git a/notification/ans_standard/publish_test/publishcontentype/sub/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/publishcontentype/sub/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/publishcontentype/sub/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/BUILD.gn b/notification/ans_standard/publish_test/publishremovalwantagent/BUILD.gn deleted file mode 100644 index 1aa720db1793af0319606ef65bc0fc96f3da69ee..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishremovalwantagent/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsPublishRemovalWantAgentTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsPublishRemovalWantAgentTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/Test.json b/notification/ans_standard/publish_test/publishremovalwantagent/Test.json deleted file mode 100644 index 84d03e29275efa706d473bea7e13365719f1d72d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishremovalwantagent/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "shell-timeout": "180000", - "bundle-name": "com.example.actsanspublishremovalwantagenttest", - "package-name": "com.example.actsanspublishremovalwantagenttest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsPublishRemovalWantAgentTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/publishremovalwantagent/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/publishremovalwantagent/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/config.json b/notification/ans_standard/publish_test/publishremovalwantagent/src/main/config.json deleted file mode 100644 index 30bc87892a1430a0b675a026b2907d60984eb971..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanspublishremovalwantagenttest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanspublishremovalwantagenttest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/MainAbility/app.js deleted file mode 100644 index 4f1747a95c4acbb66db5351e826c31584356e11c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index ce4e6b40edd7eb62ef3fc4d380c8bc597e79fae5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - Test of Publishing vibrating Notification - -
diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index ea04be4dfb189497d14d2e3cf69041742d6dee6e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,44 +0,0 @@ - -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import file from '@system.file' -import app from '@system.app' -import device from '@system.device' -import router from '@system.router' - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - const reportExtend = new ReportExtend(file) - core.addService('expect', expectExtend) - core.addService('report', reportExtend) - core.init() - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - } -} diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/test/ExampleJsunit.test.js deleted file mode 100644 index 4a4b1862233c3197d1fc50ec2f8f4df3a07ce9a2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/test/ExampleJsunit.test.js +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import notify from '@ohos.notification' -import WantAgent from '@ohos.wantAgent' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -var timeout = 1000; -export default function ActsAnsPublishRemovalWantAgentTest() { -describe('ActsAnsPublishRemovalWantAgentTest', function () { - console.info("===========ActsAnsPublishRemovalWantAgentTest start====================>"); - - /* - * @tc.number: ACTS_PublishRemovalWantAgent_xts_0100 - * @tc.name: removalWantAgent - * @tc.desc: publish removalWantAgent notification - */ - function consumeCallback(data) { - console.info("===>consumeCallback data : ===>" +JSON.stringify(data)); - var wantAgentObj = data.removalWantAgent - console.info("===>wantAgent: ===>" + JSON.stringify(wantAgentObj)) - WantAgent.getWant(wantAgentObj).then((data) => { - expect(data[0].action).assertEqual("usual.event.REMOVAL_WANTAGENT"); - }); - } - - it('ACTS_PublishRemovalWantAgent_xts_0100', 0, async function (done) { - console.info("===ACTS_PublishRemovalWantAgent_xts_0100===begin===>"); - var subInfo ={ - onConsume:consumeCallback - } - notify.subscribe(subInfo); - - var agentInfo = { - wants: [ - { - bundleName: 'com.example.actsanspublishremovalwantagenttest', - abilityName: 'com.example.actsanspublishremovalwantagenttest.MainAbility', - action: "usual.event.REMOVAL_WANTAGENT" - } - ], - operationType: WantAgent.OperationType.SEND_COMMON_EVENT, - requestCode: 0, - wantAgentFlags:[WantAgent.WantAgentFlags.ONE_TIME_FLAG] - }; - - var wantAgentData = await WantAgent.getWantAgent(agentInfo); - - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_LONG_TEXT, - longText : { - title: "test_title", - text: "test_text", - additionalText: "test_PublishRemovalWantAgent", - longText: "longText123456", - briefText: "briefText123456", - expandedTitle: "expandedTitle123456" - }, - }, - id: 1, - slotType : notify.SlotType.SERVICE_INFORMATION, - removalWantAgent : wantAgentData - } - console.info("===ACTS_PublishRemovalWantAgent_xts_0100===publish===>"); - await notify.publish(notificationRequest, (err) => { - console.info("===>publish callback===>"+err.code); - expect(err.code).assertEqual(0) - }); - console.info("===ACTS_PublishRemovalWantAgent_xts_0100===end===>"); - - setTimeout((async function(){ - notify.unsubscribe(subInfo); - console.info("======ACTS_PublishRemovalWantAgent_xts_0100 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - /* - * @tc.number: SetEnabledForUninstallApp_test_0100 - * @tc.name: set and get enabled when distributed device without app - * @tc.desc: set true and get true - */ - it('SetEnabledForUninstallApp_test_0100', 0, async function (done) { - await notify.setSyncNotificationEnabledWithoutApp( - 100,true,async() => { - await notify.getSyncNotificationEnabledWithoutApp(100, (err,data) => { - console.log("===>getSyncNotificationEnabledWithoutApp===>"+err+data) - expect(data).assertEqual(true) - done(); - }) - }) - }) - - /* - * @tc.number: SetEnabledForUninstallApp_test_0200 - * @tc.name: set and get enabled when distributed device without app - * @tc.desc: set false and get false - */ - it('SetEnabledForUninstallApp_test_0200', 0, async function (done) { - await notify.setSyncNotificationEnabledWithoutApp( - 100,false,async() => { - await notify.getSyncNotificationEnabledWithoutApp(100, (err,data) => { - console.log("===>getSyncNotificationEnabledWithoutApp===>"+err+data) - expect(data).assertEqual(false) - done(); - }) - }) - }) - - /* - * @tc.number: SetEnabledForUninstallApp_test_0300 - * @tc.name: set and get enabled when distributed device without app (promise) - * @tc.desc: set true and get true - */ - it('SetEnabledForUninstallApp_test_0300', 0, async function (done) { - notify.setSyncNotificationEnabledWithoutApp(100, true).then(() => { - notify.getSyncNotificationEnabledWithoutApp(100).then((data) => { - console.log("===>getSyncNotificationEnabledWithoutApp===>"+data) - expect(data).assertEqual(true) - done(); - }).catch((err) => { - Logger.error(TAG, - `===>getSyncNotificationEnabledWithoutApp failed because ${JSON.stringify(err)}`); - }); - }).catch((err) => { - Logger.error(TAG, `===>setSyncNotificationEnabledWithoutApp failed because ${JSON.stringify(err)}`); - }); - }) -}) } diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/test/List.test.js deleted file mode 100644 index ae0f3613bf4343baf62b394c2e261c30ec81d1cb..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import ActsAnsPublishRemovalWantAgentTest from './ExampleJsunit.test.js' -export default function testsuite() { -ActsAnsPublishRemovalWantAgentTest() -} diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/publishremovalwantagent/src/main/resources/base/element/string.json deleted file mode 100644 index 37434ea7ff0abc3a132e85b7f7727c1429e84cf2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "PubVibra" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/publishremovalwantagent/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/publishremovalwantagent/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/publishsound/BUILD.gn b/notification/ans_standard/publish_test/publishsound/BUILD.gn deleted file mode 100644 index 0dce2f6e17e12513a70ef28f72acb99d9e9442ca..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishsound/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsPublishSoundTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsPublishSoundTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/publishsound/Test.json b/notification/ans_standard/publish_test/publishsound/Test.json deleted file mode 100644 index 69ab6d567cbe3bddbdd0d066dd7fe2be276a7669..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishsound/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "60000", - "shell-timeout": "60000", - "bundle-name": "com.example.actsanspublishsoundtest", - "package-name": "com.example.actsanspublishsoundtest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsPublishSoundTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishsound/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/publishsound/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/publishsound/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/publishsound/src/main/config.json b/notification/ans_standard/publish_test/publishsound/src/main/config.json deleted file mode 100644 index 4492820516c8c3fd9bfbc33353677fb86f171fe5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishsound/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanspublishsoundtest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanspublishsoundtest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishsound/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/publishsound/src/main/js/MainAbility/app.js deleted file mode 100644 index 4f1747a95c4acbb66db5351e826c31584356e11c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishsound/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/publishsound/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/publishsound/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishsound/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishsound/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/publishsound/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishsound/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishsound/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/publishsound/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishsound/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/publishsound/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/publishsound/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 517b7c3527ee9850013beab7d3432d086229ec19..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishsound/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - Test of Publishing Voice Notification - -
diff --git a/notification/ans_standard/publish_test/publishsound/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/publishsound/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 09b901119e09e1943c64d1ea0d855188fbe203a3..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishsound/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,32 +0,0 @@ - -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import file from '@system.file' -import app from '@system.app' -import device from '@system.device' -import router from '@system.router' - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - - } -} diff --git a/notification/ans_standard/publish_test/publishsound/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/publishsound/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishsound/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/publishsound/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/publishsound/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishsound/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishsound/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/publishsound/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishsound/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishsound/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/publishsound/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishsound/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishsound/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/publishsound/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishsound/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/publishsound/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/publishsound/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishsound/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/publishsound/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/publishsound/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishsound/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/publishsound/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/publish_test/publishsound/src/main/js/test/ExampleJsunit.test.js deleted file mode 100644 index 7edb397f3667d73d40259bc7230f385ce5094358..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishsound/src/main/js/test/ExampleJsunit.test.js +++ /dev/null @@ -1,1028 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -export default function ActsAnsPublishSoundTest() { -describe('ActsAnsPublishSoundTest', function () { - console.info("===========ActsAnsPublishSoundTest start====================>"); - var timeout = 1000 - var bundleoption = { - bundle: "com.example.actsanspublishsoundtest" - } - var timesOfOnConsume - function onConsume0100(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishSound_0100 onConsume start============>"); - console.info("=============Ans_PublishSound_0100 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var sound = data.sortingMap.sortings[hashCode].slot.sound - console.info("=============Ans_PublishSound_0100 onConsume sound============>" + sound); - if (timesOfOnConsume == 1){ - expect(sound != undefined).assertTrue(); - console.info("=============Ans_PublishSound_0100 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(sound).assertEqual("sound_0100"); - console.info("=============Ans_PublishSound_0100 onConsume timesOfOnConsume2============>"); - } - console.info("=============Ans_PublishSound_0100 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishSound_0100 - * @tc.name: addSlot(type: SlotType): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a SOCIAL_COMMUNICATION type slot, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishSound_0100', 0,async function (done) { - console.info("===============Ans_PublishSound_0100================>"); - timesOfOnConsume = 0; - var subscriber ={ - onConsume:onConsume0100 - } - notify.subscribe(subscriber); - console.info("===============Ans_PublishSound_0100 subscribe======>"); - notify.addSlot(notify.SlotType.SOCIAL_COMMUNICATION); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 1, - slotType : notify.SlotType.SOCIAL_COMMUNICATION, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0100", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishSound_0100 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.SOCIAL_COMMUNICATION, - sound:"sound_0100", - }).then(()=>{ - console.info("=======Ans_PublishSound_0100 setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishSound_0100 setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishSound_0100 setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishSound_0100 publish1 then catch err======>"+err); - }) - setTimeout((async function(){ - console.info("======Ans_PublishSound_0100 setTimeout========>"); - notify.removeSlot(notify.SlotType.SOCIAL_COMMUNICATION); - notify.unsubscribe(subscriber); - console.info("======Ans_PublishSound_0100 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume0200(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishSound_0200 onConsume start============>"); - console.info("=============Ans_PublishSound_0200 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var sound = data.sortingMap.sortings[hashCode].slot.sound - console.info("=============Ans_PublishSound_0200 onConsume sound============>" + sound); - if (timesOfOnConsume == 1){ - expect(sound != undefined).assertTrue(); - console.info("=============Ans_PublishSound_0200 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(sound).assertEqual("sound_0200"); - console.info("=============Ans_PublishSound_0200 onConsume timesOfOnConsume2============>"); - } - console.info("=============Ans_PublishSound_0200 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishSound_0200 - * @tc.name: addSlot(type: SlotType): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a SERVICE_INFORMATION type slot, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishSound_0200', 0,async function (done) { - console.info("===============Ans_PublishSound_0200================>"); - timesOfOnConsume = 0; - var subscriber ={ - onConsume:onConsume0200 - } - notify.subscribe(subscriber); - console.info("===============Ans_PublishSound_0200 subscribe======>"); - notify.addSlot(notify.SlotType.SERVICE_INFORMATION); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 2, - slotType : notify.SlotType.SERVICE_INFORMATION , - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0200", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishSound_0200 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.SERVICE_INFORMATION , - sound:"sound_0200", - }).then(()=>{ - console.info("=======Ans_PublishSound_0200 setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishSound_0200 setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishSound_0200 setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishSound_0200 publish1 then catch err======>"+err); - }) - setTimeout((async function(){ - console.info("======Ans_PublishSound_0200 setTimeout========>"); - notify.removeSlot(notify.SlotType.SERVICE_INFORMATION); - notify.unsubscribe(subscriber); - console.info("======Ans_PublishSound_0200 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume0300(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishSound_0300 onConsume start============>"); - console.info("=============Ans_PublishSound_0300 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var sound = data.sortingMap.sortings[hashCode].slot.sound - console.info("=============Ans_PublishSound_0300 onConsume sound============>" + sound); - if (timesOfOnConsume == 1){ - expect(sound).assertEqual(""); - console.info("=========Ans_PublishSound_0300 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(sound).assertEqual("sound_0300"); - console.info("=========Ans_PublishSound_0300 onConsume timesOfOnConsume2============>"); - } - console.info("=============Ans_PublishSound_0300 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishSound_0300 - * @tc.name: addSlot(type: SlotType): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a CONTENT_INFORMATION type slot, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishSound_0300', 0,async function (done) { - console.info("===============Ans_PublishSound_0300================>"); - timesOfOnConsume = 0; - var subscriber ={ - onConsume:onConsume0300 - } - notify.subscribe(subscriber); - console.info("===============Ans_PublishSound_0300 subscribe======>"); - notify.addSlot(notify.SlotType.CONTENT_INFORMATION); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 3, - slotType : notify.SlotType.CONTENT_INFORMATION, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0300", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishSound_0300 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.CONTENT_INFORMATION, - sound:"sound_0300", - }).then(()=>{ - console.info("=======Ans_PublishSound_0300 setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishSound_0300 setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishSound_0300 setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishSound_0300 publish1 then catch err======>"+err); - }) - - setTimeout((async function(){ - console.info("======Ans_PublishSound_0300 setTimeout========>"); - notify.removeSlot(notify.SlotType.CONTENT_INFORMATION); - notify.unsubscribe(subscriber); - console.info("======Ans_PublishSound_0300 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume0400(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishSound_0400 onConsume start============>"); - console.info("=============Ans_PublishSound_0400 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var sound = data.sortingMap.sortings[hashCode].slot.sound - console.info("=============Ans_PublishSound_0400 onConsume sound============>" + sound); - if (timesOfOnConsume == 1){ - expect(sound).assertEqual(""); - console.info("=========Ans_PublishSound_0400 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(sound).assertEqual("sound_0400"); - console.info("=========Ans_PublishSound_0400 onConsume timesOfOnConsume2============>"); - } - console.info("=============Ans_PublishSound_0400 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishSound_0400 - * @tc.name: addSlot(type: SlotType): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a OTHER_TYPES type slot, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishSound_0400', 0,async function (done) { - console.info("===============Ans_PublishSound_0400================>"); - timesOfOnConsume = 0; - var subscriber = { - onConsume:onConsume0400 - } - notify.subscribe(subscriber); - console.info("===============Ans_PublishSound_0400 subscribe======>"); - notify.addSlot(notify.SlotType.OTHER_TYPES); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 4, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0400", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishSound_0400 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.OTHER_TYPES, - sound:"sound_0400", - }).then(()=>{ - console.info("=======Ans_PublishSound_0400 setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishSound_0400 setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishSound_0400 setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishSound_0400 publish1 then catch err======>"+err); - }) - setTimeout((async function(){ - console.info("======Ans_PublishSound_0400 setTimeout========>"); - notify.removeSlot(notify.SlotType.OTHER_TYPES); - notify.unsubscribe(subscriber); - console.info("======Ans_PublishSound_0400 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume0500(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishSound_0500 onConsume start============>"); - console.info("=============Ans_PublishSound_0500 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var sound = data.sortingMap.sortings[hashCode].slot.sound - console.info("=============Ans_PublishSound_0500 onConsume sound============>" + sound); - if (timesOfOnConsume == 1){ - expect(sound).assertEqual(""); - console.info("=========Ans_PublishSound_0500 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(sound).assertEqual("sound_0500"); - console.info("=========Ans_PublishSound_0500 onConsume timesOfOnConsume2============>"); - } - console.info("=============Ans_PublishSound_0500 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishSound_0500 - * @tc.name: addSlot(type: SlotType): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a UNKNOWN_TYPE type slot, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishSound_0500', 0,async function (done) { - console.info("===============Ans_PublishSound_0500================>"); - timesOfOnConsume = 0; - var subscriber = { - onConsume:onConsume0500 - } - notify.subscribe(subscriber); - console.info("===============Ans_PublishSound_0500 subscribe======>"); - notify.addSlot(notify.SlotType.UNKNOWN_TYPE); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 5, - slotType : notify.SlotType.UNKNOWN_TYPE, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0500", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishSound_0500 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.OTHER_TYPES, - sound:"sound_0500", - }).then(()=>{ - console.info("=======Ans_PublishSound_0500 setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishSound_0500 setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishSound_0500 setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishSound_0500 publish1 then catch err======>"+err); - }) - setTimeout((async function(){ - console.info("======Ans_PublishSound_0500 setTimeout========>"); - notify.removeSlot(notify.SlotType.UNKNOWN_TYPE); - notify.unsubscribe(subscriber); - console.info("======Ans_PublishSound_0500 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume0600(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishSound_0600 onConsume start============>"); - console.info("=============Ans_PublishSound_0600 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var sound = data.sortingMap.sortings[hashCode].slot.sound - console.info("=============Ans_PublishSound_0600 onConsume sound============>" + sound); - if (timesOfOnConsume == 1){ - expect(sound).assertEqual("sound_0600"); - console.info("=============Ans_PublishSound_0600 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(sound).assertEqual("sound_0600_set"); - console.info("=============Ans_PublishSound_0600 onConsume timesOfOnConsume2============>"); - } - console.info("=============Ans_PublishSound_0600 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishSound_0600 - * @tc.name: addSlot(slot: NotificationSlot): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a SOCIAL_COMMUNICATION type slot, set sound information, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishSound_0600', 0,async function (done) { - console.info("===============Ans_PublishSound_0600================>"); - timesOfOnConsume = 0; - var subscriber ={ - onConsume:onConsume0600 - } - notify.subscribe(subscriber); - console.info("===============Ans_PublishSound_0600 subscribe======>"); - notify.addSlot({ - type:notify.SlotType.SOCIAL_COMMUNICATION, - sound:"sound_0600", - }); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 6, - slotType : notify.SlotType.SOCIAL_COMMUNICATION, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0600", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishSound_0600 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.SOCIAL_COMMUNICATION, - sound:"sound_0600_set", - }).then(()=>{ - console.info("=======Ans_PublishSound_0600 setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishSound_0600 setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishSound_0600 setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishSound_0600 publish1 then catch err======>"+err); - }) - setTimeout((async function(){ - console.info("======Ans_PublishSound_0600 setTimeout========>"); - notify.removeSlot(notify.SlotType.SOCIAL_COMMUNICATION); - notify.unsubscribe(subscriber); - console.info("======Ans_PublishSound_0600 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume0700(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishSound_0700 onConsume start============>"); - console.info("=============Ans_PublishSound_0700 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var sound = data.sortingMap.sortings[hashCode].slot.sound - console.info("=============Ans_PublishSound_0700 onConsume sound============>" + sound); - if (timesOfOnConsume == 1){ - expect(sound).assertEqual("sound_0700"); - console.info("=============Ans_PublishSound_0700 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(sound).assertEqual("sound_0700_set"); - console.info("=============Ans_PublishSound_0700 onConsume timesOfOnConsume2============>"); - } - console.info("=============Ans_PublishSound_0700 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishSound_0700 - * @tc.name: addSlot(slot: NotificationSlot): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a SERVICE_INFORMATION type slot, set sound information, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishSound_0700', 0,async function (done) { - console.info("===============Ans_PublishSound_0700================>"); - timesOfOnConsume = 0; - var subscriber ={ - onConsume:onConsume0700 - } - notify.subscribe(subscriber); - console.info("===============Ans_PublishSound_0700v subscribe======>"); - notify.addSlot({ - type:notify.SlotType.SERVICE_INFORMATION, - sound:"sound_0700", - }); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 7, - slotType : notify.SlotType.SERVICE_INFORMATION , - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0700", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishSound_0700 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.SERVICE_INFORMATION , - sound:"sound_0700_set", - }).then(()=>{ - console.info("=======Ans_PublishSound_0700 setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishSound_0700 setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishSound_0700 setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishSound_0700 publish1 then catch err======>"+err); - }) - setTimeout((async function(){ - console.info("======Ans_PublishSound_0700 setTimeout========>"); - notify.removeSlot(notify.SlotType.SERVICE_INFORMATION); - notify.unsubscribe(subscriber); - console.info("======Ans_PublishSound_0700 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume0800(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishSound_0800 onConsume start============>"); - console.info("=============Ans_PublishSound_0800 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var sound = data.sortingMap.sortings[hashCode].slot.sound - console.info("=============Ans_PublishSound_0800 onConsume sound============>" + sound); - if (timesOfOnConsume == 1){ - expect(sound).assertEqual("sound_0800"); - console.info("=========Ans_PublishSound_0800 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(sound).assertEqual("sound_0800_set"); - console.info("=========Ans_PublishSound_0800 onConsume timesOfOnConsume2============>"); - } - console.info("=============Ans_PublishSound_0800 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishSound_0800 - * @tc.name: addSlot(slot: NotificationSlot): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a CONTENT_INFORMATION type slot, set sound information, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishSound_0800', 0,async function (done) { - console.info("===============Ans_PublishSound_0800================>"); - timesOfOnConsume = 0; - var subscriber ={ - onConsume:onConsume0800 - } - notify.subscribe(subscriber); - console.info("===============Ans_PublishSound_0800 subscribe======>"); - notify.addSlot({ - type:notify.SlotType.CONTENT_INFORMATION, - sound:"sound_0800", - }); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 8, - slotType : notify.SlotType.CONTENT_INFORMATION, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0800", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishSound_0800 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.CONTENT_INFORMATION, - sound:"sound_0800_set", - }).then(()=>{ - console.info("=======Ans_PublishSound_0800 setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishSound_0800 setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishSound_0800 setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishSound_0800 publish1 then catch err======>"+err); - }) - setTimeout((async function(){ - console.info("======Ans_PublishSound_0800 setTimeout========>"); - notify.removeSlot(notify.SlotType.CONTENT_INFORMATION); - notify.unsubscribe(subscriber); - console.info("======Ans_PublishSound_0800 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume0900(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishSound_0900 onConsume start============>"); - console.info("=============Ans_PublishSound_0900 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var sound = data.sortingMap.sortings[hashCode].slot.sound - console.info("=============Ans_PublishSound_0900 onConsume sound============>" + sound); - if (timesOfOnConsume == 1){ - expect(sound).assertEqual("sound_0900"); - console.info("=========Ans_PublishSound_0900 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(sound).assertEqual("sound_0900_set"); - console.info("=========Ans_PublishSound_0900 onConsume timesOfOnConsume2============>"); - } - console.info("=============Ans_PublishSound_0900 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishSound_0900 - * @tc.name: addSlot(slot: NotificationSlot): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a OTHER_TYPES type slot, set sound information, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishSound_0900', 0,async function (done) { - console.info("===============Ans_PublishSound_0900================>"); - timesOfOnConsume = 0; - var subscriber = { - onConsume:onConsume0900 - } - notify.subscribe(subscriber); - console.info("===============Ans_PublishSound_0900 subscribe======>"); - notify.addSlot({ - type:notify.SlotType.OTHER_TYPES, - sound:"sound_0900", - }); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 3, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0300", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishSound_0900 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.OTHER_TYPES, - sound:"sound_0900_set", - }).then(()=>{ - console.info("=======Ans_PublishSound_0900 setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishSound_0900 setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishSound_0900 setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishSound_0900 publish1 then catch err======>"+err); - }) - - setTimeout((async function(){ - console.info("======Ans_PublishSound_0900 setTimeout========>"); - notify.removeSlot(notify.SlotType.OTHER_TYPES); - notify.unsubscribe(subscriber); - console.info("======Ans_PublishSound_0900 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume1000(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishSound_1000 onConsume start============>"); - console.info("=============Ans_PublishSound_1000 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var sound = data.sortingMap.sortings[hashCode].slot.sound - console.info("=============Ans_PublishSound_1000 onConsume sound============>" + sound); - if (timesOfOnConsume == 1){ - expect(sound).assertEqual("sound_1000"); - console.info("=========Ans_PublishSound_1000 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(sound).assertEqual("sound_1000_set"); - console.info("=========Ans_PublishSound_1000 onConsume timesOfOnConsume2============>"); - } - console.info("=============Ans_PublishSound_1000 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishSound_1000 - * @tc.name: addSlot(slot: NotificationSlot): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a UNKNOWN_TYPE type slot, set sound information, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishSound_1000', 0,async function (done) { - console.info("===============Ans_PublishSound_1000================>"); - timesOfOnConsume = 0; - var subscriber = { - onConsume:onConsume1000 - } - notify.subscribe(subscriber); - console.info("===============Ans_PublishSound_1000 subscribe======>"); - notify.addSlot({ - type:notify.SlotType.UNKNOWN_TYPE, - sound:"sound_1000", - }); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 10, - slotType : notify.SlotType.UNKNOWN_TYPE, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "1000", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishSound_1000 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.UNKNOWN_TYPE, - sound:"sound_1000_set", - }).then(()=>{ - console.info("=======Ans_PublishSound_1000 publish1 then setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishSound_1000 publish1 then setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishSound_1000 publish1 then setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishSound_1000 publish1 then catch err======>"+err); - }) - - setTimeout((async function(){ - console.info("======Ans_PublishSound_1000 setTimeout========>"); - notify.removeSlot(notify.SlotType.UNKNOWN_TYPE); - notify.unsubscribe(subscriber); - console.info("======Ans_PublishSound_1000 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume1100(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishSound_1100 onConsume start============>"); - console.info("=============Ans_PublishSound_1100 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var sound = data.sortingMap.sortings[hashCode].slot.sound - var vibrationValues = data.sortingMap.sortings[hashCode].slot.vibrationValues - var vibrationEnabled = data.sortingMap.sortings[hashCode].slot.vibrationEnabled - console.info("=============Ans_PublishSound_1100 onConsume vibrationValues============>" + vibrationValues); - console.info("=============Ans_PublishSound_1100 onConsume vibrationEnabled============>" + vibrationEnabled); - console.info("=============Ans_PublishSound_1100 onConsume sound============>" + sound); - if (timesOfOnConsume == 1){ - expect(sound).assertEqual("sound_1100"); - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([11,0,11,0])); - expect(vibrationEnabled).assertEqual(true); - console.info("=========Ans_PublishSound_1100 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(sound).assertEqual("sound_1100_set"); - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([11,11,11,11])); - expect(vibrationEnabled).assertEqual(true); - console.info("=========Ans_PublishSound_1100 onConsume timesOfOnConsume2============>"); - } - console.info("=============Ans_PublishSound_1100 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishSound_1100 - * @tc.name: addSlot(slot: NotificationSlot): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a UNKNOWN_TYPE type slot, set sound and vibra information, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishSound_1100', 0,async function (done) { - console.info("===============Ans_PublishSound_1100================>"); - timesOfOnConsume = 0; - var subscriber = { - onConsume:onConsume1100 - } - notify.subscribe(subscriber); - console.info("===============Ans_PublishSound_1100 subscribe======>"); - notify.addSlot({ - type:notify.SlotType.UNKNOWN_TYPE, - sound:"sound_1100", - vibrationEnabled:true, - vibrationValues:[11,0,11,0], - }); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 10, - slotType : notify.SlotType.UNKNOWN_TYPE, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "1000", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishSound_1100 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.UNKNOWN_TYPE, - sound:"sound_1100_set", - vibrationEnabled:true, - vibrationValues:[11,11,11,11], - }).then(()=>{ - console.info("=======Ans_PublishSound_1100 publish1 then setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishSound_1100 publish1 then setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishSound_1100 publish1 then setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishSound_1100 publish1 then catch err======>"+err); - }) - - setTimeout((async function(){ - console.info("======Ans_PublishSound_1100 setTimeout========>"); - notify.removeSlot(notify.SlotType.UNKNOWN_TYPE); - notify.unsubscribe(subscriber); - console.info("======Ans_PublishSound_1100 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); -}) -} diff --git a/notification/ans_standard/publish_test/publishsound/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/publishsound/src/main/js/test/List.test.js deleted file mode 100644 index fc1a8c026ff465bad889cb3a33562e2d3fe12990..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishsound/src/main/js/test/List.test.js +++ /dev/null @@ -1,19 +0,0 @@ -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -require('./ExampleJsunit.test.js') -import ActsAnsPublishSoundTest from './ExampleJsunit.test.js' -export default function testsuite() { -ActsAnsPublishSoundTest() -} diff --git a/notification/ans_standard/publish_test/publishsound/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/publishsound/src/main/resources/base/element/string.json deleted file mode 100644 index 69e46fab201e47448fca1c14d769b4b19f54a1c4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishsound/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "pubSound" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishsound/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/publishsound/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/publishsound/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/publishvibra/BUILD.gn b/notification/ans_standard/publish_test/publishvibra/BUILD.gn deleted file mode 100644 index 1d83f83054a3a00f37bbbb444cf45e2130ceb703..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishvibra/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsPublishVibraTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsPublishVibraTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/publishvibra/Test.json b/notification/ans_standard/publish_test/publishvibra/Test.json deleted file mode 100644 index 7a299046fbb38e232c041620fa13d6a22c426839..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishvibra/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "shell-timeout": "180000", - "bundle-name": "com.example.actsanspublishvibratest", - "package-name": "com.example.actsanspublishvibratest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsPublishVibraTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishvibra/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/publishvibra/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/publishvibra/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/publishvibra/src/main/config.json b/notification/ans_standard/publish_test/publishvibra/src/main/config.json deleted file mode 100644 index ae4d4a614355c23df83ce1f8eec33baafe566e4f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishvibra/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanspublishvibratest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanspublishvibratest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishvibra/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/publishvibra/src/main/js/MainAbility/app.js deleted file mode 100644 index 4f1747a95c4acbb66db5351e826c31584356e11c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishvibra/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/publishvibra/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/publishvibra/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishvibra/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishvibra/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/publishvibra/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishvibra/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishvibra/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/publishvibra/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishvibra/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/publishvibra/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/publishvibra/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index ce4e6b40edd7eb62ef3fc4d380c8bc597e79fae5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishvibra/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - Test of Publishing vibrating Notification - -
diff --git a/notification/ans_standard/publish_test/publishvibra/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/publishvibra/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index cedc552d2c6861b286c9c08bdaafb93be8964e16..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishvibra/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,31 +0,0 @@ - -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import file from '@system.file' -import app from '@system.app' -import device from '@system.device' -import router from '@system.router' - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - } -} diff --git a/notification/ans_standard/publish_test/publishvibra/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/publishvibra/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishvibra/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/publishvibra/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/publishvibra/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishvibra/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishvibra/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/publishvibra/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishvibra/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishvibra/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/publishvibra/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishvibra/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishvibra/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/publishvibra/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishvibra/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/publishvibra/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/publishvibra/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishvibra/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/publishvibra/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/publishvibra/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishvibra/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/publishvibra/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/publish_test/publishvibra/src/main/js/test/ExampleJsunit.test.js deleted file mode 100644 index 2d7dfe78c8425d51a3e951573f912a1be4e910e8..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishvibra/src/main/js/test/ExampleJsunit.test.js +++ /dev/null @@ -1,1122 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -export default function ActsAnsPublishVibraTest() { -describe('ActsAnsPublishVibraTest', function () { - console.info("===========ActsAnsPublishVibraTest start====================>"); - var timeout = 200 - var bundleoption = { - bundle: "com.example.actsanspublishvibratest" - } - var timesOfOnConsume - function onConsume0100(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishVibra_0100 onConsume start============>"); - console.info("=============Ans_PublishVibra_0100 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var vibrationValues = data.sortingMap.sortings[hashCode].slot.vibrationValues - var vibrationEnabled = data.sortingMap.sortings[hashCode].slot.vibrationEnabled - console.info("=============Ans_PublishVibra_0100 onConsume vibrationValues============>" + vibrationValues); - console.info("=============Ans_PublishVibra_0200 onConsume vibrationEnabled============>" + vibrationEnabled); - if (timesOfOnConsume == 1){ - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([200])); - expect(vibrationEnabled).assertEqual(true); - console.info("=============Ans_PublishVibra_0100 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([1,0,1,0])); - expect(vibrationEnabled).assertEqual(true); - console.info("=============Ans_PublishVibra_0100 onConsume timesOfOnConsume2============>"); - } - console.info("=============Ans_PublishVibra_0100 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishVibra_0100 - * @tc.name: addSlot(type: SlotType): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a SOCIAL_COMMUNICATION type slot, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishVibra_0100', 0,async function (done) { - console.info("===============Ans_PublishVibra_0100================>"); - timesOfOnConsume = 0; - var subscriber ={ - onConsume:onConsume0100 - } - await notify.subscribe(subscriber); - console.info("===============Ans_PublishVibra_0100 subscribe======>"); - await notify.addSlot(notify.SlotType.SOCIAL_COMMUNICATION); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 1, - slotType : notify.SlotType.SOCIAL_COMMUNICATION, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0100", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishVibra_0100 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.SOCIAL_COMMUNICATION, - vibrationValues:[1,0,1,0], - }).then(()=>{ - console.info("=======Ans_PublishVibra_0100 setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishVibra_0100 setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_0100 setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_0100 publish1 then catch err======>"+err); - }) - setTimeout((async function(){ - console.info("======Ans_PublishVibra_0100 setTimeout========>"); - await notify.removeSlot(notify.SlotType.SOCIAL_COMMUNICATION); - await notify.unsubscribe(subscriber); - console.info("======Ans_PublishVibra_0100 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume0200(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishVibra_0200 onConsume start============>"); - console.info("=============Ans_PublishVibra_0200 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var vibrationValues = data.sortingMap.sortings[hashCode].slot.vibrationValues - var vibrationEnabled = data.sortingMap.sortings[hashCode].slot.vibrationEnabled - console.info("=============Ans_PublishVibra_0200 onConsume vibrationValues============>" + vibrationValues); - console.info("=============Ans_PublishVibra_0200 onConsume vibrationEnabled============>" + vibrationEnabled); - if (timesOfOnConsume == 1){ - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([200])); - expect(vibrationEnabled).assertEqual(true); - console.info("=============Ans_PublishVibra_0200 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([2,0,2,0])); - expect(vibrationEnabled).assertEqual(true); - console.info("=============Ans_PublishVibra_0200 onConsume timesOfOnConsume2============>"); - } - console.info("=============Ans_PublishVibra_0200 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishVibra_0200 - * @tc.name: addSlot(type: SlotType): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a SERVICE_INFORMATION type slot, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishVibra_0200', 0,async function (done) { - console.info("===============Ans_PublishVibra_0200================>"); - timesOfOnConsume = 0; - var subscriber ={ - onConsume:onConsume0200 - } - await notify.subscribe(subscriber); - console.info("===============Ans_PublishVibra_0200 subscribe======>"); - await notify.addSlot(notify.SlotType.SERVICE_INFORMATION); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 2, - slotType : notify.SlotType.SERVICE_INFORMATION , - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0200", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishVibra_0200 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.SERVICE_INFORMATION , - vibrationValues:[2,0,2,0], - }).then(()=>{ - console.info("=======Ans_PublishVibra_0200 setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishVibra_0200 setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_0200 setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_0200 publish1 then catch err======>"+err); - }) - setTimeout((async function(){ - console.info("======Ans_PublishVibra_0200 setTimeout========>"); - await notify.removeSlot(notify.SlotType.SERVICE_INFORMATION); - await notify.unsubscribe(subscriber); - console.info("======Ans_PublishVibra_0200 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume0300(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishVibra_0300 onConsume start============>"); - console.info("=============Ans_PublishVibra_0300 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var vibrationValues = data.sortingMap.sortings[hashCode].slot.vibrationValues - var vibrationEnabled = data.sortingMap.sortings[hashCode].slot.vibrationEnabled - console.info("=============Ans_PublishVibra_0300 onConsume vibrationValues============>" + vibrationValues); - console.info("=============Ans_PublishVibra_0300 onConsume vibrationEnabled============>" + vibrationEnabled); - if (timesOfOnConsume == 1){ - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([])); - expect(vibrationEnabled).assertEqual(false); - console.info("=============Ans_PublishVibra_0300 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([3,0,3,0])); - expect(vibrationEnabled).assertEqual(true); - console.info("=============Ans_PublishVibra_0300 onConsume timesOfOnConsume2============>"); - } - console.info("=============Ans_PublishVibra_0300 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishVibra_0300 - * @tc.name: addSlot(type: SlotType): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a CONTENT_INFORMATION type slot, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishVibra_0300', 0,async function (done) { - console.info("===============Ans_PublishVibra_0300================>"); - timesOfOnConsume = 0; - var subscriber ={ - onConsume:onConsume0300 - } - await notify.subscribe(subscriber); - console.info("===============Ans_PublishVibra_0300 subscribe======>"); - await notify.addSlot(notify.SlotType.CONTENT_INFORMATION); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 3, - slotType : notify.SlotType.CONTENT_INFORMATION, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0300", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishVibra_0300 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.CONTENT_INFORMATION, - vibrationValues:[3,0,3,0], - }).then(()=>{ - console.info("=======Ans_PublishVibra_0300 setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishVibra_0300 setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_0300 setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_0300 publish1 then catch err======>"+err); - }) - - setTimeout((async function(){ - console.info("======Ans_PublishVibra_0300 setTimeout========>"); - await notify.removeSlot(notify.SlotType.CONTENT_INFORMATION); - await notify.unsubscribe(subscriber); - console.info("======Ans_PublishVibra_0300 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume0400(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishVibra_0400 onConsume start============>"); - console.info("=============Ans_PublishVibra_0400 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var vibrationValues = data.sortingMap.sortings[hashCode].slot.vibrationValues - var vibrationEnabled = data.sortingMap.sortings[hashCode].slot.vibrationEnabled - console.info("=============Ans_PublishVibra_0400 onConsume vibrationValues============>" + vibrationValues); - console.info("=============Ans_PublishVibra_0400 onConsume vibrationEnabled============>" + vibrationEnabled); - if (timesOfOnConsume == 1){ - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([])); - expect(vibrationEnabled).assertEqual(false); - console.info("=============Ans_PublishVibra_0400 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([4,0,4,0])); - expect(vibrationEnabled).assertEqual(true); - console.info("=============Ans_PublishVibra_0400 onConsume timesOfOnConsume2============>"); - } - console.info("=============Ans_PublishVibra_0400 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishVibra_0400 - * @tc.name: addSlot(type: SlotType): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a OTHER_TYPES type slot, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishVibra_0400', 0,async function (done) { - console.info("===============Ans_PublishVibra_0400================>"); - timesOfOnConsume = 0; - var subscriber = { - onConsume:onConsume0400 - } - await notify.subscribe(subscriber); - console.info("===============Ans_PublishVibra_0400 subscribe======>"); - await notify.addSlot(notify.SlotType.OTHER_TYPES); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 4, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0400", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishVibra_0400 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.OTHER_TYPES, - vibrationValues:[4,0,4,0], - }).then(()=>{ - console.info("=======Ans_PublishVibra_0400 setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishVibra_0400 setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_0400 setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_0400 publish1 then catch err======>"+err); - }) - setTimeout((async function(){ - console.info("======Ans_PublishVibra_0400 setTimeout========>"); - await notify.removeSlot(notify.SlotType.OTHER_TYPES); - await notify.unsubscribe(subscriber); - console.info("======Ans_PublishVibra_0400 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume0500(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishVibra_0500 onConsume start============>"); - console.info("=============Ans_PublishVibra_0500 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var vibrationValues = data.sortingMap.sortings[hashCode].slot.vibrationValues - var vibrationEnabled = data.sortingMap.sortings[hashCode].slot.vibrationEnabled - console.info("=============Ans_PublishVibra_0500 onConsume vibrationValues============>" + vibrationValues); - console.info("=============Ans_PublishVibra_0500 onConsume vibrationEnabled============>" + vibrationEnabled); - if (timesOfOnConsume == 1){ - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([])); - expect(vibrationEnabled).assertEqual(false); - console.info("=============Ans_PublishVibra_0500 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([5,0,5,0])); - expect(vibrationEnabled).assertEqual(true); - console.info("=============Ans_PublishVibra_0500 onConsume timesOfOnConsume2============>"); - } - console.info("=============Ans_PublishVibra_0500 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishVibra_0500 - * @tc.name: addSlot(type: SlotType): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a UNKNOWN_TYPE type slot, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishVibra_0500', 0,async function (done) { - console.info("===============Ans_PublishVibra_0500================>"); - timesOfOnConsume = 0; - var subscriber = { - onConsume:onConsume0500 - } - await notify.subscribe(subscriber); - console.info("===============Ans_PublishVibra_0500 subscribe======>"); - await notify.addSlot(notify.SlotType.UNKNOWN_TYPE); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 5, - slotType : notify.SlotType.UNKNOWN_TYPE, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0500", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishVibra_0500 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.OTHER_TYPES, - vibrationValues:[5,0,5,0], - }).then(()=>{ - console.info("=======Ans_PublishVibra_0500 setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishVibra_0500 setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_0500 setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_0500 publish1 then catch err======>"+err); - }) - setTimeout((async function(){ - console.info("======Ans_PublishVibra_0500 setTimeout========>"); - await notify.removeSlot(notify.SlotType.UNKNOWN_TYPE); - await notify.unsubscribe(subscriber); - console.info("======Ans_PublishVibra_0500 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume0600(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishVibra_0600 onConsume start============>"); - console.info("=============Ans_PublishVibra_0600 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var vibrationValues = data.sortingMap.sortings[hashCode].slot.vibrationValues - var vibrationEnabled = data.sortingMap.sortings[hashCode].slot.vibrationEnabled - console.info("=============Ans_PublishVibra_0600 onConsume vibrationValues============>" + vibrationValues); - console.info("=============Ans_PublishVibra_0600 onConsume vibrationEnabled============>" + vibrationEnabled); - if (timesOfOnConsume == 1){ - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([6,0,6,0])); - expect(vibrationEnabled).assertEqual(true); - console.info("=============Ans_PublishVibra_0600 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([6,6,6,6])); - expect(vibrationEnabled).assertEqual(true); - console.info("=============Ans_PublishVibra_0600 onConsume timesOfOnConsume2============>"); - } - console.info("=============Ans_PublishVibra_0600 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishVibra_0600 - * @tc.name: addSlot(slot: NotificationSlot): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a SOCIAL_COMMUNICATION type slot, set vibra information, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishVibra_0600', 0,async function (done) { - console.info("===============Ans_PublishVibra_0600================>"); - timesOfOnConsume = 0; - var subscriber ={ - onConsume:onConsume0600 - } - await notify.subscribe(subscriber); - console.info("===============Ans_PublishVibra_0600 subscribe======>"); - await notify.addSlot({ - type:notify.SlotType.SOCIAL_COMMUNICATION, - vibrationValues:[6,0,6,0], - }); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 6, - slotType : notify.SlotType.SOCIAL_COMMUNICATION, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0600", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishVibra_0600 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.SOCIAL_COMMUNICATION, - vibrationValues:[6,6,6,6], - }).then(()=>{ - console.info("=======Ans_PublishVibra_0600 setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishVibra_0600 setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_0600 setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_0600 publish1 then catch err======>"+err); - }) - setTimeout((async function(){ - console.info("======Ans_PublishVibra_0600 setTimeout========>"); - await notify.removeSlot(notify.SlotType.SOCIAL_COMMUNICATION); - await notify.unsubscribe(subscriber); - console.info("======Ans_PublishVibra_0600 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume0700(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishVibra_0700 onConsume start============>"); - console.info("=============Ans_PublishVibra_0700 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var vibrationValues = data.sortingMap.sortings[hashCode].slot.vibrationValues - var vibrationEnabled = data.sortingMap.sortings[hashCode].slot.vibrationEnabled - console.info("=============Ans_PublishVibra_0700 onConsume vibrationValues============>" + vibrationValues); - console.info("=============Ans_PublishVibra_0700 onConsume vibrationEnabled============>" + vibrationEnabled); - if (timesOfOnConsume == 1){ - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([7,0,7,0])); - expect(vibrationEnabled).assertEqual(true); - console.info("=============Ans_PublishVibra_0700 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([7,7,7,7])); - expect(vibrationEnabled).assertEqual(true); - console.info("=============Ans_PublishVibra_0700 onConsume timesOfOnConsume2============>"); - } - - console.info("=============Ans_PublishVibra_0700 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishVibra_0700 - * @tc.name: addSlot(slot: NotificationSlot): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a SERVICE_INFORMATION type slot, set vibra information, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishVibra_0700', 0,async function (done) { - console.info("===============Ans_PublishVibra_0700================>"); - timesOfOnConsume = 0; - var subscriber ={ - onConsume:onConsume0700 - } - await notify.subscribe(subscriber); - console.info("===============Ans_PublishVibra_0700 subscribe======>"); - await notify.addSlot({ - type:notify.SlotType.SERVICE_INFORMATION, - vibrationValues:[7,0,7,0], - }); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 7, - slotType : notify.SlotType.SERVICE_INFORMATION , - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0700", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishVibra_0700 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.SERVICE_INFORMATION , - vibrationValues:[7,7,7,7], - }).then(()=>{ - console.info("=======Ans_PublishVibra_0700 setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishVibra_0700 setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_0700 setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_0700 publish1 then catch err======>"+err); - }) - setTimeout((async function(){ - console.info("======Ans_PublishVibra_0700 setTimeout========>"); - await notify.removeSlot(notify.SlotType.SERVICE_INFORMATION); - await notify.unsubscribe(subscriber); - console.info("======Ans_PublishVibra_0700 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume0800(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishVibra_0800 onConsume start============>"); - console.info("=============Ans_PublishVibra_0800 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var vibrationValues = data.sortingMap.sortings[hashCode].slot.vibrationValues - var vibrationEnabled = data.sortingMap.sortings[hashCode].slot.vibrationEnabled - console.info("=============Ans_PublishVibra_0800 onConsume vibrationValues============>" + vibrationValues); - console.info("=============Ans_PublishVibra_0800 onConsume vibrationEnabled============>" + vibrationEnabled); - if (timesOfOnConsume == 1){ - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([8,0,8,0])); - expect(vibrationEnabled).assertEqual(true); - console.info("=============Ans_PublishVibra_0800 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([8,8,8,8])); - expect(vibrationEnabled).assertEqual(true); - console.info("=============Ans_PublishVibra_0800 onConsume timesOfOnConsume2============>"); - } - console.info("=============Ans_PublishVibra_0800 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishVibra_0800 - * @tc.name: addSlot(slot: NotificationSlot): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a CONTENT_INFORMATION type slot, set vibra information, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishVibra_0800', 0,async function (done) { - console.info("===============Ans_PublishVibra_0800================>"); - timesOfOnConsume = 0; - var subscriber ={ - onConsume:onConsume0800 - } - await notify.subscribe(subscriber); - console.info("===============Ans_PublishVibra_0800 subscribe======>"); - await notify.addSlot({ - type:notify.SlotType.CONTENT_INFORMATION, - vibrationValues:[8,0,8,0], - }); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 8, - slotType : notify.SlotType.CONTENT_INFORMATION, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0800", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishVibra_0800 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.CONTENT_INFORMATION, - vibrationValues:[8,8,8,8], - }).then(()=>{ - console.info("=======Ans_PublishVibra_0800 setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishVibra_0800 setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_0800 setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_0800 publish1 then catch err======>"+err); - }) - setTimeout((async function(){ - console.info("======Ans_PublishVibra_0800 setTimeout========>"); - await notify.removeSlot(notify.SlotType.CONTENT_INFORMATION); - await notify.unsubscribe(subscriber); - console.info("======Ans_PublishVibra_0800 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume0900(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishVibra_0900 onConsume start============>"); - console.info("=============Ans_PublishVibra_0900 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var vibrationValues = data.sortingMap.sortings[hashCode].slot.vibrationValues - var vibrationEnabled = data.sortingMap.sortings[hashCode].slot.vibrationEnabled - console.info("=============Ans_PublishVibra_0900 onConsume vibrationValues============>" + vibrationValues); - console.info("=============Ans_PublishVibra_0900 onConsume vibrationEnabled============>" + vibrationEnabled); - if (timesOfOnConsume == 1){ - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([9,0,9,0])); - expect(vibrationEnabled).assertEqual(true); - console.info("=============Ans_PublishVibra_0900 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([9,9,9,9])); - expect(vibrationEnabled).assertEqual(true); - console.info("=============Ans_PublishVibra_0900 onConsume timesOfOnConsume2============>"); - } - console.info("=============Ans_PublishVibra_0900 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishVibra_0900 - * @tc.name: addSlot(slot: NotificationSlot): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a OTHER_TYPES type slot, set vibra information, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishVibra_0900', 0,async function (done) { - console.info("===============Ans_PublishVibra_0900================>"); - timesOfOnConsume = 0; - var subscriber = { - onConsume:onConsume0900 - } - await notify.subscribe(subscriber); - console.info("===============Ans_PublishVibra_0900 subscribe======>"); - await notify.addSlot({ - type:notify.SlotType.OTHER_TYPES, - vibrationValues:[9,0,9,0], - }); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 9, - slotType : notify.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0900", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishVibra_0900 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.OTHER_TYPES, - vibrationValues:[9,9,9,9], - }).then(()=>{ - console.info("=======Ans_PublishVibra_0900 setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishVibra_0900 setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_0900 setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_0900 publish1 then catch err======>"+err); - }) - - setTimeout((async function(){ - console.info("======Ans_PublishVibra_0900 setTimeout========>"); - await notify.removeSlot(notify.SlotType.OTHER_TYPES); - await notify.unsubscribe(subscriber); - console.info("======Ans_PublishVibra_0900 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume1000(data){ - timesOfOnConsume ++; - console.info("=============Ans_PublishVibra_1000 onConsume start============>"); - console.info("=============Ans_PublishVibra_1000 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var vibrationValues = data.sortingMap.sortings[hashCode].slot.vibrationValues - var vibrationEnabled = data.sortingMap.sortings[hashCode].slot.vibrationEnabled - console.info("=============Ans_PublishVibra_1000 onConsume vibrationValues============>" + vibrationValues); - console.info("=============Ans_PublishVibra_1000 onConsume vibrationEnabled============>" + vibrationEnabled); - if (timesOfOnConsume == 1){ - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([10,0,10,0])); - expect(vibrationEnabled).assertEqual(true); - console.info("=============Ans_PublishVibra_1000 onConsume timesOfOnConsume1============>"); - } else if (timesOfOnConsume == 2){ - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([10,10,10,10])); - expect(vibrationEnabled).assertEqual(true); - console.info("=============Ans_PublishVibra_1000 onConsume timesOfOnConsume2============>"); - } - console.info("=============Ans_PublishVibra_1000 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishVibra_1000 - * @tc.name: addSlot(slot: NotificationSlot): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a UNKNOWN_TYPE type slot, set vibra information, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishVibra_1000', 0,async function (done) { - console.info("===============Ans_PublishVibra_1000================>"); - timesOfOnConsume = 0; - var subscriber = { - onConsume:onConsume1000 - } - await notify.subscribe(subscriber); - console.info("===============Ans_PublishVibra_1000 subscribe======>"); - await notify.addSlot({ - type:notify.SlotType.UNKNOWN_TYPE, - vibrationValues:[10,0,10,0], - }); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 10, - slotType : notify.SlotType.UNKNOWN_TYPE, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "1000", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishVibra_1000 publish1 then======>"); - notify.setSlotByBundle(bundleoption, - { - type:notify.SlotType.UNKNOWN_TYPE, - vibrationValues:[10,10,10,10], - }).then(()=>{ - console.info("=======Ans_PublishVibra_1000 publish1 then setSlotByBundle then======>"); - notify.publish(notificationRequest); - console.info("=======Ans_PublishVibra_1000 publish1 then setSlotByBundle then publish2======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_1000 publish1 then setSlotByBundle catch err======>"+err); - }) - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_1000 publish1 then catch err======>"+err); - }) - - setTimeout((async function(){ - console.info("======Ans_PublishVibra_1000 setTimeout========>"); - await notify.removeSlot(notify.SlotType.UNKNOWN_TYPE); - await notify.unsubscribe(subscriber); - console.info("======Ans_PublishVibra_1000 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume1100(data){ - console.info("=============Ans_PublishVibra_1100 onConsume start============>"); - console.info("=============Ans_PublishVibra_1100 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var vibrationValues = data.sortingMap.sortings[hashCode].slot.vibrationValues - var vibrationEnabled = data.sortingMap.sortings[hashCode].slot.vibrationEnabled - console.info("=============Ans_PublishVibra_1100 onConsume vibrationValues============>" + vibrationValues); - console.info("=============Ans_PublishVibra_1100 onConsume vibrationEnabled============>" + vibrationEnabled); - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([200])); - expect(vibrationEnabled).assertEqual(true); - console.info("=============Ans_PublishVibra_1100 onConsume timesOfOnConsume1============>"); - console.info("=============Ans_PublishVibra_1100 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishVibra_1100 - * @tc.name: addSlot(slot: NotificationSlot): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a SOCIAL_COMMUNICATION type slot, set vibra flag, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishVibra_1100', 0,async function (done) { - console.info("===============Ans_PublishVibra_1100================>"); - timesOfOnConsume = 0; - var subscriber ={ - onConsume:onConsume1100 - } - notify.subscribe(subscriber); - console.info("===============Ans_PublishVibra_1100 subscribe======>"); - notify.addSlot({ - type:notify.SlotType.SOCIAL_COMMUNICATION, - vibrationEnabled:true, - }).then(()=>{ - console.info("===============Ans_PublishVibra_1100 addSlot then======>"); - }).catch((err)=>{ - console.info("===============Ans_PublishVibra_1100 addSlot catch err======>"+err); - }); - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 11, - slotType : notify.SlotType.SOCIAL_COMMUNICATION, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "1100", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishVibra_1100 publish then======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_1100 publish then catch err======>"+err); - }) - setTimeout((async function(){ - console.info("======Ans_PublishVibra_1100 setTimeout========>"); - await notify.removeSlot(notify.SlotType.SOCIAL_COMMUNICATION); - await notify.unsubscribe(subscriber); - console.info("======Ans_PublishVibra_1100 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); - - function onConsume1200(data){ - console.info("=============Ans_PublishVibra_1200 onConsume start============>"); - console.info("=============Ans_PublishVibra_1200 onConsume data:============>" + JSON.stringify(data)); - var hashCode = data.request.hashCode - var vibrationValues = data.sortingMap.sortings[hashCode].slot.vibrationValues - var vibrationEnabled = data.sortingMap.sortings[hashCode].slot.vibrationEnabled - console.info("=============Ans_PublishVibra_1200 onConsume vibrationValues============>" + vibrationValues); - console.info("=============Ans_PublishVibra_1200 onConsume vibrationEnabled============>" + vibrationEnabled); - expect(JSON.stringify(vibrationValues)).assertEqual(JSON.stringify([])); - expect(vibrationEnabled).assertEqual(true); - console.info("=============Ans_PublishVibra_1200 onConsume end==============>"); - } - - /* - * @tc.number: Ans_PublishVibra_1200 - * @tc.name: addSlot(slot: NotificationSlot): Promise; - setSlotByBundle(bundle: BundleOption, slot: NotificationSlot): Promise; - * @tc.desc: Create a CONTENT_INFORMATION type slot, set vibra flag, publish a notification and verify. - After changing the slot information, publish a notification again and verify. - */ - it('Ans_PublishVibra_1200', 0,async function (done) { - console.info("===============Ans_PublishVibra_1200================>"); - timesOfOnConsume = 0; - var subscriber ={ - onConsume:onConsume1200 - } - await notify.subscribe(subscriber); - console.info("===============Ans_PublishVibra_1200 subscribe======>"); - await notify.addSlot({ - type:notify.SlotType.CONTENT_INFORMATION, - vibrationEnabled:true, - }) - - var notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 12, - slotType : notify.SlotType.CONTENT_INFORMATION, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "1200", - badgeIconStyle: 1, - showDeliveryTime: true, - } - notify.publish(notificationRequest).then(()=>{ - console.info("=======Ans_PublishVibra_1200 publish then======>"); - }).catch((err)=>{ - console.info("=======Ans_PublishVibra_1200 publish then catch err======>"+err); - }) - setTimeout((async function(){ - console.info("======Ans_PublishVibra_1200 setTimeout========>"); - await notify.removeSlot(notify.SlotType.CONTENT_INFORMATION); - await notify.unsubscribe(subscriber); - console.info("======Ans_PublishVibra_1200 setTimeout unsubscribe===>"); - done(); - }),timeout); - }); -}) } diff --git a/notification/ans_standard/publish_test/publishvibra/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/publishvibra/src/main/js/test/List.test.js deleted file mode 100644 index 9aeee8dc1f34cb70d5f344a638edd195e111ef0d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishvibra/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ -import ActsAnsPublishVibraTest from './ExampleJsunit.test.js' -export default function testsuite() { -ActsAnsPublishVibraTest() -} diff --git a/notification/ans_standard/publish_test/publishvibra/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/publishvibra/src/main/resources/base/element/string.json deleted file mode 100644 index 37434ea7ff0abc3a132e85b7f7727c1429e84cf2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/publishvibra/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "PubVibra" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/publishvibra/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/publishvibra/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/publishvibra/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/sub/BUILD.gn b/notification/ans_standard/publish_test/sub/BUILD.gn deleted file mode 100644 index 161984da29cd21fb7c0e8615009abfcd164a3da4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/sub/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsSubTestXts") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsSubTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/sub/Test.json b/notification/ans_standard/publish_test/sub/Test.json deleted file mode 100644 index f4bc409ed557429d23e371fa9165fc29ef74be8a..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/sub/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "shell-timeout": "180000", - "bundle-name": "com.example.actsanssubtest", - "package-name": "com.example.actsanssubtest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsSubTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/sub/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/sub/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/sub/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/sub/src/main/config.json b/notification/ans_standard/publish_test/sub/src/main/config.json deleted file mode 100644 index 41cf0002e2c80608384165d5008c3cd66d29916e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/sub/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanssubtest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanssubtest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/sub/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/sub/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/sub/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/sub/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/sub/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/sub/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/sub/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/sub/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/sub/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/sub/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/sub/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/sub/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/sub/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/sub/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index f9fd90b8fceb53ec2b550e03e7145d7fd0290a65..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/sub/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - Text of Publishing Common Events - -
diff --git a/notification/ans_standard/publish_test/sub/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/sub/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/sub/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/sub/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/sub/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/sub/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/sub/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/sub/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/sub/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/sub/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/sub/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/sub/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/sub/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/sub/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/sub/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/sub/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/sub/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/sub/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/sub/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/sub/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/sub/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/sub/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/sub/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/sub/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/sub/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/sub/src/main/js/test/List.test.js deleted file mode 100644 index 3f0d496ece8f06c7a767bdf8771bcbffeb603a7f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/sub/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsSubTestXts from './Subscriber.js' -export default function testsuite() { -ActsAnsSubTestXts() -} diff --git a/notification/ans_standard/publish_test/sub/src/main/js/test/Subscriber.js b/notification/ans_standard/publish_test/sub/src/main/js/test/Subscriber.js deleted file mode 100644 index cb449fc418535bafcef1051e4649cf56dee608fc..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/sub/src/main/js/test/Subscriber.js +++ /dev/null @@ -1,307 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'; -import notify from '@ohos.notification'; -var timeout = 2000; -export default function ActsAnsSubTestXts() { -describe('ActsAnsSubTestXts', function () { - console.info("==ActsAnsSubscriberTest start==>"); - //ActsSubscriber_test_0100 - var subInfoa ={ - onConnect:connectCallbacka, - onDisconnect:disconnectCallbacka, - } - function connectCallbacka() { - console.debug("==>connectCallbacka code==>"); - } - function subscribeCallbacka(err) { - console.debug("==>subscribeCallbacka code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbacka(err){ - console.debug("==>ActsSubscriber_test_xts_0100 unSubscribeCallbacka code==>" +err.code); - expect(err.code).assertEqual(0); - } - function disconnectCallbacka(){ - console.debug("==>disconnectCallbacka code==>"); - } - //ActsSubscriber_test_0200 - function connectCallbackb() { - console.debug("==>connectCallbackb code==>"); - } - function subscribeCallbackb(err) { - console.debug("==>ActsSubscriber_test_xts_0200 subscribeCallbackb code==>" +err.code); - expect(err.code).assertEqual(0); - } - function subscribeCallbackc(err) { - console.debug("==>subscribeCallbackc code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbackb(err){ - console.debug("==>ActsSubscriber_test_xts_0200 unSubscribeCallbackb code==>" +err.code); - expect(err.code).assertEqual(0); - } - function disconnectCallbackb(){ - console.debug("==>disconnectCallbackb code==>"); - } - //ActsSubscriber_test_0300 - function connectCallbackc() { - console.debug("==>connectCallbackc code==>"); - } - function connectCallbackd() { - console.debug("==>connectCallbackd code==>"); - } - function subscribeCallbackd(err) { - console.debug("==>ActsSubscriber_test_xts_0300 subscribeCallbackd code==>" +err.code); - expect(err.code).assertEqual(0); - } - function subscribeCallbacke(err) { - console.debug("==>ActsSubscriber_test_xts_0300 subscribeCallbacke code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbackc(err){ - console.debug("==>ActsSubscriber_test_xts_0300 unSubscribeCallbackc code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbackd(err){ - console.debug("==>ActsSubscriber_test_xts_0300 unSubscribeCallbackd code==>" +err.code); - expect(err.code).assertEqual(0); - } - function disconnectCallbackc(){ - console.debug("==>disconnectCallbackc code==>"); - } - function disconnectCallbackd(){ - console.debug("==>disconnectCallbackd code==>"); - } - //ActsSubscriber_test_0400 - function connectCallbackf() { - console.debug("==>connectCallbackf code==>"); - } - function connectCallbackg() { - console.debug("==>connectCallbackg code==>"); - } - function subscribeCallbackg(err) { - console.debug("==>ActsSubscriber_test_xts_0400 subscribeCallbackg code==>" +err.code); - expect(err.code).assertEqual(0); - } - function subscribeCallbackh(err) { - console.debug("==>ActsSubscriber_test_xts_0400 subscribeCallbackh code==>" +err.code); - expect(err.code).assertEqual(0); - } - function subscribeCallbacki(err) { - console.debug("==>ActsSubscriber_test_xts_0400 subscribeCallbacki code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbackf(err){ - console.debug("==>ActsSubscriber_test_xts_0400 unSubscribeCallbackf code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbackg(err){ - console.debug("==>ActsSubscriber_test_xts_0400 unSubscribeCallbackg code==>" +err.code); - expect(err.code).assertEqual(0); - } - function disconnectCallbackf(){ - console.debug("==>disconnectCallbackf code==>"); - } - function disconnectCallbackg(){ - console.debug("==>disconnectCallbackg code==>"); - } - //ActsSubscriber_test_0500 - var subInfob = { - onConnect:connectCallbacki, - onDisconnect:disconnectCallbacki, - } - function connectCallbacki() { - console.debug("==>connectCallbacki code==>"); - } - function subscribeCallbackl(err) { - console.debug("==>ActsSubscriber_test_xts_0500 subscribeCallbackl code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbacki(err){ - console.debug("==>ActsSubscriber_test_xts_0500 unSubscribeCallbacki code==>" +err.code); - expect(err.code).assertEqual(0); - } - function disconnectCallbacki(){ - console.debug("==>disconnectCallbacki code==>"); - } - //ActsSubscriber_test_0600 - var subInfoc ={ - onConnecte:connectCallbackj, - onDisconnect:disconnectCallbackj, - } - function connectCallbackj() { - console.debug("==>connectCallbackj code==>"); - } - function unSubscribeCallbackj(err){ - console.debug("==>ActsSubscriber_test_xts_0600 unSubscribeCallbackj code==>" +err.code); - expect(err.code).assertEqual(0); - } - function disconnectCallbackj(){ - console.debug("==>disconnectCallbackj code==>"); - } - //ActsSubscriber_test_0700 - var subInfod ={ - onConnect:connectCallbackm, - onDisconnect:disconnectCallbackl, - } - function connectCallbackm() { - console.debug("==>connectCallbackm code==>"); - } - function subscribeCallbackn(err) { - console.debug("==>ActsSubscriber_test_xts_0700 subscribeCallbackn code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbackl(err){ - console.debug("==>ActsSubscriber_test_xts_0700 unSubscribeCallbackl code==>" +err.code); - expect(err.code).assertEqual(0); - } - function disconnectCallbackl(){ - console.debug("==>disconnectCallbackl code==>"); - } - //ActsSubscriber_test_0800 - var subInfoe ={ - onConnect:connectCallbackn, - onDisconnect:disconnectCallbackm, - } - function connectCallbackn() { - console.debug("==>connectCallbackn code==>"); - } - function unSubscribeCallbackm(err){ - console.debug("==>ActsSubscriber_test_xts_0800 unSubscribeCallbackm code==>" +err.code); - expect(err.code).assertEqual(0); - } - function disconnectCallbackm(){ - console.debug("==>disconnectCallbackm code==>"); - } - //ActsSubscriber_test_1300 - function connectCallbackl(){ - console.debug("==>connectCallbackl code==>"); - } - function subscribeCallbacko(err){ - console.debug("==>ActsSubscriber_test_xts_1300 subscribeCallbacko code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbackn(err){ - console.debug("==>ActsSubscriber_test_xts_1300 unSubscribeCallbackn code==>" +err.code); - expect(err.code).assertEqual(0); - } - function disconnectCallbackn(){ - console.debug("==>disconnectCallbackn code==>"); - } - //ActsSubscriber_test_1400 - function connectCallbacko(){ - console.debug("==>connectCallbacko code==>"); - } - function subscribeCallbackp(err){ - console.debug("==>ActsSubscriber_test_xts_1400 subscribeCallbackp code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbacko(err){ - console.debug("==>unSubscribeCallbacko code==>" +err.code); - expect(err.code).assertEqual(0); - } - function disconnectCallbacko(){ - console.debug("==>disconnectCallbacko code==>"); - } - - /* - * @tc.number: ActsSubscriber_test_xts_0900 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_xts_0900', 0, async function (done) { - console.debug("==ActsSubscriber_test_xts_0900==begin==>"); - var promise = notify.subscribe(100,{bundleNames:["com.example.actsanspublishtest"]}); - expect(promise).assertEqual(undefined); - setTimeout((async function(){ - console.debug("==ActsSubscriber_test_xts_0900==end==>"); - done(); - }),timeout); - }) - - /* - * @tc.number: ActsSubscriber_test_xts_1000 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_xts_1000', 0, async function (done) { - console.debug("==ActsSubscriber_test_xts_1000==begin==>"); - var subInfo = null - var promise = await notify.subscribe(subInfo,{bundleNames:["com.example.actsanspublishtest"]}); - expect(promise).assertEqual(undefined); - setTimeout((async function(){ - console.debug("==ActsSubscriber_test_xts_1000==end==>"); - done(); - }),timeout); - }) - - /* - * @tc.number: ActsSubscriber_test_xts_1100 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_xts_1100', 0, async function (done) { - console.debug("==ActsSubscriber_test_xts_1100==begin==>"); - var subInfo = "#$#%$%$^&%^%" - var promise = notify.subscribe(subInfo,{bundleNames:["com.example.actsanspublishtest"]}); - expect(promise).assertEqual(undefined); - setTimeout((async function(){ - console.debug("==ActsSubscriber_test_xts_1100==end==>"); - done(); - }),timeout); - }) - - /* - * @tc.number: ActsSubscriber_test_xts_1200 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_xts_1200', 0, async function (done) { - console.debug("==ActsSubscriber_test_xts_1200==begin==>"); - var subInfo = "" - var promise = await notify.subscribe(subInfo,{bundleNames:["com.example.actsanspublishtest"]}); - expect(promise).assertEqual(undefined); - setTimeout((async function(){ - console.debug("==ActsSubscriber_test_xts_1200==end==>"); - done(); - }),timeout); - }) - - /* - * @tc.number: ActsSubscriber_test_xts_1400 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_xts_1400', 0, async function (done) { - console.debug("==ActsSubscriber_test_xts_1400==begin==>"); - var subInfo ={ - onConnect:connectCallbacko, - onDisconnect:disconnectCallbacko, - } - try{ - await notify.subscribe(subInfo, {bundleNames: []}, subscribeCallbackp); - }catch(err){ - console.debug("==ActsSubscriber_test_xts_1400==err==>"+err); - } - setTimeout((async function(){ - console.debug("==ActsSubscriber_test_xts_1400==end==>"); - done(); - }),timeout); - }) -}) - -} diff --git a/notification/ans_standard/publish_test/sub/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/sub/src/main/resources/base/element/string.json deleted file mode 100644 index 7ef7c952d1da88e39dcc608988f047e9f94a9d29..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/sub/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Subscriber" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/sub/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/sub/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/sub/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/subscribe/BUILD.gn b/notification/ans_standard/publish_test/subscribe/BUILD.gn deleted file mode 100644 index fa9d9248cb36468126fc253a2b4a94d7e10b6ba2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/BUILD.gn +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -group("subscribe") { - testonly = true - if (is_standard_system) { - deps = [ - "publish:ActsAnsPublishTest", - #"subscribe:ActsAnsSubscriberTest", - ] - } -} diff --git a/notification/ans_standard/publish_test/subscribe/publish/BUILD.gn b/notification/ans_standard/publish_test/subscribe/publish/BUILD.gn deleted file mode 100644 index cf83cf4d0689295d4aefc99ca6beb18c98d8b576..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publish/BUILD.gn +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("ActsAnsPublishTest") { - hap_profile = "./entry/src/main/config.json" - hap_name = "ActsAnsPublishTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" - testonly = true - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/config.json b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/config.json deleted file mode 100644 index c3c1dde92c9ded92def374dcf1bf3d2529260861..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/config.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanspublishtest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanspublishtest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsanspublishtest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 11ca9571ffc132923e8842850b911a4b2d1f7575..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - Test of Calling the Publish Interface - -
diff --git a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index 03d35a7573e3b6d8269ded8d41341a17e812391c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 1e896cb97197887cb4e2ffe9fa7acf74be61160f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "publish" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/test/ExampleJsunit.test.js b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/test/ExampleJsunit.test.js deleted file mode 100644 index aa74a290e094da0a4d5588b72f18d066d91d9e40..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/test/ExampleJsunit.test.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import notification from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var time = 1000 -describe('ActsAnsPublishTest', function () { - function publishCallback001(){ - console.log('ActsAnsPublishTest ACTS_PublishTest_0100 asyncCallback') - } - - /* - * @tc.number: ACTS_PublishTest_0100 - * @tc.name: publish() - * @tc.desc: verify the function of publish - */ - it('ACTS_PublishTest_0100', 0,async function (done) { - await notification.publish({ - content:{ - contentType: notification.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test1_title", - text: "test1_text", - additionalText: "test1_additionalText" - }, - }, - id: 1, - slotType : notification.SlotType.OTHER_TYPES, - isOngoing : true, - isUnremovable : false, - deliveryTime : 1624950453, - tapDismissed : true, - autoDeletedTime: 1625036817, - color: 2, - colorEnabled: true, - isAlertOnce: true, - isStopwatch: true, - isCountDown: true, - progressValue: 12, - progressMaxValue: 100, - isIndeterminate: true, - statusBarText: "statusBarText", - isFloatingIcon : true, - label: "0100_1", - badgeIconStyle: 1, - showDeliveryTime: true, - },publishCallback001); - done(); - setTimeout(function(){ - console.debug("====>time out ACTS_PublishTest_0100====>"); - }, time); - }) -}) \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/test/List.test.js deleted file mode 100644 index c0b876e81cf0a75db974ee932d8fc06a1d5a6e66..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/publish/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -require('./ExampleJsunit.test.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/publish/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/subscribe/publish/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/subscribe/publish/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/BUILD.gn b/notification/ans_standard/publish_test/subscribe/subscribe/BUILD.gn deleted file mode 100644 index f3b880f50e2d9d476162edc501c2b9f01dd6c57d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/subscribe/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsSubscriberTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsSubscriberTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/Test.json b/notification/ans_standard/publish_test/subscribe/subscribe/Test.json deleted file mode 100644 index b152d8247de58f4fe31e581ab6e5ccc9879670dd..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/subscribe/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "60000", - "shell-timeout": "60000", - "bundle-name": "com.example.actsanssubscribertest", - "package-name": "com.example.actsanssubscribertest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsSubscriberTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/subscribe/subscribe/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/subscribe/subscribe/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/config.json b/notification/ans_standard/publish_test/subscribe/subscribe/src/main/config.json deleted file mode 100644 index f8d766f107ba3640a63944cdfb63fcd57031caa2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanssubscribertest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanssubscribertest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index a3115d45e213cb593a62b8098cc9c5902505c4b1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - Test of Subscription Publish - -
diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/test/List.test.js deleted file mode 100644 index dc65da88558eaa1f192adf4f4040590b2f13f35a..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsSubscriberTest from './Subscriber.js' -export default function testsuite() { -ActsAnsSubscriberTest() -} diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/test/Subscriber.js b/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/test/Subscriber.js deleted file mode 100644 index d1483e36fdd222ea813a39ab3ef7c3a1bcc55d5f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/js/test/Subscriber.js +++ /dev/null @@ -1,491 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -var time = 1000 -export default function ActsAnsSubscriberTest() { -describe('ActsAnsSubscriberTest', function () { - console.info("==ActsAnsSubscriberTest start==>"); - //ActsSubscriber_test_0100 - var subInfoa ={ - onConsume:consumeCallbackc, - onConnect:connectCallbacka, - onDisconnect:disconnectCallbacka, - } - function consumeCallbackc(data) { - console.debug("==>consumeCallbackc data : ==>" + JSON.stringify(data)); - checkConsumeData(data) - notify.unsubscribe(subInfoa, unSubscribeCallbacka); - } - function connectCallbacka() { - console.debug("==>connectCallbacka code==>"); - } - function subscribeCallbacka(err) { - console.debug("==>subscribeCallbacka code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbacka(err){ - console.debug("==>unSubscribeCallbacka code==>" +err.code); - expect(err.code).assertEqual(0); - } - function disconnectCallbacka(){ - console.debug("==>disconnectCallbacka code==>"); - } - //ActsSubscriber_test_0200 - function connectCallbackb() { - console.debug("==>connectCallbackb code==>"); - } - function subscribeCallbackb(err) { - console.debug("==>subscribeCallbackb code==>" +err.code); - expect(err.code).assertEqual(0); - } - function subscribeCallbackc(err) { - console.debug("==>subscribeCallbackc code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbackb(err){ - console.debug("==>unSubscribeCallbackb code==>" +err.code); - expect(err.code).assertEqual(0); - } - function disconnectCallbackb(){ - console.debug("==>disconnectCallbackb code==>"); - } - //ActsSubscriber_test_0300 - function connectCallbackc() { - console.debug("==>connectCallbackc code==>"); - } - function connectCallbackd() { - console.debug("==>connectCallbackd code==>"); - } - function subscribeCallbackd(err) { - console.debug("==>subscribeCallbackd code==>" +err.code); - expect(err.code).assertEqual(0); - } - function subscribeCallbacke(err) { - console.debug("==>subscribeCallbacke code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbackc(err){ - console.debug("==>unSubscribeCallbackc code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbackd(err){ - console.debug("==>unSubscribeCallbackd code==>" +err.code); - expect(err.code).assertEqual(0); - } - function disconnectCallbackc(){ - console.debug("==>disconnectCallbackc code==>"); - } - function disconnectCallbackd(){ - console.debug("==>disconnectCallbackd code==>"); - } - //ActsSubscriber_test_0500 - function connectCallbackf() { - console.debug("==>connectCallbackf code==>"); - } - function connectCallbackg() { - console.debug("==>connectCallbackg code==>"); - } - function subscribeCallbackg(err) { - console.debug("==>subscribeCallbackg code==>" +err.code); - expect(err.code).assertEqual(0); - } - function subscribeCallbackh(err) { - console.debug("==>subscribeCallbackh code==>" +err.code); - expect(err.code).assertEqual(0); - } - function subscribeCallbacki(err) { - console.debug("==>subscribeCallbacki code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbackf(err){ - console.debug("==>unSubscribeCallbackf code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbackg(err){ - console.debug("==>unSubscribeCallbackg code==>" +err.code); - expect(err.code).assertEqual(0); - } - function disconnectCallbackf(){ - console.debug("==>disconnectCallbackf code==>"); - } - function disconnectCallbackg(){ - console.debug("==>disconnectCallbackg code==>"); - } - //ActsSubscriber_test_0600 - var subInfob = { - onConsume:consumeCallbacka, - onConnect:connectCallbacki, - onDisconnect:disconnectCallbacki, - } - function consumeCallbacka(data) { - console.debug("==>consumeCallbacka data : ==>" + JSON.stringify(data)); - checkConsumeData(data) - notify.unsubscribe(subInfob, unSubscribeCallbacki); - } - function connectCallbacki() { - console.debug("==>connectCallbacki code==>"); - } - function subscribeCallbackl(err) { - console.debug("==>subscribeCallbackl code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbacki(err){ - console.debug("==>unSubscribeCallbacki code==>" +err.code); - expect(err.code).assertEqual(0); - } - function disconnectCallbacki(){ - console.debug("==>disconnectCallbacki code==>"); - } - //ActsSubscriber_test_0700 - var subInfoc ={ - onConsume:consumeCallbackb, - onConnecte:connectCallbackj, - onDisconnect:disconnectCallbackj, - } - function consumeCallbackb(data) { - console.debug("==>consumeCallbackb data : ==>" + JSON.stringify(data)); - checkConsumeData(data) - notify.unsubscribe(subInfoc, unSubscribeCallbackj); - } - function connectCallbackj() { - console.debug("==>connectCallbackj code==>"); - } - function unSubscribeCallbackj(err){ - console.debug("==>unSubscribeCallbackj code==>" +err.code); - expect(err.code).assertEqual(0); - } - function disconnectCallbackj(){ - console.debug("==>disconnectCallbackj code==>"); - } - //ActsSubscriber_test_0800 - var subInfod ={ - onConsume:consumeCallbackd, - onConnect:connectCallbackm, - onDisconnect:disconnectCallbackl, - } - function consumeCallbackd(data) { - console.debug("==>consumeCallbackd data : ==>" + JSON.stringify(data)); - checkConsumeData(data) - notify.unsubscribe(subInfod, unSubscribeCallbackl); - } - function connectCallbackm() { - console.debug("==>connectCallbackm code==>"); - } - function subscribeCallbackn(err) { - console.debug("==>subscribeCallbackn code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbackl(err){ - console.debug("==>unSubscribeCallbackl code==>" +err.code); - expect(err.code).assertEqual(0); - } - function disconnectCallbackl(){ - console.debug("==>disconnectCallbackl code==>"); - } - //ActsSubscriber_test_0900 - var subInfoe ={ - onConsume:consumeCallbacke, - onConnect:connectCallbackn, - onDisconnect:disconnectCallbackm, - } - function consumeCallbacke(data) { - console.debug("==>consumeCallbacke data : ==>" + JSON.stringify(data)); - checkConsumeData(data) - notify.unsubscribe(subInfoe, unSubscribeCallbackm); - } - function connectCallbackn() { - console.debug("==>connectCallbackn code==>"); - } - function unSubscribeCallbackm(err){ - console.debug("==>unSubscribeCallbackm code==>" +err.code); - expect(err.code).assertEqual(0); - } - function disconnectCallbackm(){ - console.debug("==>disconnectCallbackm code==>"); - } - //ActsSubscriber_test_1400 - function connectCallbackl(){ - console.debug("==>connectCallbackl code==>"); - } - function subscribeCallbacko(err){ - console.debug("==>subscribeCallbacko code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbackn(err){ - console.debug("==>unSubscribeCallbackn code==>" +err.code); - expect(err.code).assertEqual(0); - } - function disconnectCallbackn(){ - console.debug("==>disconnectCallbackn code==>"); - } - //ActsSubscriber_test_1500 - function connectCallbacko(){ - console.debug("==>connectCallbacko code==>"); - } - function subscribeCallbackp(err){ - console.debug("==>subscribeCallbackp code==>" +err.code); - expect(err.code).assertEqual(0); - } - function unSubscribeCallbacko(err){ - console.debug("==>unSubscribeCallbacko code==>" +err.code); - expect(err.code).assertEqual(0); - } - function disconnectCallbacko(){ - console.debug("==>disconnectCallbacko code==>"); - } - function checkConsumeData(data){ - expect(data.request.id).assertEqual(1); - expect(data.request.content.contentType).assertEqual(0); - expect(data.request.content.normal.title).assertEqual("test1_title"); - expect(data.request.content.normal.text).assertEqual("test1_text"); - expect(data.request.content.normal.additionalText).assertEqual("test1_additionalText"); - expect(data.request.slotType).assertEqual(65535); - expect(data.request.isOngoing).assertEqual(true); - expect(data.request.isUnremovable).assertEqual(false); - expect(data.request.deliveryTime).assertEqual(1624950453); - expect(data.request.tapDismissed).assertEqual(true); - expect(data.request.autoDeletedTime).assertEqual(1625036817); - expect(data.request.color).assertEqual(2); - expect(data.request.colorEnabled).assertEqual(true); - expect(data.request.isAlertOnce).assertEqual(true); - expect(data.request.isStopwatch).assertEqual(true); - expect(data.request.isCountDown).assertEqual(true); - expect(data.request.progressValue).assertEqual(12); - expect(data.request.progressMaxValue).assertEqual(100); - expect(data.request.isIndeterminate).assertEqual(true); - expect(data.request.statusBarText).assertEqual("statusBarText"); - expect(data.request.isFloatingIcon).assertEqual(true); - expect(data.request.label).assertEqual("0100_1"); - expect(data.request.badgeIconStyle).assertEqual(1); - expect(data.request.showDeliveryTime).assertEqual(true); - } - - /* - * @tc.number: ActsSubscriber_test_0100 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_0100', 0, async function (done) { - console.debug("==ActsSubscriber_test_0100==begin==>"); - await notify.subscribe(subInfoa, subscribeCallbacka); - console.debug("==ActsSubscriber_test_0100==end==>"); - done(); - }) - - /* - * @tc.number: ActsSubscriber_test_0200 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_0200', 0, async function (done) { - console.debug("==ActsSubscriber_test_0200==begin==>"); - var subInfo ={ - onConnect:connectCallbackb, - onDisconnect:disconnectCallbackb, - } - await notify.subscribe(subInfo,subscribeCallbackb); - await notify.subscribe(subInfo,subscribeCallbackc); - await notify.unsubscribe(subInfo, unSubscribeCallbackb); - console.debug("==ActsSubscriber_test_0200==end==>"); - done(); - }) - - /* - * @tc.number: ActsSubscriber_test_0300 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_0300', 0, async function (done) { - console.debug("==ActsSubscriber_test_0300==begin==>"); - - var subInfo ={ - onConnect:connectCallbackc, - onDisconnect:disconnectCallbackc, - } - var subInfo2 ={ - onConnect:connectCallbackd, - onDisconnect:disconnectCallbackd, - } - await notify.subscribe(subInfo,subscribeCallbackd); - await notify.subscribe(subInfo2,subscribeCallbacke); - await notify.unsubscribe(subInfo, unSubscribeCallbackc); - await notify.unsubscribe(subInfo2, unSubscribeCallbackd); - console.debug("==ActsSubscriber_test_0300==end==>"); - done(); - }) - /* - * @tc.number: ActsSubscriber_test_0400 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_0400', 0, async function (done) { - console.debug("==ActsSubscriber_test_0500==begin==>"); - - var subInfo ={ - onConnect:connectCallbackf, - onDisconnect:disconnectCallbackf, - } - var subInfo2 ={ - onConnect:connectCallbackg, - onDisconnect:disconnectCallbackg, - } - await notify.subscribe(subInfo,subscribeCallbackg); - await notify.subscribe(subInfo,subscribeCallbackh); - await notify.subscribe(subInfo2,subscribeCallbacki); - - await notify.unsubscribe(subInfo, unSubscribeCallbackf); - await notify.unsubscribe(subInfo2, unSubscribeCallbackg); - console.debug("==ActsSubscriber_test_0500==end==>"); - done(); - }) - - /* - * @tc.number: ActsSubscriber_test_0500 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_0500', 0, async function (done) { - console.debug("==ActsSubscriber_test_0500==begin==>"); - await notify.subscribe(subInfob, {bundleNames:["com.example.actsanspublishtest"]},subscribeCallbackl); - console.debug("==ActsSubscriber_test_0500==end3==>"); - done(); - }) - - /* - * @tc.number: ActsSubscriber_test_0600 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_0600', 0, async function (done) { - console.debug("==ActsSubscriber_test_0600==begin==>"); - await notify.subscribe(subInfoc, {bundleNames:["com.example.actsanspublishtest"]}).then( - console.log("ActsSubscriber_test_0600=======promise") - ); - console.debug("==ActsSubscriber_test_0600==end==>"); - done(); - }) - - /* - * @tc.number: ActsSubscriber_test_0700 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_0700', 0, async function (done) { - console.debug("==ActsSubscriber_test_0700==begin==>"); - await notify.subscribe(subInfod, {bundleNames:["com.example.actsanspublishtest","com.example.actsanspublishtest"]},subscribeCallbackn); - console.debug("==ActsSubscriber_test_0700==end==>"); - done(); - }) - - /* - * @tc.number: ActsSubscriber_test_0800 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_0800', 0, async function (done) { - console.debug("==ActsSubscriber_test_0900==begin==>"); - await notify.subscribe(subInfoe, {bundleNames:["com.example.actsanspublishtest","com.example.actsanspublishtest"]}).then( - console.log("ActsSubscriber_test_0900=======promise") - ); - console.debug("==ActsSubscriber_test_0900==end==>"); - done(); - }) - /* - * @tc.number: ActsSubscriber_test_0900 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_0900', 0, async function (done) { - console.debug("==ActsSubscriber_test_1000==begin==>"); - var promise = notify.subscribe(100,{bundleNames:["com.example.actsanspublishtest"]}); - expect(promise).assertEqual(undefined); - console.debug("==ActsSubscriber_test_1000==end==>"); - done(); - }) - /* - * @tc.number: ActsSubscriber_test_1000 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_1000', 0, async function (done) { - console.debug("==ActsSubscriber_test_1000==begin==>"); - var subInfo = null - var promise = await notify.subscribe(subInfo,{bundleNames:["com.example.actsanspublishtest"]}); - expect(promise).assertEqual(undefined); - console.debug("==ActsSubscriber_test_1000==end==>"); - done(); - }) - /* - * @tc.number: ActsSubscriber_test_1200 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_1100', 0, async function (done) { - console.debug("==ActsSubscriber_test_1200==begin==>"); - var subInfo = "#$#%$%$^&%^%" - var promise = notify.subscribe(subInfo,{bundleNames:["com.example.actsanspublishtest"]}); - expect(promise).assertEqual(undefined); - console.debug("==ActsSubscriber_test_1200==end==>"); - done(); - }) - /* - * @tc.number: ActsSubscriber_test_1200 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_1200', 0, async function (done) { - console.debug("==ActsSubscriber_test_1200==begin==>"); - var subInfo = "" - var promise = await notify.subscribe(subInfo,{bundleNames:["com.example.actsanspublishtest"]}); - expect(promise).assertEqual(undefined); - console.debug("==ActsSubscriber_test_1200==end==>"); - done(); - }) - /* - * @tc.number: ActsSubscriber_test_1300 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_1300', 0, async function (done) { - console.debug("==ActsSubscriber_test_1300==begin==>"); - var subInfo ={ - onConnect:connectCallbackl, - onDisconnect:disconnectCallbackn, - } - await notify.subscribe(subInfo,{bundleNames:["wrongBudleName"]},subscribeCallbacko); - await notify.unsubscribe(subInfo, unSubscribeCallbackn); - console.debug("==ActsSubscriber_test_1300==end==>"); - done(); - }) - /* - * @tc.number: ActsSubscriber_test_1500 - * @tc.name: subscribe() - * @tc.desc: verify the function of subscribe - */ - it('ActsSubscriber_test_1400', 0, async function (done) { - console.debug("==ActsSubscriber_test_1400==begin==>"); - var subInfo ={ - onConnect:connectCallbacko, - onDisconnect:disconnectCallbacko, - } - await notify.subscribe(subInfo,{bundleNames:[""]},subscribeCallbackp); - await notify.unsubscribe(subInfo, unSubscribeCallbacko); - console.debug("==ActsSubscriber_test_1400==end==>"); - done(); - }) -}) - -} diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/subscribe/subscribe/src/main/resources/base/element/string.json deleted file mode 100644 index 7ef7c952d1da88e39dcc608988f047e9f94a9d29..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Subscriber" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/subscribe/subscribe/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/subscribe/subscribe/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/unsubscribe/BUILD.gn b/notification/ans_standard/publish_test/unsubscribe/BUILD.gn deleted file mode 100644 index 020abc3939439c35da0868539618cea193b23d47..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/unsubscribe/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsUnSubscriberTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsUnSubscriberTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/unsubscribe/Test.json b/notification/ans_standard/publish_test/unsubscribe/Test.json deleted file mode 100644 index d33d0c14585a6a48055288a41fc42fa5140491b5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/unsubscribe/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "80000", - "shell-timeout": "80000", - "bundle-name": "com.example.actsansunsubscribertest", - "package-name": "com.example.actsansunsubscribertest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsUnSubscriberTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/unsubscribe/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/unsubscribe/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/unsubscribe/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/unsubscribe/src/main/config.json b/notification/ans_standard/publish_test/unsubscribe/src/main/config.json deleted file mode 100644 index 796c13923303532f1514a7d87ca21c5d7ef88f01..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/unsubscribe/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansunsubscribertest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansunsubscribertest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/unsubscribe/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/unsubscribe/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/unsubscribe/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/unsubscribe/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/unsubscribe/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/unsubscribe/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/unsubscribe/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/unsubscribe/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/unsubscribe/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/unsubscribe/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/unsubscribe/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/unsubscribe/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/unsubscribe/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/unsubscribe/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index b14a8615c4e92ae987860b6feee5f6924bb77fe6..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/unsubscribe/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - Test of Unsubscription - -
diff --git a/notification/ans_standard/publish_test/unsubscribe/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/unsubscribe/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/unsubscribe/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/unsubscribe/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/unsubscribe/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/unsubscribe/src/main/js/test/List.test.js deleted file mode 100644 index 23748bc7d432649b0d9610dd200e37f6e1a53de4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/unsubscribe/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsUnSubscriberTest from './UnSubscriber.js' -export default function testsuite() { -ActsAnsUnSubscriberTest() -} diff --git a/notification/ans_standard/publish_test/unsubscribe/src/main/js/test/UnSubscriber.js b/notification/ans_standard/publish_test/unsubscribe/src/main/js/test/UnSubscriber.js deleted file mode 100644 index 861c84ded702f8ce04125a1d894903d3ed1befd0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/unsubscribe/src/main/js/test/UnSubscriber.js +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import notify from '@ohos.notification' -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium' -var time = 500 -export default function ActsAnsUnSubscriberTest() { -describe('ActsAnsUnSubscriberTest', function () { - console.debug("===============ActsAnsUnSubscriberTest start=================>"); - function onConnecteOne() { - console.debug("===============Ans_UnSubscriber_0100 onConnecte=================>"); - } - function onDisconnectOne() { - console.debug("===============Ans_UnSubscriber_0100 onDisconnect=================>"); - } - - function onDisconnectTestNine() { - console.debug("=======Ans_UnSubscriber_0900 onDisconnectTestNine =================>"); - expect().assertFail(); - } - - /* - * @tc.number: Ans_UnSubscriber_0900 - * @tc.name: unsubscribe(subscriber: NotificationSubscriber, callback: AsyncCallback): void; - * @tc.desc: Verify that after the subscribe fails, the unsubscribe fails(callback) - */ - it('Ans_UnSubscriber_0900', 0, async function (done) { - console.info("===========Ans_UnSubscriber_0900 start=============>"); - var subscriber ={ - onConnect:"", - onDisconnect:onDisconnectTestNine - } - notify.subscribe(subscriber, (err)=>{ - console.debug("Ans_UnSubscriber_0900 subscribeCallbackNine err.code=================>"+err.code); - expect(err.code != 0).assertEqual(true); - notify.unsubscribe(subscriber, (err)=>{ - console.debug("Ans_UnSubscriber_0900 unsubscribe err.code=================>"+err.code); - expect(err.code != 0).assertEqual(true); - }); - }); - setTimeout(function(){ - console.debug("===========Ans_UnSubscriber_0900 setTimeout=============>"); - done(); - }, time); - }) - - function onDisconnectTestTen() { - console.debug("=======Ans_UnSubscriber_1000 onDisconnectTestTen =================>"); - expect().assertFail(); - } - - /* - * @tc.number: Ans_UnSubscriber_1000 - * @tc.name: unsubscribe(subscriber: NotificationSubscriber): Promise; - * @tc.desc: Verify that after the subscribe fails, the unsubscribe fails(promise) - */ - it('Ans_UnSubscriber_1000', 0, async function (done) { - console.info("===========Ans_UnSubscriber_1000 start=============>"); - var subscriber = { - onConnect:"", - onDisconnect:onDisconnectTestTen - } - notify.subscribe(subscriber, (err)=>{ - notify.unsubscribe(subscriber).then((err)=>{ - console.debug("=======Ans_UnSubscriber_1000 subscribe then err=================>"+err.code); - }).catch((err)=>{ - console.debug("=======Ans_UnSubscriber_1000 subscribe catch err=================>"+err.code); - expect(err.code != 0).assertEqual(true); - }); - }); - setTimeout(function(){ - console.debug("===========Ans_UnSubscriber_1000 setTimeout=============>"); - done(); - }, time); - }) -}) - -} diff --git a/notification/ans_standard/publish_test/unsubscribe/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/unsubscribe/src/main/resources/base/element/string.json deleted file mode 100644 index 9c4ce1d062536941d7bfb26b90b684f36d8016de..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/unsubscribe/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "UnSub" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} diff --git a/notification/ans_standard/publish_test/unsubscribe/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/unsubscribe/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/unsubscribe/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/BUILD.gn b/notification/ans_standard/publish_test/wantagent/BUILD.gn deleted file mode 100644 index 27c08d026b82390d1018b8d89ba0c2e87e17f8a3..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/BUILD.gn +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -group("wantagent") { - testonly = true - if (is_standard_system) { - deps = [ - "test1:test1", - "test2:test2", - "wantagent1:ActsAnsWantAgentOneTest", - "wantagent1promise:ActsAnsWantAgentOneProTest", - "wantagent2:ActsAnsWantAgentTwoTest", - "wantagent2promise:ActsAnsWantAgentTwoProTest", - "wantagent3:ActsAnsWantAgentTreeTest", - "wantagent3promise:ActsAnsWantAgentTreeProTest", - "wantagent4:ActsAnsWantAgentFourTest", - "wantagent4promise:ActsAnsWantAgentFourProTest", - "wantagent5:ActsAnsWantAgentFiveTest", - "wantagent5promise:ActsAnsWantAgentFiveProTest", - ] - } -} diff --git a/notification/ans_standard/publish_test/wantagent/test1/BUILD.gn b/notification/ans_standard/publish_test/wantagent/test1/BUILD.gn deleted file mode 100644 index fd47b8dc08b95fcdf97c3de98accc5ab43d290e4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/test1/BUILD.gn +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("test1") { - hap_profile = "./entry/src/main/config.json" - hap_name = "test1" - subsystem_name = "notification" - part_name = "distributed_notification_service" - testonly = true - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/config.json b/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/config.json deleted file mode 100644 index 7cd98f72e355621ec42c6252d336f58174dbb27c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/config.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "app": { - "bundleName": "com.example.WantAgentTest1", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.WantAgentTest1", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.WantAgentTest1.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index aa13e19ea206c08a562754f7cef3572726e96941..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - Page 1 - -
diff --git a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index 219ee80b4bb4d98a444acad561ef660c6c7ad153..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index f65b394eb7a98a4058d726bacda53fe1221d909d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "test1" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/test1/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/test1/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/wantagent/test1/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/test1/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/test2/BUILD.gn b/notification/ans_standard/publish_test/wantagent/test2/BUILD.gn deleted file mode 100644 index 28abbb7dd04dc6dd997a85cec86c622a3fe0e01d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/test2/BUILD.gn +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import("//test/xts/tools/build/suite.gni") - -ohos_hap_assist_suite("test2") { - hap_profile = "./entry/src/main/config.json" - hap_name = "test2" - subsystem_name = "notification" - part_name = "distributed_notification_service" - testonly = true - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/config.json b/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/config.json deleted file mode 100644 index 2596b3cc53bf2cbdf24dde7a38594a80e4f1ec44..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/config.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "app": { - "bundleName": "com.example.WantAgenTest2", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.WantAgenTest2", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.WantAgenTest2.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 5f0dc11c72dd500785428632bfbba9d776ab70ac..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - Page 2 - -
diff --git a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index 219ee80b4bb4d98a444acad561ef660c6c7ad153..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index dd75de46505148f70190b878f16fe858628fcfda..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Test2" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/test2/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/test2/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/wantagent/test2/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/test2/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/BUILD.gn b/notification/ans_standard/publish_test/wantagent/wantagent1/BUILD.gn deleted file mode 100644 index 963342d45481e0199e13b958ad13bf35403ea21e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsWantAgentOneTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsWantAgentOneTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/Test.json b/notification/ans_standard/publish_test/wantagent/wantagent1/Test.json deleted file mode 100644 index 4ec83e0a14ca2cd0b7f4f020d3f6880738f65482..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/Test.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "160000", - "shell-timeout": "160000", - "bundle-name": "com.example.actsanswantagentonetest", - "package-name": "com.example.actsanswantagentonetest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsWantAgentOneTest.hap", - "test1.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/wantagent/wantagent1/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/wantagent1/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/config.json b/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/config.json deleted file mode 100644 index 540131f638a5cd8b0dd08394abb15303d8613ea6..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanswantagentonetest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanswantagentonetest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index a5e37ac290b36e20543922493f7a31971181209f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - WantAgent1 Startup - -
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/test/List.test.js deleted file mode 100644 index f1e05b3417cb97fc9c09fdc8e765ef4829925b06..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsWantAgentOneTest from './WantAgent.test.js' -export default function testsuite() { -ActsAnsWantAgentOneTest() -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/test/WantAgent.test.js deleted file mode 100644 index fc4199e32b5f1e64c45bd72c28624cd53394f5ec..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/js/test/WantAgent.test.js +++ /dev/null @@ -1,666 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import wantAgent from '@ohos.wantAgent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'; -var time = 1000 -var WantAgent; -export default function ActsAnsWantAgentOneTest() { -describe('ActsAnsWantAgentOneTest', function () { - console.info('----ActsWantAgentTest----'); - - /* - * @tc.number: ACTS_SetWant_0100 - * @tc.name: getWantAgent(OperationType.START_ABILITY) - * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY) - */ - it('ACTS_SetWant_0100', 0, async function (done) { - console.info('----ACTS_SetWant_0100 start----'); - var agentInfo = { - wants: [ - { - deviceId: "", - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.WantAgentTest1.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - await wantAgent.getWantAgent(agentInfo, - (err, data) => { - if (err.code == 0) { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - var triggerInfo = { - code:0 - } - wantAgent.trigger(WantAgent, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('----trigger success!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - expect(data.finalCode).assertEqual(0); - expect(data.finalData).assertEqual(""); - expect(data.want.deviceId).assertEqual(""); - expect(data.want.bundleName).assertEqual("com.example.WantAgentTest1"); - expect(data.want.abilityName).assertEqual("com.example.WantAgentTest1.MainAbility"); - expect(data.want.uri).assertEqual("key={true,true,false}"); - expect(JSON.stringify(data.want.entities)).assertEqual(JSON.stringify(["entity1"])); - expect(data.want.action).assertEqual("action1"); - } else { - console.info('----trigger failed!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } - done(); - } - ); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - } - - ); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWant_0100====>"); - }, time); - - console.info('----getWantAgent after----'); - }) - - /* - * @tc.number: ACTS_SetWant_0200 - * @tc.name: getWantAgent(OperationType.START_ABILITY) - * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY)[ONE_TIME_FLAG] - */ - it('ACTS_SetWant_0200', 0, async function (done) { - console.info('----ACTS_SetWant_0200 start----'); - var agentInfo = { - wants: [ - { - deviceId: "", - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.ONE_TIME_FLAG] - } - console.info('----getWantAgent before----'); - await wantAgent.getWantAgent(agentInfo, - (err, data) => { - if (err.code == 0) { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - } - - ); - console.info('----getWantAgent after----'); - }) - - /* - * @tc.number: ACTS_SetWant_0300 - * @tc.name: getWantAgent(OperationType.START_ABILITY) - * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY)[NO_BUILD_FLAG] - */ - it('ACTS_SetWant_0300', 0, async function (done) { - console.info('----ACTS_SetWant_0300 start----'); - var agentInfo = { - wants: [ - { - deviceId: "", - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.NO_BUILD_FLAG] - } - console.info('----getWantAgent before----'); - await wantAgent.getWantAgent(agentInfo, - (err, data) => { - if (err.code == 0) { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - } - - ); - console.info('----getWantAgent after----'); - }) - - /* - * @tc.number: ACTS_SetWant_0400 - * @tc.name: getWantAgent(OperationType.START_ABILITY) - * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY)[CANCEL_PRESENT_FLAG] - */ - it('ACTS_SetWant_0400', 0, async function (done) { - console.info('----ACTS_SetWant_0400 start----'); - var agentInfo = { - wants: [ - { - deviceId: "", - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.CANCEL_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - await wantAgent.getWantAgent(agentInfo, - (err, data) => { - if (err.code == 0) { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - } - - ); - console.info('----getWantAgent after----'); - }) - - /* - * @tc.number: ACTS_SetWant_0500 - * @tc.name: getWantAgent(OperationType.START_ABILITY) - * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY)[CONSTANT_FLAG] - */ - it('ACTS_SetWant_0500', 0, async function (done) { - console.info('----ACTS_SetWant_0500 start----'); - var agentInfo = { - wants: [ - { - deviceId: "", - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.CONSTANT_FLAG] - } - console.info('----getWantAgent before----'); - await wantAgent.getWantAgent(agentInfo, - (err, data) => { - if (err.code == 0) { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - } - - ); - console.info('----getWantAgent after----'); - }) - - /* - * @tc.number: ACTS_SetWant_0600 - * @tc.name: getWantAgent(OperationType.START_ABILITY) - * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY)[REPLACE_ELEMENT] - */ - it('ACTS_SetWant_0600', 0, async function (done) { - console.info('----ACTS_SetWant_0600 start----'); - var agentInfo = { - wants: [ - { - deviceId: "", - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.REPLACE_ELEMENT] - } - console.info('----getWantAgent before----'); - await wantAgent.getWantAgent(agentInfo, - (err, data) => { - if (err.code == 0) { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - } - - ); - console.info('----getWantAgent after----'); - }) - - /* - * @tc.number: ACTS_SetWant_0700 - * @tc.name: getWantAgent(OperationType.START_ABILITY) - * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY)[REPLACE_ACTION] - */ - it('ACTS_SetWant_0700', 0, async function (done) { - console.info('----ACTS_SetWant_0700 start----'); - var agentInfo = { - wants: [ - { - deviceId: "", - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.REPLACE_ACTION] - } - console.info('----getWantAgent before----'); - await wantAgent.getWantAgent(agentInfo, - (err, data) => { - if (err.code == 0) { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - } - - ); - console.info('----getWantAgent after----'); - }) - - - /* - * @tc.number: ACTS_SetWant_0800 - * @tc.name: getWantAgent(OperationType.START_ABILITY) - * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY)[REPLACE_URI] - */ - it('ACTS_SetWant_0800', 0, async function (done) { - console.info('----ACTS_SetWant_0800 start----'); - var agentInfo = { - wants: [ - { - deviceId: "", - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.REPLACE_URI] - } - console.info('----getWantAgent before----'); - await wantAgent.getWantAgent(agentInfo, - (err, data) => { - if (err.code == 0) { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - } - - ); - console.info('----getWantAgent after----'); - }) - - /* - * @tc.number: ACTS_SetWant_0900 - * @tc.name: getWantAgent(OperationType.START_ABILITY) - * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY)[REPLACE_ENTITIES] - */ - it('ACTS_SetWant_0900', 0, async function (done) { - console.info('----ACTS_SetWant_0900 start----'); - var agentInfo = { - wants: [ - { - deviceId: "", - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.REPLACE_ENTITIES] - } - console.info('----getWantAgent before----'); - await wantAgent.getWantAgent(agentInfo, - (err, data) => { - if (err.code == 0) { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - } - - ); - console.info('----getWantAgent after----'); - }) - - /* - * @tc.number: ACTS_SetWant_1000 - * @tc.name: getWantAgent(OperationType.START_ABILITY) - * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY)[REPLACE_BUNDLE] - */ - it('ACTS_SetWant_1000', 0, async function (done) { - console.info('----ACTS_SetWant_1000 start----'); - var agentInfo = { - wants: [ - { - deviceId: "", - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.test.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.REPLACE_BUNDLE] - } - console.info('----getWantAgent before----'); - await wantAgent.getWantAgent(agentInfo, - (err, data) => { - if (err.code == 0) { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - } - - ); - console.info('----getWantAgent after----'); - }) - - /* - * @tc.number: ACTS_SetWant_1100 - * @tc.name: getWantAgent(OperationType.START_ABILITY) - * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY) - */ - it('ACTS_SetWant_1100', 0, async function (done) { - console.info('----ACTS_SetWant_1100 start----'); - var agentInfo = { - wants: [ - { - deviceId: "", - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.WantAgentTest1.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - await wantAgent.getWantAgent(agentInfo, - (err, data) => { - if (err.code == 0) { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - var triggerInfo = { - code:0 - } - wantAgent.trigger(WantAgent, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('----trigger success!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - expect(data.info).assertEqual(WantAgent); - expect(data.want).assertEqual(Want); - expect(typeof(data.extraInfo)).assertEqual("object"); - expect(data.finalCode).assertEqual(0); - expect(data.finalData).assertEqual(""); - expect(data.want.deviceId).assertEqual(""); - expect(data.want.bundleName).assertEqual("com.example.WantAgentTest1"); - expect(data.want.abilityName).assertEqual("com.example.WantAgentTest1.MainAbility"); - expect(data.want.uri).assertEqual("key={true,true,false}"); - expect(JSON.stringify(data.want.entities)).assertEqual(JSON.stringify(["entity1"])); - expect(data.want.action).assertEqual("action1"); - } else { - console.info('----trigger failed!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } - done(); - } - ); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - } - - ); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWant_0700====>"); - }, 100); - - console.info('----getWantAgent after----'); - }) -}) - -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/resources/base/element/string.json deleted file mode 100644 index 4cd7230f8a5c83242c798030808db2b02b7a14d0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Want1" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/wantagent1/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/BUILD.gn b/notification/ans_standard/publish_test/wantagent/wantagent1promise/BUILD.gn deleted file mode 100644 index 11f94c4e8a383148c062f845e91523130c844842..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsWantAgentOneProTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsWantAgentOneProTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/Test.json b/notification/ans_standard/publish_test/wantagent/wantagent1promise/Test.json deleted file mode 100644 index 6685e836736b31cab047044f8c9ab55596631e29..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/Test.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "160000", - "shell-timeout": "160000", - "bundle-name": "com.example.actsanswantagentoneprotest", - "package-name": "com.example.actsanswantagentoneprotest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsWantAgentOneProTest.hap", - "test1.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/wantagent/wantagent1promise/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/wantagent1promise/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/config.json b/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/config.json deleted file mode 100644 index d545d71bbc793337e1a3bd6c6645ec013eee44c9..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanswantagentoneprotest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanswantagentoneprotest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 32862e858b08ed0f1d6654f22252612c2772939a..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - WantAgent1Promise Startup - -
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/test/List.test.js deleted file mode 100644 index 546de5d578fa94aa41450f553e812558b4284acb..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsWantAgentOneProTest from './WantAgent.test.js' -export default function testsuite() { -ActsAnsWantAgentOneProTest() -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/test/WantAgent.test.js deleted file mode 100644 index e7a343eb37cd9781486eb687a4fde5c22cd6f70d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/js/test/WantAgent.test.js +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import wantAgent from '@ohos.wantAgent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'; -var time = 1000 -var WantAgent; -export default function ActsAnsWantAgentOneProTest() { -describe('ActsAnsWantAgentOneProTest', function () { - console.info("----ActsWantAgentTest----"); - - /* - * @tc.number: ACTS_SetWant_0200 - * @tc.name: getWantAgent(OperationType.START_ABILITY) - * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY) - */ - it("ACTS_SetWant_0200", 0, async function (done) { - var agentInfo = { - wants: [ - { - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.WantAgentTest1.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - }, - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags: [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG], - }; - console.info("----getWantAgent before----"); - wantAgent.getWantAgent(agentInfo).then((data) => { - WantAgent = data; - console.info("----getWantAgent success!----"); - console.info(JSON.stringify(data)); - expect(typeof data).assertEqual("object"); - var triggerInfo = { - code: 0, - }; - wantAgent.trigger(WantAgent, triggerInfo, (err, data) => { - if (err.code == 0) { - console.info("----trigger success!----"); - console.info("== trigger data " + JSON.stringify(data)); - } else { - console.info("----trigger failed!----"); - console.info("== trigger data " + JSON.stringify(data)); - } - done(); - }); - done(); - }); - setTimeout(function () { - console.debug("====>time out ACTS_SetWant_0200====>"); - }, time); - console.info("----getWantAgent after----"); - }); - - /* - * @tc.number: ACTS_SetWant_0300 - * @tc.name: getWantAgent(OperationType.START_ABILITY) - * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITY) - */ - it("ACTS_SetWant_0300", 0, async function (done) { - var agentInfo = { - wants: [ - { - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.WantAgentTest1.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - }, - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags: [wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG], - extraInfo: { - key1:'test_extraInfo' - } - }; - console.info("----getWantAgent before----"); - wantAgent.getWantAgent(agentInfo).then((data) => { - WantAgent = data; - console.info("----getWantAgent success!----"); - console.info(JSON.stringify(data)); - expect(typeof data).assertEqual("object"); - var triggerInfo = { - code: 0, - want:WantAgent, - permission:'', - extraInfo: { - key1:'test_triggerInfo' - } - }; - wantAgent.trigger(WantAgent, triggerInfo, (err, data) => { - if (err.code == 0) { - console.info("----trigger success!----"); - console.info("== trigger data " + JSON.stringify(data)); - } else { - console.info("----trigger failed!----"); - console.info("== trigger data " + JSON.stringify(data)); - } - done(); - }); - done(); - }); - setTimeout(function () { - console.debug("====>time out ACTS_SetWant_0200====>"); - }, time); - console.info("----getWantAgent after----"); - }); -}) - -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/resources/base/element/string.json deleted file mode 100644 index 55ba0c1ffd626ad7f68515bd08ce82d940aaf4dd..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "WantPro1" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/wantagent1promise/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/BUILD.gn b/notification/ans_standard/publish_test/wantagent/wantagent2/BUILD.gn deleted file mode 100644 index 14f13162f620938d49a7b082a14f4e7db97517a2..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsWantAgentTwoTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsWantAgentTwoTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/Test.json b/notification/ans_standard/publish_test/wantagent/wantagent2/Test.json deleted file mode 100644 index 3ecbd73c290e811308c451fec3d8908c9cd2c290..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/Test.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "shell-timeout": "180000", - "bundle-name": "com.example.actsanswantagenttwotest", - "package-name": "com.example.actsanswantagenttwotest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsWantAgentTwoTest.hap", - "test1.hap", - "test2.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/wantagent/wantagent2/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/wantagent2/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/config.json b/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/config.json deleted file mode 100644 index 5b64fd07d9408926f059f3d03dc77eb364db8092..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanswantagenttwotest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanswantagenttwotest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index d51626a268e8bcd6e7f4411094e0bf97b3c66284..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - WantAgent2 Startup - -
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/test/List.test.js deleted file mode 100644 index 95877f49bb8fd24715eb172515695f8580fc7d62..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsWantAgentTwoTest from './WantAgent.test.js' -export default function testsuite() { -ActsAnsWantAgentTwoTest() -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/test/WantAgent.test.js deleted file mode 100644 index 6baa403c5446526cbec35f82e697013138005fdd..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/js/test/WantAgent.test.js +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import wantAgent from '@ohos.wantAgent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'; -var time = 1000 -var WantAgent; -export default function ActsAnsWantAgentTwoTest() { -describe('ActsAnsWantAgentTwoTest', function () { - - /* - * @tc.number: ACTS_SetWant_0300 - * @tc.name: getWantAgent(OperationType.START_ABILITIES) - * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITIES) - */ - it('ACTS_SetWant_0300', 0, async function (done) { - var agentInfo = { - wants: [ - { - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.WantAgentTest1.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - { - bundleName: "com.example.WantAgenTest2", - abilityName: "com.example.WantAgenTest2.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - } - ], - operationType: wantAgent.OperationType.START_ABILITIES, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - wantAgent.getWantAgent(agentInfo, - (err, data) => { - if (err.code == 0) { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - var triggerInfo = { - code:0 - } - wantAgent.trigger(WantAgent, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('----trigger success!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } else { - console.info('----trigger failed!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } - done(); - } - ); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - } - - ); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWant_0300====>"); - }, time); - console.info('----getWantAgent after----'); - }) -}) - -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/resources/base/element/string.json deleted file mode 100644 index 846d9fdd82700705e036c79145bb86b516bdcc6c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Want2" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/wantagent2/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/BUILD.gn b/notification/ans_standard/publish_test/wantagent/wantagent2promise/BUILD.gn deleted file mode 100644 index ae27f07b7507822aabdc9f250753006238d53aea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsWantAgentTwoProTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsWantAgentTwoProTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/Test.json b/notification/ans_standard/publish_test/wantagent/wantagent2promise/Test.json deleted file mode 100644 index 799286c17b69147ebcea54ce8734f58b809f584d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/Test.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "260000", - "shell-timeout": "260000", - "bundle-name": "com.example.actsanswantagenttwoprotest", - "package-name": "com.example.actsanswantagenttwoprotest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsWantAgentTwoProTest.hap", - "test1.hap", - "test2.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/wantagent/wantagent2promise/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/wantagent2promise/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/config.json b/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/config.json deleted file mode 100644 index 294cd3bdf94ec90a57d0a59906b536a9c9b0ef30..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanswantagenttwoprotest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanswantagenttwoprotest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 12c2d27a6c7aaaa591a8c4328bff257090617674..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - WantAgentPromise2 Startup - -
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/test/List.test.js deleted file mode 100644 index e8c8613e236aff9f38d1560dc84d91b7bd3c2a4a..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsWantAgentTwoProTest from './WantAgent.test.js' -export default function testsuite() { -ActsAnsWantAgentTwoProTest() -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/test/WantAgent.test.js deleted file mode 100644 index 78e1e6e0c0d786a8f0638e9a11a67d5048e6de1e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/js/test/WantAgent.test.js +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import wantAgent from '@ohos.wantAgent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'; -var time = 1000 -var WantAgent; -export default function ActsAnsWantAgentTwoProTest() { -describe('ActsAnsWantAgentTwoProTest', function () { - - /* - * @tc.number: ACTS_SetWant_0400 - * @tc.name: getWantAgent(OperationType.START_ABILITIES) - * @tc.desc: verify the function of getWantAgent(OperationType.START_ABILITIES) - */ - it('ACTS_SetWant_0400', 0, async function (done) { - expect(3).assertEqual(wantAgent.OperationType.START_SERVICE) - var agentInfo = { - wants: [ - { - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.WantAgentTest1.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - { - bundleName: "com.example.WantAgenTest2", - abilityName: "com.example.WantAgenTest2.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - } - ], - operationType: wantAgent.OperationType.START_ABILITIES, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - wantAgent.getWantAgent(agentInfo).then( - (data) => { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - var triggerInfo = { - code:0 - } - wantAgent.trigger(WantAgent, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('----trigger success!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } else { - console.info('----trigger failed!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } - done(); - } - ); - done(); - } - ); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWant_0400====>"); - }, time); - console.info('----getWantAgent after----'); - }) - -}) - -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/resources/base/element/string.json deleted file mode 100644 index 661e71b9907187b19de930d219ea402e0817c49c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "WantPro2" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/wantagent2promise/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/BUILD.gn b/notification/ans_standard/publish_test/wantagent/wantagent3/BUILD.gn deleted file mode 100644 index 611c86320e90da8b2d62239534547c970f803d0b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsWantAgentTreeTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsWantAgentTreeTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/Test.json b/notification/ans_standard/publish_test/wantagent/wantagent3/Test.json deleted file mode 100644 index d06015403e944cae8383ff95390c04a994ad0aeb..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "160000", - "shell-timeout": "160000", - "bundle-name": "com.example.actsanswantagenttreetest", - "package-name": "com.example.actsanswantagenttreetest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsWantAgentTreeTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/wantagent/wantagent3/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/wantagent3/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/config.json b/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/config.json deleted file mode 100644 index 6167871a5add6e46856bd85c04032af99ef702fe..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanswantagenttreetest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanswantagenttreetest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 971ddbcb1dedd03243021514d4f3495f8f169f9e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - WantAgent3 Startup - -
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/test/List.test.js deleted file mode 100644 index e5b1a401d0ef065d95fba51961318d7d571eb4ec..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsWantAgentTreeTest from './WantAgent.test.js' -export default function testsuite() { -ActsAnsWantAgentTreeTest() -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/test/WantAgent.test.js deleted file mode 100644 index a87b9563fe082c081be4f989806a3324b6b20dea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/js/test/WantAgent.test.js +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import wantAgent from '@ohos.wantAgent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'; -var time = 1000 -var WantAgent; -export default function ActsAnsWantAgentTreeTest() { -describe('ActsAnsWantAgentTreeTest', function () { - - /* - * @tc.number: ACTS_SetWant_0500 - * @tc.name: getWantAgent(OperationType.SEND_COMMON_EVENT) - * @tc.desc: verify the function of getWantAgent(OperationType.SEND_COMMON_EVENT) - */ - it('ACTS_SetWant_0500', 0, async function (done) { - var agentInfo = { - wants: [ - { - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.WantAgentTest1.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.SEND_COMMON_EVENT, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - wantAgent.getWantAgent(agentInfo, - (err, data) => { - if (err.code == 0) { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - var triggerInfo = { - code:0 - } - wantAgent.trigger(WantAgent, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('----trigger success!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } else { - console.info('----trigger failed!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } - done(); - } - ); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - - } - ); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWant_0500====>"); - }, time) - console.info('----getWantAgent after----'); - }) -}) - -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/resources/base/element/string.json deleted file mode 100644 index 8968aafcbcd2a2958efbb92689196243c376ae51..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "WantAgent3" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/wantagent3/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/BUILD.gn b/notification/ans_standard/publish_test/wantagent/wantagent3promise/BUILD.gn deleted file mode 100644 index a203275fe629529a2d7fa5e82c0ce90ac79bbfcf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsWantAgentTreeProTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsWantAgentTreeProTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/Test.json b/notification/ans_standard/publish_test/wantagent/wantagent3promise/Test.json deleted file mode 100644 index fe00a782869d03153460acdf597cebca70d235fa..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "160000", - "shell-timeout": "160000", - "bundle-name": "com.example.actsanswantagenttreeprotest", - "package-name": "com.example.actsanswantagenttreeprotest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsWantAgentTreeProTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/wantagent/wantagent3promise/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/wantagent3promise/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/config.json b/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/config.json deleted file mode 100644 index 0ea0b0805db57a216068aa0b39b6cc2baaf7e126..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanswantagenttreeprotest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanswantagenttreeprotest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index b20dcf3a783abb4605b7b3866e22faaac0e0b7fb..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - WantAgentPromise3 Startup - -
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/test/List.test.js deleted file mode 100644 index 6934c4f416f62e40aac9a4326c91f124f2df9dbb..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsWantAgentTreeProTest from './WantAgent.test.js' -export default function testsuite() { -ActsAnsWantAgentTreeProTest() -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/test/WantAgent.test.js deleted file mode 100644 index 7f9a2ad9bf4c703dfb68a82e100a42e36f0ccb7a..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/js/test/WantAgent.test.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import wantAgent from '@ohos.wantAgent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'; -var time = 1000 -var WantAgent; -export default function ActsAnsWantAgentTreeProTest() { -describe('ActsAnsWantAgentTreeProTest', function () { - - /* - * @tc.number: ACTS_SetWant_0600 - * @tc.name: getWantAgent(OperationType.SEND_COMMON_EVENT) - * @tc.desc: verify the function of getWantAgent(OperationType.SEND_COMMON_EVENT) - */ - it('ACTS_SetWant_0600', 0, async function (done) { - var agentInfo = { - wants: [ - { - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.WantAgentTest1.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.SEND_COMMON_EVENT, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - wantAgent.getWantAgent(agentInfo).then( - (data) => { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - var triggerInfo = { - code:0 - } - wantAgent.trigger(WantAgent, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('----trigger success!----'); - console.info('==================== trigger data ' + JSON.stringify(data) ); - } else { - console.info('----trigger failed!----'); - console.info('==================== trigger data ' + JSON.stringify(data) ); - } - done(); - } - ); - done(); - - } - ); -setTimeout(function(){ - console.debug("====>time out ACTS_SetWant_0600====>"); - }, time); - console.info('----getWantAgent after----'); - }) -}) - -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/resources/base/element/string.json deleted file mode 100644 index 9d1c23f24266b0ea889593418881801cfac3ea04..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "WantAgentPromise3" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/wantagent3promise/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/BUILD.gn b/notification/ans_standard/publish_test/wantagent/wantagent4/BUILD.gn deleted file mode 100644 index 0f52b70d8535a4975543ec526fc43512dc66452b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsWantAgentFourTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsWantAgentFourTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/Test.json b/notification/ans_standard/publish_test/wantagent/wantagent4/Test.json deleted file mode 100644 index 380a091dadaf9862ce5e75aed054f6b33b8c4b01..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "160000", - "shell-timeout": "160000", - "bundle-name": "com.example.actsanswantagentfourtest", - "package-name": "com.example.actsanswantagentfourtest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsWantAgentFourTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/wantagent/wantagent4/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/wantagent4/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/config.json b/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/config.json deleted file mode 100644 index 2ac792e1b28e6d6f05f4ad7e902058e43ac57493..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanswantagentfourtest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanswantagentfourtest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 4b7693140c3d87aa107bc57ed196e4c7f094f279..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - WantAgent4 Startup - -
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/test/List.test.js deleted file mode 100644 index 94104ad7aa5db20f03b80edb9524dfef0df973ce..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsWantAgentFourTest from './WantAgent.test.js' -export default function testsuite() { -ActsAnsWantAgentFourTest() -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/test/WantAgent.test.js deleted file mode 100644 index ca40d80b64aa9f9d96ed4f7a460acb7c477d4037..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/js/test/WantAgent.test.js +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import wantAgent from '@ohos.wantAgent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'; -var time = 1000 -var WantAgent; -export default function ActsAnsWantAgentFourTest() { -describe('ActsAnsWantAgentFourTest', function () { - - /* - * @tc.number: ACTS_SetWant_0700 - * @tc.name: getWantAgent(OperationType.UNKNOWN_TYPE) - * @tc.desc: verify the function of getWantAgent(OperationType.UNKNOWN_TYPE) - */ - it('ACTS_SetWant_0700', 0, async function (done) { - var agentInfo = { - wants: [ - { - deviceId: "", - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.WantAgentTest1.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.UNKNOWN_TYPE, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - wantAgent.getWantAgent(agentInfo, - (err, data) => { - if (err.code == 0) { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - var triggerInfo = { - code:0 - } - wantAgent.trigger(WantAgent, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('----trigger success!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } else { - console.info('----trigger failed!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } - done(); - } - ); - expect(typeof(data)).assertEqual("object"); - } else { - console.info('----getWantAgent failed!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - } - done(); - - } - ); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWant_0700====>"); - }, time); - console.info('----getWantAgent after----'); - }) -}) - -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/resources/base/element/string.json deleted file mode 100644 index 9204f315020e8dc2cac72f52a82e2d34ce72204a..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "WantAgent4" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/wantagent4/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/BUILD.gn b/notification/ans_standard/publish_test/wantagent/wantagent4promise/BUILD.gn deleted file mode 100644 index 81b468e57c8f19ae2ee26dde4c11e3fbd6f78be8..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsWantAgentFourProTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsWantAgentFourProTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/Test.json b/notification/ans_standard/publish_test/wantagent/wantagent4promise/Test.json deleted file mode 100644 index e5beb1779b67fd3760c283be6f8a1bd63a4f7a9d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "160000", - "shell-timeout": "160000", - "bundle-name": "com.example.actsanswantagentfourprotest", - "package-name": "com.example.actsanswantagentfourprotest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsWantAgentFourProTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/wantagent/wantagent4promise/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/wantagent4promise/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/config.json b/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/config.json deleted file mode 100644 index 3aa3d8730ca932f43c064e17bb4c6dd2eb2422d0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanswantagentfourprotest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanswantagentfourprotest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 9bfc9832c3df70756a7177650470926f6798c34e..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - WantAgentPromise4 Startup - -
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/test/List.test.js deleted file mode 100644 index 066be22c504cc25f2924089667243638ab790e4f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsWantAgentFourProTest from './WantAgent.test.js' -export default function testsuite() { -ActsAnsWantAgentFourProTest() -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/test/WantAgent.test.js deleted file mode 100644 index 03f00b299cb83ee429a69d13dd8724011be59eb0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/js/test/WantAgent.test.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import wantAgent from '@ohos.wantAgent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'; -var time = 1000 -var WantAgent; -export default function ActsAnsWantAgentFourProTest() { -describe('ActsAnsWantAgentFourProTest', function () { - - /* - * @tc.number: ACTS_SetWant_0800 - * @tc.name: getWantAgent(OperationType.UNKNOWN_TYPE) - * @tc.desc: verify the function of getWantAgent(OperationType.UNKNOWN_TYPE) - */ - it('ACTS_SetWant_0800', 0, async function (done) { - var agentInfo = { - wants: [ - { - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.WantAgentTest1.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.UNKNOWN_TYPE, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - wantAgent.getWantAgent(agentInfo).then( - (data) => { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - var triggerInfo = { - code:0 - } - wantAgent.trigger(WantAgent, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('----trigger success!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } else { - console.info('----trigger failed!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } - done(); - } - ); - done(); - - } - ); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWant_0800====>"); - }, time); - console.info('----getWantAgent after----'); - }) -}) - -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/resources/base/element/string.json deleted file mode 100644 index eb647a68fa49a6dc49f4348b6069867f2c4424c6..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "WantAgentPromise4" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/wantagent4promise/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/BUILD.gn b/notification/ans_standard/publish_test/wantagent/wantagent5/BUILD.gn deleted file mode 100644 index b08386e777cdf5781e1649afef7023b99d88c97b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsWantAgentFiveTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsWantAgentFiveTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/Test.json b/notification/ans_standard/publish_test/wantagent/wantagent5/Test.json deleted file mode 100644 index ede0aa3e6ed02d20d99ceaa8bd60a2e337852187..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "160000", - "shell-timeout": "160000", - "bundle-name": "com.example.actsanswantagentfivetest", - "package-name": "com.example.actsanswantagentfivetest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsWantAgentFiveTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/wantagent/wantagent5/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/wantagent5/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/config.json b/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/config.json deleted file mode 100644 index 178d2497117e5da9dff86e72e03e4d22da27fc53..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanswantagentfivetest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanswantagentfivetest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 4bc7e63ea5e31c4348c35c119629b7e5967e1cc1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 7718fb6f94083d56dca32bacb70aecb1f6b6b921..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - WantAgent5 Startup - -
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/test/List.test.js deleted file mode 100644 index ddeda185b0282a63c393e9b9768f0d076ea62fd7..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsWantAgentFiveTest from './WantAgent.test.js' -export default function testsuite() { -ActsAnsWantAgentFiveTest() -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/test/WantAgent.test.js deleted file mode 100644 index 81edb327766c9cb77e987aa0ac578d2247855d9d..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/js/test/WantAgent.test.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import wantAgent from '@ohos.wantAgent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'; -var time = 1000 -var WantAgent; -export default function ActsAnsWantAgentFiveTest() { -describe('ActsAnsWantAgentFiveTest', function () { - - /* - * @tc.number: ACTS_SetWant_0900 - * @tc.name: getWantAgent() - * @tc.desc: verify the function of getWantAgent() - */ - it('ACTS_SetWant_0900', 0, async function (done) { - var agentInfo = { - wants: [ - { - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.WantAgentTest1.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], - operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - wantAgent.getWantAgent(agentInfo, - (err, data) => { - if (err.code == 0) { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - var triggerInfo = { - code:0 - } - wantAgent.trigger(WantAgent, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('----trigger success!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } else { - console.info('----trigger failed!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } - done(); - } - ); - } else { - expect(err.code).assertEqual(-1) - } - done(); - - } - ); - setTimeout(function(){ - console.debug("====>time out ACTS_SetWant_0900====>"); - }, time); - console.info('----getWantAgent after----'); - }) -}) - -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/resources/base/element/string.json deleted file mode 100644 index 24b412805b3e4f6f0684154245306f08c178945c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "WantAgent5" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/wantagent5/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/BUILD.gn b/notification/ans_standard/publish_test/wantagent/wantagent5promise/BUILD.gn deleted file mode 100644 index 05cf376971cfcdd0a8ecfa2a462658ec52d1eb93..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAnsWantAgentFiveProTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsWantAgentFiveProTest" - subsystem_name = "notification" - part_name = "distributed_notification_service" -} -ohos_js_assets("hjs_demo_js_assets") { - js2abc = true - hap_profile = "./src/main/config.json" - source_dir = "./src/main/js" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/Test.json b/notification/ans_standard/publish_test/wantagent/wantagent5promise/Test.json deleted file mode 100644 index c154a6da7c477211e1ff799f721e2372ca2cabeb..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/Test.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "160000", - "shell-timeout": "160000", - "bundle-name": "com.example.actsanswantagentfiveprotest", - "package-name": "com.example.actsanswantagentfiveprotest" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsWantAgentFiveProTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/wantagent/wantagent5promise/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/wantagent5promise/signature/openharmony_sx.p7b and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/config.json b/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/config.json deleted file mode 100644 index d295f22d084a9e6fa2ea44e1daa908611e9aa4a5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanswantagentfiveprotest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanswantagentfiveprotest", - "name": ".entry", - "deviceType": [ - "phone" - ], - "reqPermissions": [ - { - "name": "ohos.permission.NOTIFICATION_CONTROLLER" - } - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "js", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "orientation": "unspecified", - "formsEnabled": false, - "name": ".TestAbility", - "srcLanguage": "js", - "srcPath": "TestAbility", - "icon": "$media:icon", - "description": "$string:TestAbility_desc", - "label": "$string:TestAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - }, - { - "pages": [ - "pages/index/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ], - "testRunner": { - "name": "OpenHarmonyTestRunner", - "srcPath": "TestRunner" - }, - "mainAbility": ".MainAbility", - "srcPath": "" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/MainAbility/app.js b/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/MainAbility/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/MainAbility/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbdc39c537073f638393d7726ac9a5cdc4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/MainAbility/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f72f929e4375a43170444de95dcc5984..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/MainAbility/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 09696c297ee9837d996bd113bf8d41b67f236f7b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/MainAbility/pages/index/index.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - .container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index aa9838e1751c13147f1cdabe4540036d0d051738..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/MainAbility/pages/index/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -
- - WantAgentPromise5 Startup - -
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa334075fc3e3c0273e48f472a44dc9b3b38f0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/MainAbility/pages/index/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestAbility/app.js b/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dcf031e2f6a7665d9653e53bb649e21c5..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestAbility/app.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default { - onCreate() { - console.info('TestApplication onCreate') - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info("TestApplication onDestroy"); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374b1d919ca8eac0638f361692b603a900..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestAbility/i18n/en-US.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0c3103929baca5617cdac70be11fdba1..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestAbility/i18n/zh-CN.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - }, - "Files": { - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd43387ba131cc1d30975ff7508a6f8084a4b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestAbility/pages/index/index.css +++ /dev/null @@ -1,30 +0,0 @@ -.container { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - left: 0px; - top: 0px; - width: 100%; - height: 100%; -} - -.title { - font-size: 60px; - text-align: center; - width: 100%; - height: 40%; - margin: 10px; -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9be857db6cdf94149652a191b9b272ea..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f6b979019d6a2c5ad20b19c5fd43286b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestAbility/pages/index/index.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - } -} - - - diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620ca77d381f20b65a903b833e6e3378c97..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/TestRunner/OpenHarmonyTestRunner.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -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', '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams += ' ' + key + ' ' + parameters[key] - } - } - return targetParams.trim() -} - - export default { - onPrepare() { - console.info('OpenHarmonyTestRunner OnPrepare') - }, - onRun() { - console.log('OpenHarmonyTestRunner onRun run') - var abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - - var testAbilityName = abilityDelegatorArguments.parameters['-p'] + '.TestAbility' - - var cmd = 'aa start -d 0 -a ' + testAbilityName + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' ' + translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - console.info('debug value : '+debug) - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, (err, data) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + data.stdResult); - console.info('executeShellCommand : data : ' + data.exitCode); - }) - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/test/List.test.js deleted file mode 100644 index e29b37c222e8204bc9cdcd036eb9672811e980e3..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import ActsAnsWantAgentFiveProTest from './WantAgent.test.js' -export default function testsuite() { -ActsAnsWantAgentFiveProTest() -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/test/WantAgent.test.js deleted file mode 100644 index be7898790bac53eaaeeb927fc149b8cce4900754..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/js/test/WantAgent.test.js +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import wantAgent from '@ohos.wantAgent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '@ohos/hypium'; -var time = 1000 -var WantAgent; -export default function ActsAnsWantAgentFiveProTest() { -describe('ActsAnsWantAgentFiveProTest', function () { - - /* - * @tc.number: ACTS_SetWant_1000 - * @tc.name: getWantAgent() - * @tc.desc: verify the function of getWantAgent() - */ - it('ACTS_SetWant_1000', 0, async function (done) { - var agentInfo = { - wants: [ - { - bundleName: "com.example.WantAgentTest1", - abilityName: "com.example.WantAgentTest1.MainAbility", - action: "action1", - entities: ["entity1"], - type: "MIMETYPE", - uri: "key={true,true,false}", - parameters: - { - mykey0: 2222, - mykey1: [1, 2, 3], - mykey2: "[1, 2, 3]", - mykey3: "ssssssssssssssssssssssssss", - mykey4: [false, true, false], - mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"], - mykey6: true, - } - }, - ], -// operationType: wantAgent.OperationType.START_ABILITY, - requestCode: 0, - wantAgentFlags:[wantAgent.WantAgentFlags.UPDATE_PRESENT_FLAG] - } - console.info('----getWantAgent before----'); - wantAgent.getWantAgent(agentInfo).then( - (data) => { - WantAgent = data; - console.info('----getWantAgent success!----'); - console.info(data); - expect(typeof(data)).assertEqual("object"); - var triggerInfo = { - code:0 - } - wantAgent.trigger(WantAgent, triggerInfo, - (err, data) => { - if (err.code == 0) { - console.info('----trigger success!----'); - console.info('== trigger data ' + JSON.stringify(data) ); - } else { - expect(err.code).assertEqual(-1) - } - done(); - } - ); - done(); - } - ).catch((err)=>{ - expect(err.code).assertEqual(-1) - done() - }) - setTimeout(function(){ - console.debug("====>time out ACTS_SetWant_1000====>"); - }, time); - console.info('----getWantAgent after----'); - }) -}) - -} diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/resources/base/element/string.json deleted file mode 100644 index 5507036d4d1541beb8223b9ca80f6331c296e50b..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "WantAgentPromise5" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - }, - { - "name": "MainAbility_desc", - "value": "description" - }, - { - "name": "MainAbility_label", - "value": "label" - }, - { - "name": "TestAbility_desc", - "value": "description" - }, - { - "name": "TestAbility_label", - "value": "label" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/resources/base/media/icon.png b/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/wantagent5promise/src/main/resources/base/media/icon.png and /dev/null differ