From 9211831f5c19033152fc60b7054cba12ab2ab732 Mon Sep 17 00:00:00 2001 From: zhijianwen Date: Fri, 2 Sep 2022 16:21:43 +0800 Subject: [PATCH] delete remove Signed-off-by: zhijianwen --- notification/ans_standard/BUILD.gn | 1 - .../actsansnotificationremove/BUILD.gn | 35 - .../actsansnotificationremove/Test.json | 19 - .../signature/openharmony_sx.p7b | Bin 3442 -> 0 bytes .../src/main/config.json | 99 - .../src/main/js/MainAbility/app.js | 22 - .../src/main/js/MainAbility/i18n/en-US.json | 6 - .../src/main/js/MainAbility/i18n/zh-CN.json | 6 - .../main/js/MainAbility/pages/index/index.css | 24 - .../main/js/MainAbility/pages/index/index.hml | 20 - .../main/js/MainAbility/pages/index/index.js | 34 - .../src/main/js/TestAbility/app.js | 31 - .../src/main/js/TestAbility/i18n/en-US.json | 8 - .../src/main/js/TestAbility/i18n/zh-CN.json | 8 - .../main/js/TestAbility/pages/index/index.css | 30 - .../main/js/TestAbility/pages/index/index.hml | 5 - .../main/js/TestAbility/pages/index/index.js | 26 - .../js/TestRunner/OpenHarmonyTestRunner.js | 59 - .../js/test/ActsAnsNotificationRemove.test.js | 3088 ----------------- .../src/main/js/test/List.test.js | 18 - .../main/resources/base/element/string.json | 28 - .../src/main/resources/base/media/icon.png | Bin 6790 -> 0 bytes 22 files changed, 3567 deletions(-) delete mode 100644 notification/ans_standard/actsansnotificationremove/BUILD.gn delete mode 100644 notification/ans_standard/actsansnotificationremove/Test.json delete mode 100644 notification/ans_standard/actsansnotificationremove/signature/openharmony_sx.p7b delete mode 100644 notification/ans_standard/actsansnotificationremove/src/main/config.json delete mode 100644 notification/ans_standard/actsansnotificationremove/src/main/js/MainAbility/app.js delete mode 100644 notification/ans_standard/actsansnotificationremove/src/main/js/MainAbility/i18n/en-US.json delete mode 100644 notification/ans_standard/actsansnotificationremove/src/main/js/MainAbility/i18n/zh-CN.json delete mode 100644 notification/ans_standard/actsansnotificationremove/src/main/js/MainAbility/pages/index/index.css delete mode 100644 notification/ans_standard/actsansnotificationremove/src/main/js/MainAbility/pages/index/index.hml delete mode 100644 notification/ans_standard/actsansnotificationremove/src/main/js/MainAbility/pages/index/index.js delete mode 100644 notification/ans_standard/actsansnotificationremove/src/main/js/TestAbility/app.js delete mode 100644 notification/ans_standard/actsansnotificationremove/src/main/js/TestAbility/i18n/en-US.json delete mode 100644 notification/ans_standard/actsansnotificationremove/src/main/js/TestAbility/i18n/zh-CN.json delete mode 100644 notification/ans_standard/actsansnotificationremove/src/main/js/TestAbility/pages/index/index.css delete mode 100644 notification/ans_standard/actsansnotificationremove/src/main/js/TestAbility/pages/index/index.hml delete mode 100644 notification/ans_standard/actsansnotificationremove/src/main/js/TestAbility/pages/index/index.js delete mode 100644 notification/ans_standard/actsansnotificationremove/src/main/js/TestRunner/OpenHarmonyTestRunner.js delete mode 100644 notification/ans_standard/actsansnotificationremove/src/main/js/test/ActsAnsNotificationRemove.test.js delete mode 100644 notification/ans_standard/actsansnotificationremove/src/main/js/test/List.test.js delete mode 100644 notification/ans_standard/actsansnotificationremove/src/main/resources/base/element/string.json delete mode 100644 notification/ans_standard/actsansnotificationremove/src/main/resources/base/media/icon.png diff --git a/notification/ans_standard/BUILD.gn b/notification/ans_standard/BUILD.gn index dc8fd2217..e0b254f5a 100644 --- a/notification/ans_standard/BUILD.gn +++ b/notification/ans_standard/BUILD.gn @@ -17,7 +17,6 @@ group("ans_standard") { if (is_standard_system) { deps = [ #"actsansnotificationcancel:ActsAnsNotificationCancelTest", - #"actsansnotificationremove:ActsAnsNotificationRemoveTest", "actsNotificationSlotTest:ActsNotificationSlotTest", "actsansslottest:ActsAnsSlotTest", "actsnotificationshow:ActsNotificationShowTest", diff --git a/notification/ans_standard/actsansnotificationremove/BUILD.gn b/notification/ans_standard/actsansnotificationremove/BUILD.gn deleted file mode 100644 index f70bba059..000000000 --- a/notification/ans_standard/actsansnotificationremove/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("ActsAnsNotificationRemoveTest") { - hap_profile = "./src/main/config.json" - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAnsNotificationRemoveTest" - 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/actsansnotificationremove/Test.json b/notification/ans_standard/actsansnotificationremove/Test.json deleted file mode 100644 index 3787ea1ba..000000000 --- a/notification/ans_standard/actsansnotificationremove/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.actsansnotificationremove", - "package-name": "com.example.actsansnotificationremove" - }, - "kits": [ - { - "test-file-name": [ - "ActsAnsNotificationRemoveTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/actsansnotificationremove/signature/openharmony_sx.p7b b/notification/ans_standard/actsansnotificationremove/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3442 zcmcgvYj6|S6}BF>F-F+L*anwiBOa!J?7OmLOQwYEN~;%M$tz2?WlYUVT0LxOwU$<1 zS(Haa;)Zu=rr?H0Y#s&@105h3XNE^Z10^9aB$Vk;3~>l;p)@qbNk}NPE878^fghdB zpdZ>f=bn4-chC9Gcjtnbh)PPC(V}blR>Vu@x5Y$tASRm6=kXvBNKHyv*rMZ+0wJFV zVu@*w19@$+!~|hX_@71MCNdcE1}KRm;3UPR(5y!eituv|F;oBwfOwWT9QHanQx2ph zcBPV($X(o@tXS@pDCIyQA(SM5iexSq2`RW}rkRdU4w62S2$7tFplONI8)AZ9dzgvu zHy9BJ)p;p~bO(vJmkVqnd|s!QX%?3*5>o+2VkcdJU>uoTDN_{7rEms7eLfNjJ>u5!kIq36rWYs)jMd?QZlm z)SJq2Tn)2U7}H`ARTMTLZet|^+bnQ{(ZsD_##z*DQ&-~nJd|b19ooupg;vvSuTq9d z3tEFA4lN8>QB?%PEk%gW-r(^#{7{pfYH(L-D?PQ8-GbI*DzrZej$p)-QFt}N+O@uV zTeX?COJ!~xpsdd0Fk{Eb_=#j|4D0#H#Rqj9Qd6 zs4exV6+`p`xI9={E%n5n5v>KT9yn*nf}%>crb@22RT~()R4&(R%syKch|E*N{(%_G zQcLN;6H%y!b!a2BO{xI|mkYhd;Inh*bx5sjl?ApSZpUDD^+-I^wbVeaF$7_aDj2rd zZ6+0t(^Ybpv%#h_%H&O;x(L=05lC8JjyO?uAfz$tYap`PA2HdY71~6D~?=OfuUM8T;)bAc2CgZt)(=KwJcx_ z7Zp`hmV{lX#zp8Ea}+l9N8<_vb}3K<##D$5W_9t5nt=&HY^bK3i3GzQUoGV@BY4Q* zWF0k)WnpE&XsvV;7|d!_szz-ECR1{=)d&u&2^eN;aD45%6)1ZA~P}8sL5vFmT?4_AW9h`hNw2=DXgXXTLLwz zpVB5=hYfb)ppG~K{(>PLSilKF0YiouE|8#oT-Sw~Lk#J!bHuxSKrdV*!GzzyYO#lq7*wn3Ta+8KJS@g}5;? zBX!7Opz$C(?oG`|AL7lkkc1za3?{{g1Q|I)hhUoa#pQ;>pQnPs#B7li0#YD_q}*3t zlP!`dA!!jbXaf32f&idk07U+?K$HgqF0YTwGY=>>uz`%Ep0 zmip+mhoeg2+fx>lB~DuT`;KKMa7F#u%4t33oD)3N?weB%ZkMM=_B;$Nx$#BXL5@Fa zjz4Dx`IFYGST!6A@chWqO$XBkN|*br(wPGR<_Qu(GDtCmME&M-MA8J(ACo6><}1Pk zvA~`n#EN^G*EfikZ@wckoO(Dt@TCLx&s)?jN!{FZ^p?$bVg9CVFUP(={HaZ-U4>~| z=?%!v&bGepy8D)nQKNetudn;FcFgwIL|2dO+;+b%^ZvBlRl%OTpT3BPZ2Bc7$=ZKy zN5IP|oP5C6 zu=&u(-?F=3+PLLX^`Uk9@;gSZIX~)1Y4^m}md%hyYj?I!kZis9K|na!Ys+Ug@xhdL zru;InpmTDvdF+lgeQm3OVQ#bfyD)l#-qEyWb065)XjuU3x?G-jR|WOX%tqrvjhqhKbWtIr4vS?5W~5?1m9|5&+2u z{wqIMEdMQYXX)?mm3r#-oG#va{aE_xOBvS}yV6ZJbk=JtmW}sx>HmH4R#)aHw=Rw0 z#Ol{~gHl)Aro86NYoABWEtHw3K8*7Q{w2fKg{!sST?8^mE zj0bZho5Q^hK*Mt>+t)L{bD0H}=Exg$E`)GEx$uH11O5u0)^&a(S_= zqy`i|9u-1jVcuFgr(k5xqDILM=e~ zc{#;vD-tsmmGjTOa;B*7yD=xXwyzeC*e}ny+-|#O-3sw1C7i80M~^ssbgpv!d$W#+ YX9HpW+h1JFRc8v8e%3PML|^*<0J%6(*8l(j diff --git a/notification/ans_standard/actsansnotificationremove/src/main/config.json b/notification/ans_standard/actsansnotificationremove/src/main/config.json deleted file mode 100644 index 672a9e8e0..000000000 --- a/notification/ans_standard/actsansnotificationremove/src/main/config.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsansnotificationremove", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 4, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsansnotificationremove", - "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/actsansnotificationremove/src/main/js/MainAbility/app.js b/notification/ans_standard/actsansnotificationremove/src/main/js/MainAbility/app.js deleted file mode 100644 index 4f1747a95..000000000 --- a/notification/ans_standard/actsansnotificationremove/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/actsansnotificationremove/src/main/js/MainAbility/i18n/en-US.json b/notification/ans_standard/actsansnotificationremove/src/main/js/MainAbility/i18n/en-US.json deleted file mode 100644 index a4c13dcbd..000000000 --- a/notification/ans_standard/actsansnotificationremove/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/actsansnotificationremove/src/main/js/MainAbility/i18n/zh-CN.json b/notification/ans_standard/actsansnotificationremove/src/main/js/MainAbility/i18n/zh-CN.json deleted file mode 100644 index b1c02368f..000000000 --- a/notification/ans_standard/actsansnotificationremove/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/actsansnotificationremove/src/main/js/MainAbility/pages/index/index.css b/notification/ans_standard/actsansnotificationremove/src/main/js/MainAbility/pages/index/index.css deleted file mode 100644 index 406641d81..000000000 --- a/notification/ans_standard/actsansnotificationremove/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/actsansnotificationremove/src/main/js/MainAbility/pages/index/index.hml b/notification/ans_standard/actsansnotificationremove/src/main/js/MainAbility/pages/index/index.hml deleted file mode 100644 index 4fcd0a37b..000000000 --- a/notification/ans_standard/actsansnotificationremove/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. - */ - -
- - ActsAnsNotificationRemove - -
diff --git a/notification/ans_standard/actsansnotificationremove/src/main/js/MainAbility/pages/index/index.js b/notification/ans_standard/actsansnotificationremove/src/main/js/MainAbility/pages/index/index.js deleted file mode 100644 index 8caa33407..000000000 --- a/notification/ans_standard/actsansnotificationremove/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/actsansnotificationremove/src/main/js/TestAbility/app.js b/notification/ans_standard/actsansnotificationremove/src/main/js/TestAbility/app.js deleted file mode 100644 index cdc31f3dc..000000000 --- a/notification/ans_standard/actsansnotificationremove/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/actsansnotificationremove/src/main/js/TestAbility/i18n/en-US.json b/notification/ans_standard/actsansnotificationremove/src/main/js/TestAbility/i18n/en-US.json deleted file mode 100644 index 3cb24b374..000000000 --- a/notification/ans_standard/actsansnotificationremove/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/actsansnotificationremove/src/main/js/TestAbility/i18n/zh-CN.json b/notification/ans_standard/actsansnotificationremove/src/main/js/TestAbility/i18n/zh-CN.json deleted file mode 100644 index c804e32c0..000000000 --- a/notification/ans_standard/actsansnotificationremove/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/actsansnotificationremove/src/main/js/TestAbility/pages/index/index.css b/notification/ans_standard/actsansnotificationremove/src/main/js/TestAbility/pages/index/index.css deleted file mode 100644 index b1bcd4338..000000000 --- a/notification/ans_standard/actsansnotificationremove/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/actsansnotificationremove/src/main/js/TestAbility/pages/index/index.hml b/notification/ans_standard/actsansnotificationremove/src/main/js/TestAbility/pages/index/index.hml deleted file mode 100644 index f629c71a9..000000000 --- a/notification/ans_standard/actsansnotificationremove/src/main/js/TestAbility/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/notification/ans_standard/actsansnotificationremove/src/main/js/TestAbility/pages/index/index.js b/notification/ans_standard/actsansnotificationremove/src/main/js/TestAbility/pages/index/index.js deleted file mode 100644 index 88b083a7f..000000000 --- a/notification/ans_standard/actsansnotificationremove/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/actsansnotificationremove/src/main/js/TestRunner/OpenHarmonyTestRunner.js b/notification/ans_standard/actsansnotificationremove/src/main/js/TestRunner/OpenHarmonyTestRunner.js deleted file mode 100644 index c5fa8620c..000000000 --- a/notification/ans_standard/actsansnotificationremove/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/actsansnotificationremove/src/main/js/test/ActsAnsNotificationRemove.test.js b/notification/ans_standard/actsansnotificationremove/src/main/js/test/ActsAnsNotificationRemove.test.js deleted file mode 100644 index 76411a61e..000000000 --- a/notification/ans_standard/actsansnotificationremove/src/main/js/test/ActsAnsNotificationRemove.test.js +++ /dev/null @@ -1,3088 +0,0 @@ -/* -* Copyright (c) 2021 Huawei Device Co., Ltd. -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES 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 = 300; -export default function ActsAnsNotificationRemove() { -describe('ActsAnsNotificationRemove', function () { - console.info("===========ActsAnsNotificationRemove start====================>"); - let subscriber; - function publishCallback(err) { - console.info("==========================publishCallback=======================>"); - } - let hashCode; - function onConsumeRemove(data) { - console.info("=============ANS_Remove_0100 onConsume start=======================>"); - console.info("=============ANS_Remove_0100 onConsume data:==================>" + JSON.stringify(data)); - console.info("=============ANS_Remove_0100 onConsume hascode:===============>" + data.request.hashCode); - hashCode = data.request.hashCode - notify.remove(hashCode, notify.RemoveReason.CANCEL_REASON_REMOVE, removeCallBack); - console.info("=============ANS_Remove_0100 onConsume remove=======================>"); - console.info("=============ANS_Remove_0100 onConsume end=======================>"); - } - - function onCancelRemove(data) { - console.info("==========ANS_Remove_0100 onCancel start==================>"); - console.info("==========ANS_Remove_0100 onCancel data : ================>" + JSON.stringify(data)); - console.info("==========ANS_Remove_0100 onCancel hashCode===============>" + hashCode); - console.info("==========ANS_Remove_0100 onCancel data.request.hashCode==>" + data.request.hashCode); - expect(hashCode).assertEqual(data.request.hashCode); - console.info("==========ANS_Remove_0100 onCancel end=======================>"); - } - - function removeCallBack(err, data) { - console.info("==========ANS_Remove_0100 removeCallBack err=========>" + JSON.stringify(err)); - console.info("==========ANS_Remove_0100 removeCallBack data : =======================>" + JSON.stringify(data)); - } - function subscriberCallBack(err, data) { - console.info("================subscriberCallBack err : =======================>" + JSON.stringify(err)); - console.info("================subscriberCallBack data : =======================>" + JSON.stringify(data)); - } - function publishCallback(err, data) { - console.info("================publishCallback err : =======================>" + JSON.stringify(err)); - console.info("================publishCallback data : =======================>" + JSON.stringify(data)); - } - - /* - * @tc.number: ANS_Remove_0100 - * @tc.name: remove(hashCode: string, reason: RemoveReason, callback: AsyncCallback): void; - * @tc.desc: Verify that the call interface remove - * deletes the notification information through hashcode - */ - it('ANS_Remove_0100', 0, async function (done) { - console.info("===============ANS_Remove_0100==========================>"); - hashCode = 0 - let subscriber ={ - onConsume:onConsumeRemove, - onCancel:onCancelRemove, - } - await notify.subscribe(subscriber); - console.info("==================ANS_Remove_0100 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: "0100", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("=============ANS_Remove_0100 publish promise===========>"); - setTimeout((async function(){ - console.info("======ANS_Remove_0100 setTimeout==================>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_0100 setTimeout unsubscribe==================>"); - await notify.cancelAll(); - done(); - }),timeout); - - }) - - function onConsumeRemovePromise(data) { - console.info("================ANS_Remove_0200 onConsume start===============>"); - console.info("================ANS_Remove_0200 onConsume data================>" + JSON.stringify(data)); - hashCode = data.request.hashCode - console.info("================ANS_Remove_0200 onConsume hascode:========>" + data.request.hashCode); - notify.remove(hashCode, notify.RemoveReason.CANCEL_REASON_REMOVE); - console.info("================ANS_Remove_0200 onConsume remove============>"); - console.info("================ANS_Remove_0200 onConsume end===============>"); - } - - function onCancelRemovePromise(data) { - console.info("===========ANS_Remove_0200 onCancel start================>"); - console.info("===========ANS_Remove_0200 onCancel data:=================>" + JSON.stringify(data)); - console.info("===========ANS_Remove_0200 onCancel hashCode====================>" + hashCode); - console.info("===========ANS_Remove_0200 onCancel data.request.hashCode=======>" + data.request.hashCode); - expect(hashCode).assertEqual(data.request.hashCode); - console.info("===========ANS_Remove_0200 onCancel end===================>"); - } - - /* - * @tc.number: ANS_Remove_0200 - * @tc.name: remove(hashCode: string, reason: RemoveReason): Promise; - * @tc.desc: Verify that the call interface remove to - * deletes the notification information through hashcode - */ - it('ANS_Remove_0200', 0, async function (done) { - console.info("===============ANS_Remove_0200==========================>"); - hashCode = 0 - let subscriber ={ - onConsume:onConsumeRemovePromise, - onCancel:onCancelRemovePromise, - } - await notify.subscribe(subscriber); - console.info("===============ANS_Remove_0200 subscribe promise==================>"); - let 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, - 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_Remove_0200 publish==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_0200 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_0200 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function onConsumeRemoveErrHashCode(data) { - console.info("================ANS_Remove_0300 onConsume start=======================>"); - console.info("================ANS_Remove_0300 onConsume data:=============>" + JSON.stringify(data)); - notify.remove("errorHashCode", notify.RemoveReason.CANCEL_REASON_REMOVE, removeErrHashCodeCallBack); - console.info("================ANS_Remove_0300 onConsume remove=======================>"); - console.info("================ANS_Remove_0300 onConsume end=======================>"); - } - function onCancelRemoveErrHashCode() { - console.info("================ANS_Remove_0300 onCancel start=======================>"); - expect().assertFail(); - console.info("================ANS_Remove_0300 onCancel end=======================>"); - } - function removeErrHashCodeCallBack(err) { - console.info("==========ANS_Remove_0300 removeCallBack start==============>"); - console.info("==========ANS_Remove_0300 removeCallBack err====================>" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info("==========ANS_Remove_0300 removeCallBack end=======================>"); - } - - /* - * @tc.number: ANS_Remove_0300 - * @tc.name: remove(hashCode: string, reason: RemoveReason, callback: AsyncCallback): void - * @tc.desc: Verify that the error hashcode is used to call the interface remove - * to delete the notification information - */ - it('ANS_Remove_0300', 0, async function (done) { - console.info("===============ANS_Remove_0300==========================>"); - let subscriber ={ - onConsume:onConsumeRemoveErrHashCode, - onCancel:onCancelRemoveErrHashCode, - } - await notify.subscribe(subscriber); - console.info("==================ANS_Remove_0300 subscribe promise==================>"); - let 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, - } - await notify.publish(notificationRequest); - console.info("==================ANS_Remove_0300 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_0300 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_0300 setTimeout unsubscribe============>"); - await notify.cancelAll() - done(); - }),timeout); - }) - - function onConsumeRemoveErrHashCodePromise(data) { - console.info("===========ANS_Remove_0400 onConsume start:===========>"); - console.info("===========ANS_Remove_0400 onConsume data:===========>" + JSON.stringify(data)); - notify.remove("errorHashCode", notify.RemoveReason.CANCEL_REASON_REMOVE).then((data)=>{ - console.info("===========ANS_Remove_0400 onConsume remove data:===========>" + JSON.stringify(data)); - }).catch((err)=>{ - console.info("===========ANS_Remove_0400 onConsume remove err:============>" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info("===========ANS_Remove_0400 onConsume end:===================>"); - }); - } - - function onCancelRemoveErrHashCodePromise() { - console.info("===========ANS_Remove_0400 onCancel start:===========>"); - expect().assertFail(); - console.info("===========ANS_Remove_0400 onCancel end:===========>"); - } - - /* - * @tc.number: ANS_Remove_0400 - * @tc.name: remove(hashCode: string, reason: RemoveReason): Promise - * @tc.desc: Verify that the error hashcode is used to call the interface remove - * to delete the notification information - */ - it('ANS_Remove_0400', 0, async function (done) { - console.info("===============ANS_Remove_0400==========================>"); - let subscriber ={ - onConsume:onConsumeRemoveErrHashCodePromise, - onCancel:onCancelRemoveErrHashCodePromise, - } - await notify.subscribe(subscriber); - console.info("===============ANS_Remove_0400 subscribe promise==================>"); - let 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, - } - await notify.publish(notificationRequest); - console.info("==================ANS_Remove_0400 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_0400 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_0400 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function onConsumeRemoveUseEmptyCharacter(data) { - console.info("================ANS_Remove_0500 onConsume start==============>"); - console.info("================ANS_Remove_0500 onConsume data:==============>" + JSON.stringify(data)); - notify.remove('', notify.RemoveReason.CANCEL_REASON_REMOVE, removeCallBackUseEmptyCharacter); - console.info("================ANS_Remove_0500 onConsume remove=============>"); - console.info("================ANS_Remove_0500 onConsume end================>"); - } - - function onCancelRemoveUseEmptyCharacter(data) { - console.info("=============ANS_Remove_0500 onCancel start===============>"); - console.info("=============ANS_Remove_0500 onCancel data:===============>" + JSON.stringify(data)); - expect().assertFail(); - console.info("=============ANS_Remove_0500 onCancel end=================>"); - } - - function removeCallBackUseEmptyCharacter(err) { - console.info("=============ANS_Remove_0500 removeCallBack start===============>"); - console.info("=============ANS_Remove_0500 removeCallBack err=================>" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info("=============ANS_Remove_0500 removeCallBack end=================>"); - } - - /* - * @tc.number: ANS_Remove_0500 - * @tc.name: remove(hashCode: string, reason: RemoveReason, callback: AsyncCallback): void; - * @tc.desc: Verify that the Empty Character hashcode is used to call the interface remove - * to delete the notification information - */ - it('ANS_Remove_0500', 0, async function (done) { - console.info("===============ANS_Remove_0500==========================>"); - let subscriber ={ - onConsume:onConsumeRemoveUseEmptyCharacter, - onCancel:onCancelRemoveUseEmptyCharacter, - } - await notify.subscribe(subscriber); - console.info("==================ANS_Remove_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_Remove_0500 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_0500 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_0500 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function OnConsumeRemoveUseEmptyCharacterPromise(data) { - console.info("===============ANS_Remove_0600 onConsume start==================>"); - console.info("===============ANS_Remove_0600 onConsume data:==================>" + JSON.stringify(data)); - notify.remove('', notify.RemoveReason.CANCEL_REASON_REMOVE).then((data)=>{ - console.info("===========ANS_Remove_0600 onConsume remove data:============>" + JSON.stringify(data)); - }).catch((err)=>{ - console.info("===========ANS_Remove_0600 onConsume remove err:=============>" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info("===========ANS_Remove_0600 onConsume end=====================>"); - }); - - } - - function OnCancelRemoveUseEmptyCharacterPromise(data) { - console.info("==============ANS_Remove_0600 onCancel start=============>"); - console.info("==============ANS_Remove_0600 onCancel data:=============>" + JSON.stringify(data)); - expect().assertFail(); - console.info("==============ANS_Remove_0600 onCancel end===============>"); - } - - /* - * @tc.number: ANS_Remove_0600 - * @tc.name: remove(hashCode: string, reason: RemoveReason): Promise; - * @tc.desc: Verify that the Empty Character hashcode is used to call the interface remove - * to delete the notification information - */ - it('ANS_Remove_0600', 0, async function (done) { - console.info("===============ANS_Remove_0600 start==========================>"); - let subscriber ={ - onConsume:OnConsumeRemoveUseEmptyCharacterPromise, - onCancel:OnCancelRemoveUseEmptyCharacterPromise, - } - await notify.subscribe(subscriber); - console.info("==================ANS_Remove_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_Remove_0600 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_0600 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_0600 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function onConsumeRemoveNotExistHashCode(data) { - console.info("==============ANS_Remove_0700 onConsume start===================>"); - console.info("==============ANS_Remove_0700 onConsume data:===================>" + JSON.stringify(data)); - notify.remove("9999_9999_9", notify.RemoveReason.CANCEL_REASON_REMOVE, removeNotExistHashCodeCallBack); - console.info("==============ANS_Remove_0700 onConsume remove===================>"); - console.info("==============ANS_Remove_0700 onConsume end===================>"); - } - - function onCancelRemoveNotExistHashCode(data) { - console.info("==============ANS_Remove_0700 onCancel start=======================>"); - console.info("==============ANS_Remove_0700 onCancel data:============>" + JSON.stringify(data)); - expect().assertFail(); - console.info("==============ANS_Remove_0700 onCancel end=======================>"); - } - - function removeNotExistHashCodeCallBack(err) { - console.info("==========ANS_Remove_0700 removeCallBack start==========>"); - console.info("==========ANS_Remove_0700 removeCallBack err=================>" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info("==========ANS_Remove_0700 removeCallBack end=======================>"); - } - - /* - * @tc.number: ANS_Remove_0700 - * @tc.name: remove(hashCode: string, reason: RemoveReason, callback: AsyncCallback): void; - * @tc.desc: Verify that the not exist hashCode is used to call the interface remove - * to delete the notification information - */ - it('ANS_Remove_0700', 0, async function (done) { - console.info("===============ANS_Remove_0700==========================>"); - let subscriber ={ - onConsume:onConsumeRemoveNotExistHashCode, - onCancel:onCancelRemoveNotExistHashCode, - } - await notify.subscribe(subscriber); - console.info("================ANS_Remove_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 : 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, - } - await notify.publish(notificationRequest); - console.info("============ANS_Remove_0700 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_0700 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_0700 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function onConsumeRemoveNotExistHashCodePromise(data) { - console.info("================ANS_Remove_0800 onConsume start===============>"); - console.info("================ANS_Remove_0800 onConsume data:===============>" + JSON.stringify(data)); - notify.remove("9999_9999_9", notify.RemoveReason.CANCEL_REASON_REMOVE).then((data)=>{ - console.info("===========ANS_Remove_0800 onConsume remove data:=========>" + JSON.stringify(data)); - }).catch((err)=>{ - console.info("===========ANS_Remove_0800 onConsume remove err:==========>" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info("===========ANS_Remove_0800 onConsume end==================>"); - }); - - } - - function onCancelRemoveNotExistHashCodePromise(data) { - console.info("============ANS_Remove_0800 onCancel start===============>"); - console.info("============ANS_Remove_0800 onCancel data:===============>" + JSON.stringify(data)); - expect().assertFail(); - console.info("============ANS_Remove_0800 onCancel end=================>"); - } - - /* - * @tc.number: ANS_Remove_0800 - * @tc.name: remove(hashCode: string, reason: RemoveReason): Promise; - * @tc.desc: Verify that the not exist hashCode is used to call the interface remove - * to delete the notification information - */ - it('ANS_Remove_0800', 0, async function (done) { - console.info("===============ANS_Remove_0800==========================>"); - let subscriber ={ - onConsume:onConsumeRemoveNotExistHashCodePromise, - onCancel:onCancelRemoveNotExistHashCodePromise, - } - await notify.subscribe(subscriber); - console.info("================ANS_Remove_0800 subscribe promise=======>"); - 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 : 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, - } - await notify.publish(notificationRequest); - console.info("==========ANS_Remove_0800 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_0800 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_0800 setTimeout unsubscribe============>"); - await notify.cancelAll() - done(); - }),timeout); - }) - - function onConsumeRemoveNonComplianceHashCode(data) { - console.info("================ANS_Remove_0900 onConsume start===================>"); - console.info("================ANS_Remove_0900 onConsume data: ==================>" + JSON.stringify(data)); - notify.remove("哈希码", notify.RemoveReason.CANCEL_REASON_REMOVE, removeNonComplianceHashCallBack); - console.info("================ANS_Remove_0900 onConsume remove==================>"); - console.info("================ANS_Remove_0900 onConsume end=====================>"); - } - - function onCancelRemoveNonComplianceHashCode(data) { - console.info("================ANS_Remove_0900 onCancel start====================>"); - console.info("================ANS_Remove_0900 onCancel data:====================>" + JSON.stringify(data)); - expect().assertFail(); - console.info("================ANS_Remove_0900 onCancel end======================>"); - } - - function removeNonComplianceHashCallBack(err, data) { - console.info("================ANS_Remove_0900 removeCallBack start=======================>"); - console.info("================ANS_Remove_0900 removeCallBack err=================>" + JSON.stringify(err)); - console.info("================ANS_Remove_0900 removeCallBack data=================>" + JSON.stringify(data)); - console.info("================ANS_Remove_0900 removeCallBack end=======================>"); - expect(err.code != 0).assertEqual(true); - } - - /* - * @tc.number: ANS_Remove_0900 - * @tc.name: remove(hashCode: string, reason: RemoveReason, callback: AsyncCallback): void; - * @tc.desc: Verify that the non compliance hashCode is used to call the interface remove - * to delete the notification information - */ - it('ANS_Remove_0900', 0, async function (done) { - console.info("===============ANS_Remove_0900==========================>"); - let subscriber ={ - onConsume:onConsumeRemoveNonComplianceHashCode, - onCancel:onCancelRemoveNonComplianceHashCode, - } - await notify.subscribe(subscriber); - console.info("============ANS_Remove_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, - label: "0900", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("==================ANS_Remove_0900 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_0900 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_0900 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function onConsumeRemoveNonComplianceHashCodePromise(data) { - console.info("================ANS_Remove_1000 onConsume start===========>"); - console.info("================ANS_Remove_1000 onConsume data:===========>" + JSON.stringify(data)); - notify.remove("哈希码", notify.RemoveReason.CANCEL_REASON_REMOVE).then((data)=>{ - console.info("===========ANS_Remove_1000 onConsume remove data:===========>" + JSON.stringify(data)); - }).catch((err)=>{ - console.info("===========ANS_Remove_1000 onConsume remove err:===========>" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info("===========ANS_Remove_1000 onConsume end===================>"); - }); - } - - function onCancelRemoveNonComplianceHashCodePromise(data) { - console.info("================ANS_Remove_1000 onCancel start==================>"); - console.info("================ANS_Remove_1000 onCancel data:==================>" + JSON.stringify(data)); - expect().assertFail(); - console.info("================ANS_Remove_1000 onCancel end====================>"); - } - - /* - * @tc.number: ANS_Remove_1000 - * @tc.name: remove(hashCode: string, reason: RemoveReason, callback: AsyncCallback): void; - * @tc.desc: Verify that the non compliance hashCode is used to call the interface remove - * to delete the notification information - */ - it('ANS_Remove_1000', 0, async function (done) { - console.info("===============ANS_Remove_1000==========================>"); - let subscriber ={ - onConsume:onConsumeRemoveNonComplianceHashCodePromise, - onCancel:onCancelRemoveNonComplianceHashCodePromise, - } - await notify.subscribe(subscriber); - console.info("================ANS_Remove_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_Remove_1000 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_1000 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_1000 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function removeCallBack2TimesOf2(err) { - console.info("=====ANS_Remove_1100 removeCallBack2TimesOf2 start==========>"); - console.info("=====ANS_Remove_1100 removeCallBack2TimesOf2 err============>" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info("=====ANS_Remove_1100 removeCallBack2TimesOf2 end==========>"); - } - function removeCallBack2TimesOf1(err) { - console.info("=====ANS_Remove_1100 removeCallBack2TimesOf1 start============>"); - console.info("=====ANS_Remove_1100 removeCallBack2TimesOf1 err========>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - notify.remove(hashCode1100, notify.RemoveReason.CANCEL_REASON_REMOVE, removeCallBack2TimesOf2); - console.info("=====ANS_Remove_1100 removeCallBack2TimesOf1 end============>"); - } - let hashCode1100; - function onConsumeCallbackRemove2Times(data) { - console.info("=====ANS_Remove_1100 onConsume start=================>"); - console.info("=====ANS_Remove_1100 onConsume data: ================>" + JSON.stringify(data)); - hashCode1100 = data.request.hashCode; - notify.remove(data.request.hashCode, notify.RemoveReason.CANCEL_REASON_REMOVE, removeCallBack2TimesOf1); - console.info("=====ANS_Remove_1100 onConsume remove================>"); - console.info("=====ANS_Remove_1100 onConsume end===================>"); - } - let timesOfOnCancelCallbackRemove2Times - function onCancelCallbackRemove2Times(data) { - timesOfOnCancelCallbackRemove2Times = timesOfOnCancelCallbackRemove2Times + 1 - console.info("=====ANS_Remove_1100 onCancel start=======================>"); - console.info("=====ANS_Remove_1100 onCancel data:=======================>" + JSON.stringify(data)); - if (timesOfOnCancelCallbackRemove2Times == 1){ - expect(data.request.id).assertEqual(11); - } else if (timesOfOnCancelCallbackRemove2Times == 2){ - expect().assertFail(); - } - console.info("=====ANS_Remove_1100 onCancel end=======================>"); - } - - /* - * @tc.number: ANS_Remove_1100 - * @tc.name: remove(hashCode: string, reason: RemoveReason, callback: AsyncCallback): void; - * @tc.desc: Verify that the interface remove - * is called twice in a row to delete the notification information - */ - it('ANS_Remove_1100', 0, async function (done) { - console.info("===============ANS_Remove_1100==========================>"); - hashCode1100 = 0; - timesOfOnCancelCallbackRemove2Times = 0 - let subscriber ={ - onConsume:onConsumeCallbackRemove2Times, - onCancel:onCancelCallbackRemove2Times, - } - await notify.subscribe(subscriber); - console.info("===============ANS_Remove_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 : 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, - } - await notify.publish(notificationRequest); - console.info("==========ANS_Remove_1100 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_1100 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_1100 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function onConsumeCallbackRemove2TimesPromise(data) { - console.info("=======ANS_Remove_1200 onConsume start=============>"); - console.info("=======ANS_Remove_1200 onConsume data:=============>" + JSON.stringify(data)); - notify.remove(data.request.hashCode, notify.RemoveReason.CANCEL_REASON_REMOVE).then(()=>{ - console.info("=======ANS_Remove_1200 onConsume remove_2times1:=======>"); - }).catch((err)=>{ - console.info("=======ANS_Remove_1200 onConsume remove_2times1 err:========>" + JSON.stringify(err)); - expect(err.code == 0).assertEqual(true); - }); - notify.remove(data.request.hashCode, notify.RemoveReason.CANCEL_REASON_REMOVE).then((data)=>{ - console.info("=======ANS_Remove_1200 onConsume remove_2times2 data:=======>" + JSON.stringify(data)); - }).catch((err)=>{ - console.info("=======ANS_Remove_1200 onConsume remove_2times2 err:========>" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info("================ANS_Remove_1200 onConsume end=================>"); - }); - } - let timesOfOnCancelCallbackRemove2TimesPromise - function onCancelCallbackRemove2TimesPromise(data) { - timesOfOnCancelCallbackRemove2TimesPromise = timesOfOnCancelCallbackRemove2TimesPromise + 1 - console.info("================ANS_Remove_1200 onCancel start=========>"); - console.info("================ANS_Remove_1200 onCancel data:=========>" + JSON.stringify(data)); - if (timesOfOnCancelCallbackRemove2TimesPromise == 1){ - expect(data.request.id).assertEqual(12); - console.info("============ANS_Remove_1200 onCancel id:===========>" + JSON.stringify(data.request.id)); - } else if (timesOfOnCancelCallbackRemove2TimesPromise == 2){ - expect().assertFail(); - } - console.info("================ANS_Remove_1200 onCancel end==============>"); - } - - /* - * @tc.number: ANS_Remove_1200 - * @tc.name: remove(hashCode: string, reason: RemoveReason): Promise; - * @tc.desc: Verify that the interface remove is called twice in a row to - * delete the notification information - */ - it('ANS_Remove_1200', 0, async function (done) { - console.info("===============ANS_Remove_1200 start========================>"); - timesOfOnCancelCallbackRemove2TimesPromise = 0 - let subscriber ={ - onConsume:onConsumeCallbackRemove2TimesPromise, - onCancel:onCancelCallbackRemove2TimesPromise, - } - await notify.subscribe(subscriber); - console.info("===============ANS_Remove_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, - label: "1200", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("============ANS_Remove_1200 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_1200 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_1200 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function onConsumeRemoveIsUnremovable(data) { - console.info("==========ANS_Remove_1300 onConsume start=================>"); - console.info("==========ANS_Remove_1300 onConsume data:=================>" + JSON.stringify(data)); - notify.remove(data.request.hashCode, notify.RemoveReason.CANCEL_REASON_REMOVE, removeIsUnremovableCallBack); - console.info("==========ANS_Remove_1300 onConsume remove==============>"); - console.info("==========ANS_Remove_1300 onConsume end=================>"); - } - - function onCancelRemoveIsUnremovable(data) { - console.info("==========ANS_Remove_1300 onCancel start================>"); - console.info("==========ANS_Remove_1300 onCancel data:================>" + JSON.stringify(data)); - console.info("==========ANS_Remove_1300 onCancel end================>"); - } - - function removeIsUnremovableCallBack(err) { - console.info("==========ANS_Remove_1300 removeCallBack start===================>"); - console.info("==========ANS_Remove_1300 removeCallBack err=====================>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.info("==========ANS_Remove_1300 removeCallBack end=====================>"); - } - - /* - * @tc.number: ANS_Remove_1300 - * @tc.name: remove(hashCode: string, reason: RemoveReason, callback: AsyncCallback): void; - * @tc.desc: Verify that the calling interface remove - * deletes the notification information that the property isunremovable is true - */ - it('ANS_Remove_1300', 0, async function (done) { - console.info("===============ANS_Remove_1300==========================>"); - let subscriber ={ - onConsume:onConsumeRemoveIsUnremovable, - onCancel:onCancelRemoveIsUnremovable, - } - await notify.subscribe(subscriber); - console.info("================ANS_Remove_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 : 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: "1300", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("================ANS_Remove_1300 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_1300 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_1300 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function OnConsumeRemoveIsUnremovablePromise(data) { - console.info("==============ANS_Remove_1400 onConsume start==============>"); - console.info("==============ANS_Remove_1400 onConsume data:==============>" + JSON.stringify(data)); - notify.remove(data.request.hashCode, notify.RemoveReason.CANCEL_REASON_REMOVE).then((data)=>{ - console.info("=======ANS_Remove_1400 onConsume remove data:=======>" + JSON.stringify(data)); - }).catch((err)=>{ - console.info("=======ANS_Remove_1400 onConsume remove err:========>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - console.info("=======ANS_Remove_1400 onConsume end================>"); - }); - } - - function OnCancelRemoveIsUnremovablePromise(data) { - console.info("==============ANS_Remove_1400 onCancel start==============>"); - console.info("==============ANS_Remove_1400 onCancel data:==============>" + JSON.stringify(data)); - console.info("==============ANS_Remove_1400 onCancel end================>"); - } - - /* - * @tc.number: ANS_Remove_1400 - * @tc.name: remove(hashCode: string, reason: RemoveReason): Promise; - * @tc.desc: Verify that the calling interface remove - * deletes the notification information that the property isunremovable is true - */ - it('ANS_Remove_1400', 0, async function (done) { - console.info("===============ANS_Remove_1400 start==========================>"); - let subscriber ={ - onConsume:OnConsumeRemoveIsUnremovablePromise, - onCancel:OnCancelRemoveIsUnremovablePromise, - } - await notify.subscribe(subscriber); - console.info("===============ANS_Remove_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 : 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: "1400", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("==============ANS_Remove_1400 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_1400 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_1400 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - let timesOfOnConsumeRemoveAllByBundleOption - function onConsumeRemoveAllByBundleOption(data) { - timesOfOnConsumeRemoveAllByBundleOption = timesOfOnConsumeRemoveAllByBundleOption + 1 - console.info("==========ANS_Remove_1500 onConsume start=======>"); - console.info("==========ANS_Remove_1500 onConsume data:=======>" + JSON.stringify(data)); - let bundleOption = { - bundle:data.request.creatorBundleName, - uid:data.request.creatorUid, - } - if (timesOfOnConsumeRemoveAllByBundleOption == 2){ - notify.removeAll(bundleOption,removeAllByBundleOptionCallBack); - console.info("=======ANS_Remove_1500 onConsume remove=============>"); - } - console.info("===========ANS_Remove_1500 onConsume end===========>"); - } - let timesOfOnCancelRemoveAllByBundleOption - function onCancelRemoveAllByBundleOption(data) { - timesOfOnCancelRemoveAllByBundleOption = timesOfOnCancelRemoveAllByBundleOption + 1 - console.info("===========ANS_Remove_1500 onCancel start====================>"); - console.info("===========ANS_Remove_1500 onCancel data:====================>" + JSON.stringify(data)); - if (timesOfOnCancelRemoveAllByBundleOption == 1){ - expect(data.request.label).assertEqual("1500_1"); - }else if (timesOfOnCancelRemoveAllByBundleOption == 2){ - expect(data.request.label).assertEqual("1500_2"); - } - console.info("===========ANS_Remove_1500 onCancel end=======================>"); - } - function removeAllByBundleOptionCallBack(data) { - console.info("===========ANS_Remove_1500 removeAllCallBack start=================>"); - console.info("===========ANS_Remove_1500 removeAllCallBack data==================>" + JSON.stringify(data)); - console.info("===========ANS_Remove_1500 removeAllCallBack end===================>"); - } - - /* - * @tc.number: ANS_Remove_1500 - * @tc.name: removeAll(bundle: BundleOption, callback: AsyncCallback):void; - * @tc.desc: Verify that the calling interface removeAll(bundle: BundleOption, callback: AsyncCallback):void; - * deletes all notification information through BundleOption - */ - it('ANS_Remove_1500', 0, async function (done) { - console.info("===============ANS_Remove_1500 start==========================>"); - timesOfOnCancelRemoveAllByBundleOption = 0 - timesOfOnConsumeRemoveAllByBundleOption = 0 - let subscriber ={ - onConsume:onConsumeRemoveAllByBundleOption, - onCancel:onCancelRemoveAllByBundleOption, - } - await notify.subscribe(subscriber); - console.info("===============ANS_Remove_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 : 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: "1500_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: 15, - 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: "1500_2", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("=============ANS_Remove_1500 publish1 promise==================>"); - await notify.publish(notificationRequest1); - console.info("=============ANS_Remove_1500 publish2 promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_1500 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_1500 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - let timesOfOnConsumeRemoveAllByBundleOptionNullUid - function onConsumeRemoveAllByBundleOptionNullUid(data) { - console.info("===============ANS_Remove_1600 onConsume start================>"); - console.info("===============ANS_Remove_1600 onConsume data:========>" + JSON.stringify(data)); - let bundleOption = { - bundle:data.request.creatorBundleName, - uid:0, - } - timesOfOnConsumeRemoveAllByBundleOptionNullUid = timesOfOnConsumeRemoveAllByBundleOptionNullUid + 1 - if (timesOfOnConsumeRemoveAllByBundleOptionNullUid == 2){ - notify.removeAll(bundleOption,removeAllByBundleOptionCallBackNullUid); - console.info("===============ANS_Remove_1600 onConsume remove==================>"); - } - console.info("===============ANS_Remove_1600 onConsume end================>"); - } - function onCancelRemoveAllByBundleOptionNullUid(data) { - console.info("===============ANS_Remove_1600 onCancel start===================>"); - console.info("===============ANS_Remove_1600 onCancel data:===================>" + JSON.stringify(data)); - expect().assertFail(); - console.info("===============ANS_Remove_1600 onCancel end====================>"); - } - function removeAllByBundleOptionCallBackNullUid(err) { - console.info("=========ANS_Remove_1600 removeAllCallBack start=============>"); - console.info("=========ANS_Remove_1600 removeAllCallBack err===============>" + JSON.stringify(err)); - console.info("=========ANS_Remove_1600 removeAllCallBack end===============>"); - } - - /* - * @tc.number: ANS_Remove_1600 - * @tc.name: removeAll(bundle: BundleOption, callback: AsyncCallback):void; - * @tc.desc: Verify that the calling interface removeAll(bundle: BundleOption, callback: AsyncCallback):void; - * deletes all notification information through BundleOption Correct bundle, 0 uid. - */ - it('ANS_Remove_1600', 0, async function (done) { - console.info("===============ANS_Remove_1600==========================>"); - timesOfOnConsumeRemoveAllByBundleOptionNullUid = 0 - let subscriber ={ - onConsume:onConsumeRemoveAllByBundleOptionNullUid, - onCancel:onCancelRemoveAllByBundleOptionNullUid, - } - await notify.subscribe(subscriber); - console.info("==================ANS_Remove_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 : 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: "1600_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: 16, - 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: "1600_2", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("==================ANS_Remove_1600 publish1 promise==================>"); - await notify.publish(notificationRequest1); - console.info("==================ANS_Remove_1600 publish2 promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_1600 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_1600 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function onConsumeRemoveAllByBundleOptionWrongUid(data) { - console.info("========ANS_Remove_1700 onConsume start==============>"); - console.info("========ANS_Remove_1700 onConsume data:==============>" + JSON.stringify(data)); - let bundleOption = { - bundle:data.request.creatorBundleName, - uid:123456789 - } - notify.removeAll(bundleOption,removeAllByBundleOptionCallBackWrongUid); - console.info("========ANS_Remove_1700 onConsume remove============>"); - console.info("========ANS_Remove_1700 onConsume end===============>"); - } - function onCancelRemoveAllByBundleOptionWrongUid(data) { - console.info("==========ANS_Remove_1700 onCancel start====================>"); - console.info("==========ANS_Remove_1700 onCancel data:====================>" + JSON.stringify(data)); - expect().assertFail(); - console.info("==========ANS_Remove_1700 onCancel end======================>"); - } - function removeAllByBundleOptionCallBackWrongUid(err) { - console.info("==========ANS_Remove_1700 removeAllCallBack start=============>"); - console.info("==========ANS_Remove_1700 removeAllCallBack err===============>" + JSON.stringify(err)); - console.info("==========ANS_Remove_1700 removeAllCallBack end=======================>"); - } - - /* - * @tc.number: ANS_Remove_1700 - * @tc.name: removeAll(bundle: BundleOption, callback: AsyncCallback):void; - * @tc.desc: Verify that the calling interface removeAll(bundle: BundleOption, callback: AsyncCallback):void; - * deletes all notification information through BundleOption Correct bundle, wrong uid. - */ - it('ANS_Remove_1700', 0, async function (done) { - console.info("===============ANS_Remove_1700==========================>"); - let subscriber ={ - onConsume:onConsumeRemoveAllByBundleOptionWrongUid, - onCancel:onCancelRemoveAllByBundleOptionWrongUid, - } - await notify.subscribe(subscriber); - console.info("=============ANS_Remove_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_Remove_1700 publish promise===============>"); - setTimeout((async function(){ - console.info("======ANS_Remove_1700 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_1700 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - - }) - - function onConsumeRemoveAllByBundleOptionWrongBundleCorrectUid(data) { - console.info("==============ANS_Remove_1800 onConsume start=============>"); - console.info("==============ANS_Remove_1800 onConsume data:=============>" + JSON.stringify(data)); - let bundleOption = { - bundle:"wrongBundleName", - uid:data.request.creatorUid, - } - notify.removeAll(bundleOption,removeAllByBundleOptionCallBackWrongBundleCorrectUid); - console.info("==============ANS_Remove_1800 onConsume remove=============>"); - console.info("==============ANS_Remove_1800 onConsume end================>"); - } - function onCancelremoveAllByBundleOptionwrongBundleCorrectUid(data) { - console.info("==============ANS_Remove_1800 onCancel start===============>"); - console.info("==============ANS_Remove_1800 onCancel data:===============>" + JSON.stringify(data)); - expect().assertFail(); - console.info("==============ANS_Remove_1800 onCancel end===============>"); - } - function removeAllByBundleOptionCallBackWrongBundleCorrectUid(err, data) { - console.info("=========ANS_Remove_1800 removeAllCallBack start==========>"); - console.info("=========ANS_Remove_1800 removeAllCallBack err============>" + JSON.stringify(err)); - console.info("=========ANS_Remove_1800 removeAllCallBack end==========>"); - } - - /* - * @tc.number: ANS_Remove_1800 - * @tc.name: removeAll(bundle: BundleOption, callback: AsyncCallback):void; - * @tc.desc: Verify that the calling interface removeAll(bundle: BundleOption, callback: AsyncCallback):void; - * deletes all notification information through BundleOption wrong bundle, correct uid. - */ - it('ANS_Remove_1800', 0, async function (done) { - console.info("===============ANS_Remove_1800 start==========================>"); - let subscriber ={ - onConsume:onConsumeRemoveAllByBundleOptionWrongBundleCorrectUid, - onCancel:onCancelremoveAllByBundleOptionwrongBundleCorrectUid, - } - await notify.subscribe(subscriber); - console.info("================ANS_Remove_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_Remove_1800 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_1800 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_1800 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function onConsumeRemoveAllByBundleOptionNullCharacterBundleCorrectUid(data) { - console.info("===========ANS_Remove_1900 onConsume start===============>"); - console.info("===========ANS_Remove_1900 onConsume data:===============>" + JSON.stringify(data)); - let bundleOption = { - bundle:"", - uid:data.request.creatorUid, - } - notify.removeAll(bundleOption,removeAllByBundleOptionCallBackNullCharacterBundleCorrectUid); - console.info("===========ANS_Remove_1900 onConsume removeAll===========>"); - console.info("===========ANS_Remove_1900 onConsume end=================>"); - } - function onCancelRemoveAllByBundleOptionNullCharacterBundleCorrectUid(data) { - console.info("===========ANS_Remove_1900 onCancel start===========>"); - console.info("===========ANS_Remove_1900 onCancel data:==========>" + JSON.stringify(data)); - expect().assertFail(); - console.info("===========ANS_Remove_1900 onCancel end===========>"); - } - function removeAllByBundleOptionCallBackNullCharacterBundleCorrectUid(err) { - console.info("========ANS_Remove_1900 removeAllCallback start===========>"); - console.info("========ANS_Remove_1900 removeAllCallback err=============>" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info("========ANS_Remove_1900 removeAllCallback end=============>"); - } - - /* - * @tc.number: ANS_Remove_1900 - * @tc.name: removeAll(bundle: BundleOption, callback: AsyncCallback):void; - * @tc.desc: Verify that the calling interface removeAll(bundle: BundleOption, callback: AsyncCallback):void; - * deletes all notification information through BundleOption null character bundle, correct uid. - */ - it('ANS_Remove_1900', 0, async function (done) { - console.info("===============ANS_Remove_1900 start==========================>"); - let subscriber ={ - onConsume:onConsumeRemoveAllByBundleOptionNullCharacterBundleCorrectUid, - onCancel:onCancelRemoveAllByBundleOptionNullCharacterBundleCorrectUid, - } - await notify.subscribe(subscriber); - console.info("===============ANS_Remove_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_Remove_1900 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_1900 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_1900 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function onConsumeRemoveAllByBundleOptionWrongBundleWrongUid(data) { - console.info("============ANS_Remove_2000 onConsume start================>"); - console.info("============ANS_Remove_2000 onConsume data:================>" + JSON.stringify(data)); - let bundleOption = { - bundle:"wrongBundleName", - uid:123456789, - } - notify.removeAll(bundleOption,removeAllByBundleOptionCallBackWrongBundleWrongUid); - console.info("============ANS_Remove_2000 onConsume remove================>"); - console.info("============ANS_Remove_2000 onConsume end===================>"); - } - function onCancelRemoveAllByBundleOptionWrongBundleWrongUid(data) { - console.info("============ANS_Remove_2000 onCancel start=================>"); - console.info("============ANS_Remove_2000 onCancel data:=================>" + JSON.stringify(data)); - expect().assertFail(); - console.info("============ANS_Remove_2000 onCancel end==============>"); - } - function removeAllByBundleOptionCallBackWrongBundleWrongUid(err) { - console.info("============ANS_Remove_2000 removeAllCallBack start============>"); - console.info("============ANS_Remove_2000 removeAllCallBack err==============>" + JSON.stringify(err)); - console.info("============ANS_Remove_2000 removeAllCallBack end=============>"); - } - - /* - * @tc.number: ANS_Remove_2000 - * @tc.name: removeAll(bundle: BundleOption, callback: AsyncCallback):void; - * @tc.desc: Verify that the calling interface removeAll(bundle: BundleOption, callback: AsyncCallback):void; - * deletes all notification information through BundleOption wrong bundle, wrong uid. - */ - it('ANS_Remove_2000', 0, async function (done) { - console.info("===============ANS_Remove_2000 start==========================>"); - let subscriber ={ - onConsume:onConsumeRemoveAllByBundleOptionWrongBundleWrongUid, - onCancel:onCancelRemoveAllByBundleOptionWrongBundleWrongUid, - } - await notify.subscribe(subscriber); - console.info("==============ANS_Remove_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_Remove_2000 publish promise==============>"); - setTimeout((async function(){ - console.info("======ANS_Remove_2000 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_2000 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function onConsumeRemoveAllByBundleOptionNullCharacterBundleWrongUid(data) { - console.info("=========ANS_Remove_2100 onConsume start===================>"); - console.info("=========ANS_Remove_2100 onConsume data:======>" + JSON.stringify(data)); - let bundleOption = { - bundle:"", - uid:123456789, - } - notify.removeAll(bundleOption,removeAllByBundleOptionCallBackNullCharacterBundleWrongUid); - console.info("=========ANS_Remove_2100 onConsume remove===================>"); - console.info("=========ANS_Remove_2100 onConsume end===================>"); - } - function onCancelRemoveAllByBundleOptionNullCharacterBundleWrongUid(data) { - console.info("=========ANS_Remove_2100 onCancel start==========>"); - console.info("=========ANS_Remove_2100 onCancel data:==========>" + JSON.stringify(data)); - expect().assertFail(); - console.info("=========ANS_Remove_2100 onCancel end============>"); - } - function removeAllByBundleOptionCallBackNullCharacterBundleWrongUid(err) { - console.info("=========ANS_Remove_2100 removeAllCallBack start===============>"); - console.info("=========ANS_Remove_2100 err=========>" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info("=========ANS_Remove_2100 removeAllCallBack end===============>"); - } - - /* - * @tc.number: ANS_Remove_2100 - * @tc.name: removeAll(bundle: BundleOption, callback: AsyncCallback):void; - * @tc.desc: Verify that the calling interface removeAll(bundle: BundleOption, callback: AsyncCallback):void; - * deletes all notification information through BundleOption null character bundle, wrong uid. - */ - it('ANS_Remove_2100', 0, async function (done) { - console.info("===============ANS_Remove_2100 start==========================>"); - let subscriber ={ - onConsume:onConsumeRemoveAllByBundleOptionNullCharacterBundleWrongUid, - onCancel:onCancelRemoveAllByBundleOptionNullCharacterBundleWrongUid, - } - await notify.subscribe(subscriber); - console.info("============ANS_Remove_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_Remove_2100 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_2100 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_2100 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function onConsumeRemoveAllByBundleOptionIsUnremovable(data) { - console.info("==========ANS_Remove_2200 onConsume start==================>"); - console.info("==========ANS_Remove_2200 onConsume data:=================>" + JSON.stringify(data)); - let bundleOption = { - bundle:data.request.creatorBundleName, - uid:data.request.creatorUid, - } - notify.removeAll(bundleOption,removeAllByBundleOptionCallBackIsUnremovable); - console.info("==========ANS_Remove_2200 onConsume removeAll==================>"); - console.info("==========ANS_Remove_2200 onConsume end==================>"); - } - function onCancelRemoveAllByBundleOptionIsUnremovable(data) { - console.info("==========ANS_Remove_2200 onCancel start=================>"); - console.info("==========ANS_Remove_2200 onCancel data:=================>" + JSON.stringify(data)); - expect().assertFail(); - console.info("==========ANS_Remove_2200 onCancel end===================>"); - } - function removeAllByBundleOptionCallBackIsUnremovable(err) { - console.info("==========ANS_Remove_2200 removeAllCallBack start==========>"); - console.info("==========ANS_Remove_2200 removeAllCallBack err============>" + JSON.stringify(err)); - console.info("==========ANS_Remove_2200 removeAllCallBack end============>"); - } - - /* - * @tc.number: ANS_Remove_2200 - * @tc.name: removeAll(bundle: BundleOption, callback: AsyncCallback):void; - * @tc.desc: Verify that the removeAll(bundle: BundleOption, callback: AsyncCallback):void - * interface is called to delete the notification information whose attribute isUnremovable is true - */ - it('ANS_Remove_2200', 0, async function (done) { - console.info("===============ANS_Remove_2200 start==========================>"); - let subscriber ={ - onConsume:onConsumeRemoveAllByBundleOptionIsUnremovable, - onCancel:onCancelRemoveAllByBundleOptionIsUnremovable, - } - await notify.subscribe(subscriber); - console.info("==============ANS_Remove_2200 subscribe 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 : 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: "2200", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("=============ANS_Remove_2200 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_2200 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_2200 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function removeAllCallBack(err,data) { - console.info("================ANS_Remove_2300 removeAllCallBack start:========>"); - console.info("================ANS_Remove_2300 removeAllCallBack err:==========>" + JSON.stringify(err)); - console.info("================ANS_Remove_2300 removeAllCallBack data:=========>" + JSON.stringify(data)); - console.info("================ANS_Remove_2300 removeAllCallBack end:==========>") - } - let timesOfOnConsumeRemoveAll - function onConsumeRemoveAll(data) { - timesOfOnConsumeRemoveAll = timesOfOnConsumeRemoveAll + 1 - console.info("================ANS_Remove_2300 onConsume start==================>"); - console.info("================ANS_Remove_2300 onConsume data: =================>" + JSON.stringify(data)); - if (timesOfOnConsumeRemoveAll == 2) - { - notify.removeAll(removeAllCallBack); - console.info("============ANS_Remove_2300 onConsume removeAll==========>"); - } - console.info("================ANS_Remove_2300 onConsume end====================>"); - } - let timesOfOnCancelRemoveAll - function onCancelRemoveAll(data) { - timesOfOnCancelRemoveAll = timesOfOnCancelRemoveAll + 1 - console.info("==================ANS_Remove_2300 onCancel start===========>"); - console.info("==================ANS_Remove_2300 onCancel data============>" + JSON.stringify(data)); - if (timesOfOnCancelRemoveAll == 1) - { - expect(data.request.label).assertEqual("2300_1"); - } - if (timesOfOnCancelRemoveAll == 2) - { - expect(data.request.label).assertEqual("2300_2"); - } - console.info("==================ANS_Remove_2300 onCancel end=============>"); - } - - /* - * @tc.number: ANS_Remove_2300 - * @tc.name: removeAll(callback: AsyncCallback): void; - * @tc.desc: Verify that the removeAll(callback: AsyncCallback): void interface is called to delete the - * notification information - */ - it('ANS_Remove_2300', 0, async function (done) { - console.info("===============ANS_Remove_2300 start==========================>"); - timesOfOnConsumeRemoveAll = 0; - timesOfOnCancelRemoveAll = 0; - let subscriber ={ - onConsume:onConsumeRemoveAll, - onCancel:onCancelRemoveAll, - } - await notify.subscribe(subscriber); - console.info("=============ANS_Remove_2300 subscribe 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_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: 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_2", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("===========ANS_Remove_2300 publish1 promise================>"); - await notify.publish(notificationRequest1); - console.info("============ANS_Remove_2300 publish2 promise===============>"); - setTimeout((async function(){ - console.info("======ANS_Remove_2300 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_2300 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function onConsumeRemoveAllPromise(data) { - timesOfOnConsumeRemoveAll = timesOfOnConsumeRemoveAll + 1 - console.info("===========ANS_Remove_2400 onConsume start==============>"); - console.info("===========ANS_Remove_2400 onConsume data:==============>" + JSON.stringify(data)); - if (timesOfOnConsumeRemoveAll == 2) - { - notify.removeAll(); - console.info("===========ANS_Remove_2400 onConsume removeAll==========>"); - } - console.info("===========ANS_Remove_2400 onConsume end==============>"); - } - - function onCancelRemoveAllPromise(data) { - timesOfOnCancelRemoveAll = timesOfOnCancelRemoveAll + 1 - console.info("===========ANS_Remove_2400 onCancel start=======================>"); - console.info("===========ANS_Remove_2400 onCancel data : =============>" + JSON.stringify(data)); - if (timesOfOnCancelRemoveAll == 1) - { - expect(data.request.label).assertEqual("2400_1"); - } - if (timesOfOnCancelRemoveAll == 2) - { - expect(data.request.label).assertEqual("2400_2"); - } - console.info("===========ANS_Remove_2400 onCancel end=======================>"); - } - - /* - * @tc.number: ANS_Remove_2400 - * @tc.name: removeAll(bundle?: BundleOption): Promise - * @tc.desc: Verify that the removeAll(bundle?: BundleOption): Promise interface is called to delete the - * notification information - */ - it('ANS_Remove_2400', 0, async function (done) { - console.info("===============ANS_Remove_2400 start==========================>"); - timesOfOnConsumeRemoveAll = 0 - timesOfOnCancelRemoveAll = 0 - let subscriber ={ - onConsume:onConsumeRemoveAllPromise, - onCancel:onCancelRemoveAllPromise, - } - await notify.subscribe(subscriber); - console.info("==============ANS_Remove_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_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: 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_2", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("===ANS_Remove_2400 publish1 promise============>"); - await notify.publish(notificationRequest1); - console.info("===ANS_Remove_2400 publish2 promise============>"); - setTimeout((async function(){ - console.info("======ANS_Remove_2400 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_2400 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function removeAllCallBackIsUnremovable(err,data) { - console.info("=========ANS_Remove_2500 removeAllCallBack start=========>"); - console.info("=========ANS_Remove_2500 removeAllCallBack err:==========>" + JSON.stringify(err)); - console.info("=========ANS_Remove_2500 removeAllCallBack data:=========>" + JSON.stringify(data)); - console.info("=========ANS_Remove_2500 removeAllCallBack end===========>"); - } - function onConsumeRemoveAllIsUnremovable(data) { - console.info("=========ANS_Remove_2500 onConsume start===========>"); - console.info("=========ANS_Remove_2500 onConsumedata:============>" + JSON.stringify(data)); - notify.removeAll(removeAllCallBackIsUnremovable); - console.info("=========ANS_Remove_2500 onConsume removeAll=======>"); - console.info("=========ANS_Remove_2500 onConsume end=============>"); - } - function onCancelCallbackRemoveAllIsUnremovable(data) { - expect().assertFail(); - console.info("=========ANS_Remove_2500 onCancel start==============>"); - console.info("=========ANS_Remove_2500 onCancel data:==============>" + JSON.stringify(data)); - console.info("=========ANS_Remove_2500 onCancel end================>"); - } - - /* - * @tc.number: ANS_Remove_2500 - * @tc.name: removeAll(callback: AsyncCallback): void; - * @tc.desc: Verify that the removeAll(callback: AsyncCallback): void interface is called to delete the - * notification information whose attribute isUnremovable is true - */ - it('ANS_Remove_2500', 0, async function (done) { - console.info("===============ANS_Remove_2500 start==========================>"); - let subscriber ={ - onConsume:onConsumeRemoveAllIsUnremovable, - onCancel:onCancelCallbackRemoveAllIsUnremovable, - } - await notify.subscribe(subscriber); - console.info("======ANS_Remove_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 : 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: "2500", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("============ANS_Remove_2500 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_2500 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_2500 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function OnConsumeRemoveAllIsUnremovablePromise(data) { - console.info("===========ANS_Remove_2600 onConsume start===========>"); - console.info("===========ANS_Remove_2600 onConsume data============>" + JSON.stringify(data)); - notify.removeAll() - console.info("===========ANS_Remove_2600 onConsume removeAll=======>"); - console.info("===========ANS_Remove_2600 onConsume end=============>"); - } - function OnCancelCallbackRemoveAllIsUnremovablePromise(data) { - console.info("===========ANS_Remove_2600 onCancel start================>"); - console.info("===========ANS_Remove_2600 onCancel data : ==============>" + JSON.stringify(data)); - console.info("===========ANS_Remove_2600 onCancel end==================>"); - } - - /* - * @tc.number: ANS_Remove_2600 - * @tc.name: removeAll(bundle?: BundleOption): Promise; - * @tc.desc: Verify that the removeAll(bundle?: BundleOption): Promise interface is called to delete the - * notification information whose attribute isUnremovable is true - */ - it('ANS_Remove_2600', 0, async function (done) { - console.info("===============ANS_Remove_2600 start==========================>"); - let subscriber ={ - onConsume:OnConsumeRemoveAllIsUnremovablePromise, - onCancel:OnCancelCallbackRemoveAllIsUnremovablePromise, - } - await notify.subscribe(subscriber); - console.info("============ANS_Remove_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 : 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: "2600", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("==========ANS_Remove_2600 publish promise==============>"); - setTimeout((async function(){ - console.info("======ANS_Remove_2600 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_2600 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function removeAllCallBack2TimesOf2(err) { - console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf2 start===========>"); - console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf2 err=============>" + JSON.stringify(err)); - console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf2 end=============>"); - } - function removeAllCallBack2TimesOf1(err) { - console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf1 start==========>"); - console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf1 err============>" + JSON.stringify(err)); - expect(err.code).assertEqual(0); - notify.removeAll(removeAllCallBack2TimesOf2); - console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf1 removeAll=====>"); - console.info("=======ANS_Remove_2700 removeAllCallBack2TimesOf1 end==========>"); - } - function onConsumeRemoveAll2Times(data) { - console.info("=======ANS_Remove_2700 onConsume start=========>"); - console.info("=======ANS_Remove_2700 onConsume data:=========>" + JSON.stringify(data)); - notify.removeAll(removeAllCallBack2TimesOf1); - console.info("=======ANS_Remove_2700 onConsume remove========>"); - console.info("=======ANS_Remove_2700 onConsume end===========>"); - } - let timesOfOnCancelCallbackRemoveAll2Times - function onCancelRemoveAll2Times(data) { - timesOfOnCancelCallbackRemoveAll2Times = timesOfOnCancelCallbackRemoveAll2Times + 1 - console.info("=======ANS_Remove_2700 onCancel start============>"); - console.info("=======ANS_Remove_2700 onCancel data:============>" + JSON.stringify(data)); - if (timesOfOnCancelCallbackRemoveAll2Times == 1){ - expect(data.request.id).assertEqual(27); - console.info("=======ANS_Remove_2700 onCancel id============>"); - } else if (timesOfOnCancelCallbackRemoveAll2Times == 2){ - expect().assertFail(); - } - console.info("=======ANS_Remove_2700 onCancel end============>"); - } - - /* - * @tc.number: ANS_Remove_2700 - * @tc.name: remove(hashCode: string, callback: AsyncCallback): void; - * @tc.desc: Verify that the interface remove(hashCode: string, callback: AsyncCallback): void; is called - * twice in a row to delete the notification information - */ - it('ANS_Remove_2700', 0, async function (done) { - console.info("===============ANS_Remove_2700 start==========================>"); - timesOfOnCancelCallbackRemoveAll2Times = 0 - let subscriber ={ - onConsume:onConsumeRemoveAll2Times, - onCancel:onCancelRemoveAll2Times, - } - await notify.subscribe(subscriber); - console.info("============ANS_Remove_2700 subscribe promise==================>"); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 27, - 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: "2700", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("=========ANS_Remove_2700 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_2700 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_2700 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function onConsumeCallbackRemoveAll2TimesPromise(data) { - console.info("=============ANS_Remove_2800 onConsume start=============>"); - console.info("=============ANS_Remove_2800 onConsume data: =======================>" + JSON.stringify(data)); - notify.removeAll(); - console.info("=============ANS_Remove_2800 onConsume removeAll1=======================>"); - notify.removeAll(); - console.info("=============ANS_Remove_2800 onConsume removeAll2=======================>"); - console.info("=============ANS_Remove_2800 onConsume end=============>"); - } - let timesOfOnCancelCallbackRemoveAll2TimesPromise - function onCancelCallbackRemoveAll2TimesPromise(data) { - timesOfOnCancelCallbackRemoveAll2TimesPromise = timesOfOnCancelCallbackRemoveAll2TimesPromise + 1 - console.info("===================ANS_Remove_2800 onCancel start=======================>"); - console.info("===================ANS_Remove_2800 onCancel data : ========>" + JSON.stringify(data)); - if (timesOfOnCancelCallbackRemoveAll2TimesPromise == 1){ - expect(data.request.id).assertEqual(28); - } else if (timesOfOnCancelCallbackRemoveAll2TimesPromise == 2){ - expect().assertFail(); - } - console.info("===================ANS_Remove_2800 onCancel end=======================>"); - } - - /* - * @tc.number: ANS_Remove_2800 - * @tc.name: removeAll(bundle?: BundleOption): Promise; - * @tc.desc: Verify that the interface removeAll(bundle?: BundleOption): Promise; is called twice in a row - * to delete the notification information - */ - it('ANS_Remove_2800', 0, async function (done) { - console.info("===============ANS_Remove_2800 start==========================>"); - timesOfOnCancelCallbackRemoveAll2TimesPromise = 0 - let subscriber ={ - onConsume:onConsumeCallbackRemoveAll2TimesPromise, - onCancel:onCancelCallbackRemoveAll2TimesPromise, - } - await notify.subscribe(subscriber); - console.info("================ANS_Remove_2800 subscribe promise==================>"); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 28, - 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: "2800", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("================ANS_Remove_2800 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_2800 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_2800 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function onConsumeRemoveByNotificationKey(data) { - console.info("=======ANS_Remove_2900 onConsume start=======================>"); - console.info("=======ANS_Remove_2900 onConsume data: =======================>" + JSON.stringify(data)); - console.info("=======ANS_Remove_2900 onConsume creatorBundleName:====>" + data.request.creatorBundleName); - console.info("=======ANS_Remove_2900 onConsume creatorUid:==============>" + data.request.creatorUid); - console.info("=======ANS_Remove_2900 onConsume id: =======================>" + data.request.id); - console.info("=======ANS_Remove_2900 onConsume label: =======================>" + data.request.label); - let bundleOption = { - bundle:data.request.creatorBundleName, - uid:data.request.creatorUid, - } - let notificationKey = { - id:data.request.id, - label:data.request.label - } - notify.remove(bundleOption, notificationKey, notify.RemoveReason.CANCEL_REASON_REMOVE, - removeByNotificationKeyCB); - console.info("=============ANS_Remove_2900 onConsume remove=======================>"); - console.info("=============ANS_Remove_2900 onConsume end=======================>"); - } - function onCancelRemoveByNotificationKey(data) { - console.info("=============ANS_Remove_2900 onCancel start================>"); - console.info("=============ANS_Remove_2900 onCancel data:==========>" + JSON.stringify(data)); - expect(data.request.label).assertEqual("2900"); - console.info("=============ANS_Remove_2900 onCancel label:==========>" + JSON.stringify(data.request.label)); - expect(data.request.id).assertEqual(29); - console.info("=============ANS_Remove_2900 onCancel id:==========>" + JSON.stringify(data.request.id)); - console.info("=============ANS_Remove_2900 onCancel end================>"); - } - function removeByNotificationKeyCB(err, data) { - console.info("==========ANS_Remove_2900 removeCalback start============>"); - console.info("==========ANS_Remove_2900 removeCalback err==============>" + JSON.stringify(err)); - console.info("==========ANS_Remove_2900 removeCalback data=============>" + JSON.stringify(data)); - console.info("==========ANS_Remove_2900 removeCalback end============>"); - } - - /* - * @tc.number: ANS_Remove_2900 - * @tc.name: remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason, - * callback: AsyncCallback): void; - * @tc.desc: Verify that the calling interface remove - * deletes notification information through BundleOption and NotificationKey - */ - it('ANS_Remove_2900', 0, async function (done) { - console.info("===============ANS_Remove_2900 start==========================>"); - let subscriber ={ - onConsume:onConsumeRemoveByNotificationKey, - onCancel:onCancelRemoveByNotificationKey, - } - await notify.subscribe(subscriber); - console.info("================ANS_Remove_2900 subscribe promise==================>"); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 29, - 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: "2900", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("==============ANS_Remove_2900 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_2900 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_2900 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function onConsumeRemoveByNotificationKeyPromise(data) { - console.info("==========ANS_Remove_3000 onConsume start==============>"); - console.info("==========ANS_Remove_3000 data: =======================>" + JSON.stringify(data)); - let bundleOption = { - bundle:data.request.creatorBundleName, - uid:data.request.creatorUid, - } - let notificationKey = { - id:30, - label:"3000" - } - notify.remove(bundleOption,notificationKey, notify.RemoveReason.CANCEL_REASON_REMOVE) - console.info("==========ANS_Remove_3000 onConsume remove==============>"); - console.info("==========ANS_Remove_3000 onConsume end=================>"); - } - function onCancelRemoveByNotificationKeyPromise(data) { - console.info("========ANS_Remove_3000 onCancel start========>"); - console.info("========ANS_Remove_3000 onCancel data:========>" + JSON.stringify(data)); - expect(data.request.label).assertEqual("3000"); - expect(data.request.id).assertEqual(30); - console.info("========ANS_Remove_3000 onCancel end==========>"); - } - - /* - * @tc.number: ANS_Remove_3000 - * @tc.name: remove(bundle: BundleOption, notificationKey: NotificationKey, - * reason: RemoveReason): Promise; - * @tc.desc: Verify that the calling interface remove - * deletes notification information through BundleOption and NotificationKey - */ - it('ANS_Remove_3000', 0, async function (done) { - console.info("===============ANS_Remove_3000 start==========================>"); - let subscriber ={ - onConsume:onConsumeRemoveByNotificationKeyPromise, - onCancel:onCancelRemoveByNotificationKeyPromise, - } - await notify.subscribe(subscriber); - console.info("===============ANS_Remove_3000 subscribe promise==================>"); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 30, - 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: "3000", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("=============ANS_Remove_3000 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_3000 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_3000 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function onConsumeRemoveByNotificationKeyWrongKey(data) { - console.info("==========ANS_Remove_3100 onConsume start=============>"); - console.info("==========ANS_Remove_3100 onConsume data:=============>" + JSON.stringify(data)); - let bundleOption = { - bundle:data.request.creatorBundleName, - uid:data.request.creatorUid, - } - let notificationKey = { - id:0, - label:"wrongLabel" - } - notify.remove(bundleOption, notificationKey, notify.RemoveReason.CANCEL_REASON_REMOVE, - removeByNotificationKeyCBWrongKey); - console.info("==========ANS_Remove_3100 onConsume remove==========>"); - console.info("==========ANS_Remove_3100 onConsume end=============>"); - } - function onCancelRemoveByNotificationKeyWrongKey(data) { - console.info("==========ANS_Remove_3100 onCancel start===========>"); - console.info("==========ANS_Remove_3100 onCancel data:===========>" + JSON.stringify(data)); - expect().assertFail(); - console.info("==========ANS_Remove_3100 onCancel end===========>"); -} - function removeByNotificationKeyCBWrongKey(err, data) { - console.info("==========ANS_Remove_3100 removeCallback start===========>"); - console.info("==========ANS_Remove_3100 removeCallback err=============>" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info("==========ANS_Remove_3100 removeCallback data============>" + JSON.stringify(data)); - console.info("==========ANS_Remove_3100 removeCallback end===========>"); - } - - /* - * @tc.number: ANS_Remove_3100 - * @tc.name: remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason, - * callback: AsyncCallback): void; - * @tc.desc: Verify that the calling interface remove - * deletes notification information through BundleOption and - * NotificationKey correct bundleOption,wrong notificationKey. - */ - it('ANS_Remove_3100', 0, async function (done) { - console.info("===============ANS_Remove_3100 start==========================>"); - let subscriber ={ - onConsume:onConsumeRemoveByNotificationKeyWrongKey, - onCancel:onCancelRemoveByNotificationKeyWrongKey, - } - await notify.subscribe(subscriber); - console.info("==============ANS_Remove_3100 subscribe promise==================>"); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 31, - 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: "3100", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("=============ANS_Remove_3100 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_3100 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_3100 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function onConsumeRemoveByNotificationKeyWrongKeyPromise(data) { - console.info("===========ANS_Remove_3200 onConsume start===============>"); - console.info("===========ANS_Remove_3200 onConsume data:===============>" + JSON.stringify(data)); - let bundleOption = { - bundle:data.request.creatorBundleName, - uid:data.request.creatorUid, - } - let notificationKey = { - id:0, - label:"wrongLabel" - } - notify.remove(bundleOption, notificationKey, notify.RemoveReason.CANCEL_REASON_REMOVE).then((data)=>{ - console.info("=======ANS_Remove_3200 onConsume remove data:=======>" + JSON.stringify(data)); - }).catch((err)=>{ - console.info("=======ANS_Remove_3200 onConsume remove err:========>" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - }); - console.info("===========ANS_Remove_3200 onConsume remove============>"); - console.info("===========ANS_Remove_3200 onConsume end===============>"); - } - function onCancelRemoveByNotificationKeyWrongKeyPromise(data) { - console.info("===========ANS_Remove_3200 onCancel start=================>"); - console.info("===========ANS_Remove_3200 onCanceldata:==================>" + JSON.stringify(data)); - expect().assertFail(); - console.info("===========ANS_Remove_3200 onCancel end=================>"); - } - - /* - * @tc.number: ANS_Remove_3200 - * @tc.name: remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason, - * callback: AsyncCallback): void; - * @tc.desc: Verify that the calling interface remove - * deletes notification information through BundleOption and NotificationKey correct - * bundleOption,wrong notificationKey. - */ - it('ANS_Remove_3200', 0, async function (done) { - console.info("===============ANS_Remove_3200 start=================>"); - let subscriber ={ - onConsume:onConsumeRemoveByNotificationKeyWrongKeyPromise, - onCancel:onCancelRemoveByNotificationKeyWrongKeyPromise, - } - await notify.subscribe(subscriber); - console.info("===============ANS_Remove_3200 subscribe promise==================>"); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 32, - 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: "3200", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("===========ANS_Remove_3200 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_3200 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_3200 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function OnConsumeRemoveByNotificationKeyWrongBundle(data) { - console.info("==============ANS_Remove_3300 onConsume start===============>"); - console.info("==============ANS_Remove_3300 onConsume data:===============>" + JSON.stringify(data)); - let bundleOption = { - bundle:"wrongBundleName", - uid:0, - } - let notificationKey = { - id:33, - label:"3300" - } - notify.remove(bundleOption, notificationKey, notify.RemoveReason.CANCEL_REASON_REMOVE, - removeByNotificationKeyCBWrongBundle); - console.info("==============ANS_Remove_3300 onConsume remove===============>"); - console.info("==============ANS_Remove_3300 onConsume end==================>"); - } - function OnCancelRemoveByNotificationKeyWrongBundle(data) { - console.info("==============ANS_Remove_3300 onCancel start=============>"); - console.info("==============ANS_Remove_3300 onCancel data:===========>" + JSON.stringify(data)); - expect().assertFail(); - console.info("==============ANS_Remove_3300 onCancel end=============>"); - } - function removeByNotificationKeyCBWrongBundle(err, data) { - console.info("===========ANS_Remove_3300 removeCallback start==========>"); - console.info("===========ANS_Remove_3300 removeCallback err============>" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info("===========ANS_Remove_3300 removeCallback data===========>" + JSON.stringify(data)); - console.info("===========ANS_Remove_3300 removeCallback end============>"); - } - - /* - * @tc.number: ANS_Remove_3300 - * @tc.name: remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason, - * callback: AsyncCallback): void; - * @tc.desc: Verify that the calling interface remove - * deletes notification information through BundleOption and - * NotificationKey wrong bundleOption,correct notificationKey. - */ - it('ANS_Remove_3300', 0, async function (done) { - console.info("===============ANS_Remove_3300 start==========================>"); - let subscriber ={ - onConsume:OnConsumeRemoveByNotificationKeyWrongBundle, - onCancel:OnCancelRemoveByNotificationKeyWrongBundle, - } - await notify.subscribe(subscriber); - console.info("================ANS_Remove_3300 subscribe promise==================>"); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 33, - 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: "3300", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("================ANS_Remove_3300 publish promise=================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_3300 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_3300 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function onConsumeRemoveByNotificationKeyWrongBundlePromise(data) { - console.info("===========ANS_Remove_3400 onConsume start============>"); - console.info("===========ANS_Remove_3400 onConsume data:============>" + JSON.stringify(data)); - let bundleOption = { - bundle:"wrongBundleName", - uid:0, - } - let notificationKey = { - id:34, - label:"3400" - } - notify.remove(bundleOption, notificationKey, notify.RemoveReason.CANCEL_REASON_REMOVE).then((data)=>{ - console.info("=======ANS_Remove_3400 onConsume remove data:=======>" + JSON.stringify(data)); - }).catch((err)=>{ - console.info("=======ANS_Remove_3400 onConsume remove err:========>" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - }); - console.info("===========ANS_Remove_3400 onConsume remove=========>"); - console.info("===========ANS_Remove_3400 onConsume end============>"); - } - function onCancelRemoveByNotificationKeyWrongBundlePromise(data) { - console.info("===========ANS_Remove_3400 onCancel start=============>"); - console.info("===========ANS_Remove_3400 onCancel data: ============>" + JSON.stringify(data)); - expect().assertFail(); - console.info("===========ANS_Remove_3400 onCancel end===============>"); - } - - /* - * @tc.number: ANS_Remove_3400 - * @tc.name: remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason, - * callback: AsyncCallback): void; - * @tc.desc: Verify that the calling interface remove - * deletes notification information through BundleOption and NotificationKey correct - * bundleOption,wrong notificationKey. - */ - it('ANS_Remove_3400', 0, async function (done) { - console.info("===============ANS_Remove_3400 start==========================>"); - let subscriber ={ - onConsume:onConsumeRemoveByNotificationKeyWrongBundlePromise, - onCancel:onCancelRemoveByNotificationKeyWrongBundlePromise, - } - await notify.subscribe(subscriber); - console.info("============ANS_Remove_3400 subscribe promise==================>"); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 34, - 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: "3400", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("============ANS_Remove_3400 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_3400 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_3400 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function removeByNotificationKey2Times2CB(err,data) { - console.info("==========ANS_Remove_3500 removeCallback2Times2 start============>"); - console.info("==========ANS_Remove_3500 removeCallback2Times2 err==============>" + JSON.stringify(err)); - console.info("==========ANS_Remove_3500 removeCallback2Times2 data============>" + JSON.stringify(data)); - expect(err.code != 0).assertEqual(true); - console.info("==========ANS_Remove_3500 removeCallback2Times2 end================>"); - } - function removeByNotificationKey2Times1CB(err,data) { - console.info("==========ANS_Remove_3500 removeCallback2Times1 start===========>"); - console.info("==========ANS_Remove_3500 removeCallback2Times1 err=============>" + JSON.stringify(err)); - console.info("==========ANS_Remove_3500 removeCallback2Times1 data============>" + JSON.stringify(data)); - expect(err.code).assertEqual(0); - console.info("==========ANS_Remove_3500 removeCallback2Times1 end==============>"); - } - function onConsumeRemoveByNotificationKey2Times(data) { - console.info("=========ANS_Remove_3500 onConsume start=======================>"); - console.info("=========ANS_Remove_3500 onConsume data:=========>" + JSON.stringify(data)); - let bundleOption = { - bundle:data.request.creatorBundleName, - uid:data.request.creatorUid, - } - let notificationKey = { - id:35, - label:"3500" - } - notify.remove(bundleOption, notificationKey, notify.RemoveReason.CANCEL_REASON_REMOVE, - removeByNotificationKey2Times1CB); - notify.remove(bundleOption, notificationKey, notify.RemoveReason.CANCEL_REASON_REMOVE, - removeByNotificationKey2Times2CB); - console.info("=========ANS_Remove_3500 onConsume remove==============>"); - console.info("=========ANS_Remove_3500 onConsume end=================>"); - } - let timesOfOnCancelRemoveByNotificationKey2Times - function onCancelRemoveByNotificationKey2Times(data) { - timesOfOnCancelRemoveByNotificationKey2Times = timesOfOnCancelRemoveByNotificationKey2Times + 1 - console.info("=========ANS_Remove_3500 onCancel start===============>"); - console.info("=========ANS_Remove_3500 onCancel data : ========>" + JSON.stringify(data)); - if (timesOfOnCancelRemoveByNotificationKey2Times == 1){ - expect(data.request.id).assertEqual(35); - expect(data.request.label).assertEqual("3500"); - } else if (timesOfOnCancelRemoveByNotificationKey2Times == 2){ - expect().assertFail(); - } - console.info("=========ANS_Remove_3500 onCancel end=======================>"); - } - - /* - * @tc.number: ANS_Remove_3500 - * @tc.name: remove(bundle: BundleOption, notificationKey: NotificationKey, reason: RemoveReason, - * callback: AsyncCallback): void; - * @tc.desc: Verify that the interface remove - * is called twice in a row to delete the notification information - */ - it('ANS_Remove_3500', 0, async function (done) { - console.info("===============ANS_Remove_3500 start==========================>"); - timesOfOnCancelRemoveByNotificationKey2Times = 0 - let subscriber ={ - onConsume:onConsumeRemoveByNotificationKey2Times, - onCancel:onCancelRemoveByNotificationKey2Times, - } - await notify.subscribe(subscriber); - console.info("===========ANS_Remove_3500 subscribe promise==================>"); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 35, - 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: "3500", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("============ANS_Remove_3500 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_3500 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_3500 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) - - function onConsumeRemoveByNotificationKey2TimesPromise(data) { - console.info("=========ANS_Remove_3600 onConsume start===========>"); - console.info("=========ANS_Remove_3600 onConsume data: =======================>" + JSON.stringify(data)); - let bundleOption = { - bundle:data.request.creatorBundleName, - uid:data.request.creatorUid, - } - let notificationKey = { - id:36, - label:"3600" - } - notify.remove(bundleOption, notificationKey, notify.RemoveReason.CLICK_REASON_REMOVE) - console.info("=========ANS_Remove_3600 onConsume remove1===========>"); - notify.remove(bundleOption, notificationKey, notify.RemoveReason.CLICK_REASON_REMOVE).then((data)=>{ - console.info("=======ANS_Remove_3600 onConsume remove2 data:=======>" + JSON.stringify(data)); - }).catch((err)=>{ - console.info("=======ANS_Remove_3600 onConsume remove2 err:========>" + JSON.stringify(err)); - expect(err.code != 0).assertEqual(true); - console.info("=========ANS_Remove_3600 onConsume end===========>"); - }); - } - let timesOnCancelcbRemoveByKey2TimesPromise - function onCancelRemoveByNotificationKey2TimesPromise(data) { - timesOnCancelcbRemoveByKey2TimesPromise = timesOnCancelcbRemoveByKey2TimesPromise + 1 - console.info("=========ANS_Remove_3600 onCancel start=============>"); - console.info("=========ANS_Remove_3600 onCancel data:=============>" + JSON.stringify(data)); - if (timesOnCancelcbRemoveByKey2TimesPromise == 1){ - expect(data.request.id).assertEqual(36); - expect(data.request.label).assertEqual("3600"); - } else if (timesOnCancelcbRemoveByKey2TimesPromise == 2){ - expect().assertFail(); - } - console.info("=========ANS_Remove_3600 onCancel end=============>"); - } - - /* - * @tc.number: ANS_Remove_3600 - * @tc.name: remove(bundle: BundleOption, notificationKey: NotificationKey, - * reason: RemoveReason): Promise; - * @tc.desc: Verify that the interface remove - * is called twice in a row to delete the notification information - */ - it('ANS_Remove_3600', 0, async function (done) { - console.info("===============ANS_Remove_3600 start==========================>"); - timesOnCancelcbRemoveByKey2TimesPromise = 0 - timesOnCancelcbRemoveByKey2TimesPromise = 0 - let subscriber ={ - onConsume:onConsumeRemoveByNotificationKey2TimesPromise, - onCancel:onCancelRemoveByNotificationKey2TimesPromise, - } - await notify.subscribe(subscriber); - console.info("========ANS_Remove_3600 subscribe promise=============>"); - let notificationRequest = { - content:{ - contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT, - normal: { - title: "test_title", - text: "test_text", - additionalText: "test_additionalText" - }, - }, - id: 36, - 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: "3600", - badgeIconStyle: 1, - showDeliveryTime: true, - } - await notify.publish(notificationRequest); - console.info("============ANS_Remove_3600 publish promise==================>"); - setTimeout((async function(){ - console.info("======ANS_Remove_3600 setTimeout============>"); - await notify.unsubscribe(subscriber); - console.info("======ANS_Remove_3600 setTimeout unsubscribe============>"); - await notify.cancelAll(); - done(); - }),timeout); - }) -}) } diff --git a/notification/ans_standard/actsansnotificationremove/src/main/js/test/List.test.js b/notification/ans_standard/actsansnotificationremove/src/main/js/test/List.test.js deleted file mode 100644 index ac1477d35..000000000 --- a/notification/ans_standard/actsansnotificationremove/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 ActsAnsNotificationRemove from './ActsAnsNotificationRemove.test.js' -export default function testsuite() { -ActsAnsNotificationRemove() -} diff --git a/notification/ans_standard/actsansnotificationremove/src/main/resources/base/element/string.json b/notification/ans_standard/actsansnotificationremove/src/main/resources/base/element/string.json deleted file mode 100644 index d2bf15e39..000000000 --- a/notification/ans_standard/actsansnotificationremove/src/main/resources/base/element/string.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "MyApplication" - }, - { - "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/actsansnotificationremove/src/main/resources/base/media/icon.png b/notification/ans_standard/actsansnotificationremove/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#Ly zaNOmT(^9tIb&eb4%CzIT zAm3CUtWSr1t4?h1kk#NBi{U|pJslvME{q|_eS^3En>SOqSxyuN1x;Is@8~m?*>}** znrRFArP!K_52RpX*&JHMR<^lVdm8ypJ}0R(SD(51j;6@ni$6bQ+2XL+R^|NnSp5}(kzvMZ^(@4fD_{QVu$(&K6H|C37TG1Am9Re{<<3gd zh@`>;BqkXMW&p0T6rt|iB$)~CvFe(XC)F9WgAZn*0@t$oZo;!*}r@_`h?KKH&6A@3= zISXoQB+~`op>NP-buiA*^0n{@i{_?MRG)&k)c)k_F+-2Lud!S9pc+i`s74NpBCaGF zXN+pHkubw*msGBTY27BKHv)RRh3;nMg4&$fD_6X9Vt~;_4D+5XPH~#Kn-yjcy!$}1 zigv#FNY>TqMhtIBb@UoF!cE~Q8~;!Pek>SQQwHnHuWKoVBosAiOr}q>!>aE*Krc)V zBUMEcJ5NU0g8}-h6i1zpMY9>m4ne?=U2~`w7K7Q0gB_=p@$5K7p6}thw z-~3dMj?YNX2X$lZ+7ngQ$=s}3mizNN@kE%OtB)?c&i~2L55z8^=yz;xMHLmlY>&Q# zJj?!)M#q_SyfkQh)k?j8IfLtB)ZCp|*vf4_B zos?73yd^h-Ac+;?E4*bpf=o*^3x3-`TVjbY4n6!EN10K6o@fxdyps05Vo3PU)otB} z`3kR+2w7_C#8Z!q`J)p{Vh!+m9-UP!$STp+Hb}}#@#_u^SsUQg<}59< zTvH3%XS4G+6FF^(m6bVF&nSUIXcl;nw{=H$%fgeJ>CgDYiLdpDXr{;-AnG z8dvcrHYVMI&`R6;GWekI@Ir3!uo)oz4^{6q0m^}@f2tM9&=YHNi6-?rh0-{+k@cQm zdp`g#YdQn%MDVg2GR>wZ`n2<0l4)9nx1Wfr&!Dvz=bPwU!h2S?ez6MVc5APE4-xLB zi&W9Q8k2@0w!C53g?iAIQ}~p*3O(@zja6KQ=M3zfW*_6o5SwR-)6VBh~m7{^-=MC-owYH5-u40a}a0liho3QZZ5L{bS_xM1)4}19)zTU$$MY zq3eZML1WC{K%YFd`Be0M-rkO^l?h{kM{$2oK1*A@HVJ57*yhDkUF!2WZ&oA4Y-sK( zCY69%#`mBCi6>6uw(x4gbFaP0+FD*JKJ-q!F1E?vLJ+d35!I5d7@^eU?(CS|C^tmI5?lv@s{{*|1F zFg|OzNpZ0hxljdjaW%45O0MOttRrd(Z?h{HYbB-KFUx&9GfFL3b8NwZ$zNu)WbBD` zYkj$^UB5%3Pj1MDr>S2Ejr9pUcgA!;ZG!@{uAy12)vG=*^9-|dNQBc8&`oxBlU~#y zs!anJX&T?57Jdr^sb>e+V`MVfY>Y0ESg7MG<7W0g&bR-ZYzzZ%2H&Etcp zcd6QeXO1D!5A#zM0lx*GH}`M)2~ZFLE;sP^RSB5wVMNfiZXPd(cmO>j=OSA3`o5r& zna(|^jGXbdN7PK)U8b7^zYtYkkeb%<%F~=OqB~kXMQkq}ii|skh@WSRt>5za;cjP0 zZ~nD%6)wzedqE}BMLt~qKwlvTr33))#uP~xyw#*Eaa|DbMQ_%mG0U8numf8)0DX`r zRoG2bM;#g|p-8gWnwRV5SCW0tLjLO&9Z?K>FImeIxlGUgo0Zk`9Qzhj1eco~7XZy+hXc@YF&ZQ=? zn*^1O56yK^x{y}q`j7}blGCx%dydV!c7)g~tJzmHhV=W~jbWRRR{1<^oDK+1clprm zz$eCy7y9+?{E|YgkW~}}iB#I4XoJ*xr8R?i_Hv$=Cof5bo-Nj~f`-DLebH}&0% zfQj9@WGd4;N~Y?mzQsHJTJq6!Qzl^-vwol(+fMt#Pl=Wh#lI5Vmu@QM0=_r+1wHt` z+8WZ~c2}KQQ+q)~2Ki77QvV&`xb|xVcTms99&cD$Zz4+-^R4kvUBxG8gDk7Y`K*)JZ^2rL(+ZWV~%W(@6 z)0bPArG#BROa_PHs~&WplQ_UIrpd)1N1QGPfv!J(Z9jNT#i%H?CE6|pPZb9hJ1JW4 z^q;ft#!HRNV0YgPojzIYT`8LuET2rUe-J|c!9l4`^*;4WtY@Ew@pL>wkjmMgGfN7 ze}}GtmU0@<_#08~I-Suk=^*9GLW=H4xhsml;vAV{%hy5Eegl@!6qKqbG024%n2HHw zCc@ivW_$@5ZoHP70(7D+(`PvgjW1Pd`wsiuv-aCukMrafwDm)B!xXVy*j2opohhoU zcJz%ADmj>i3`-3-$7nQKBQQuGY;2Qt&+(L~C>vSGFj5{Mlv?T_^dql;{zkpe4R1}R z%XfZyQ}wr*sr>jrKgm*PWLjuVc%6&&`Kbf1SuFpHPN&>W)$GmqC;pIoBC`=4-hPY8 zT*>%I2fP}vGW;R=^!1be?ta2UQd2>alOFFbVl;(SQJ4Jk#)4Z0^wpWEVvY4=vyDk@ zqlModi@iVPMC+{?rm=4(n+<;|lmUO@UKYA>EPTS~AndtK^Wy^%#3<;(dQdk3WaUkRtzSMC9}7x2||CNpF#(3T4C)@ z$~RWs`BNABKX|{cmBt>Q=&gkXl&x!!NK_%5hW0LS)Z4PB>%sV?F-{Wyj#s7W%$F{D zXdK^Fp3wvy+48+GP6F_|^PCRx=ddcTO3sG;B23A49~Qaw31SZ0Rc~`r4qqt%#OGW{ zCA_(LG5^N>yzUn&kAgVmxb=EA8s&tBXC}S1CZ(KoW)(%^JjLTPo^fs`Va;`=YlVPgmB$!yB}<(4ym6OeZ3xAJJ#;)2+B%p3P1Wt+d$eo`vz`T zXfUP2))kBDPoscH;Jc7I3NU<({|@wM$&GaDt`n7WLgIY3IA7A6-_R?z8N3mz|}*i z(zl5ot--Oq@f2-nv{X(ujT2T(k1vY_qh93pK@>H-qc%2Xta)IP0Q%zt%bqYgI`o!wv!0QerB`nCN^1n|@$sVOQ!V0teVG!I z_fD%JvfDeT1cK#-{o6Gv7}& zY0#NWin~kVaf$aufV&;63Hbs|`QVZWpDX6IMk1Hj2G}fiH9e-^6u2zf^FIr^BwD<6zjw63+{yUe8PUFvk8v{sJ=R{d#`O!sz`Q13~< zPT$JS(w=yQfU2`zPCNfSw=&zup@DXc(98afjhv@1w_f!m2Z>rMJ19AB&dB%P#Ls3b z=lK7OILM+SQ&VEd=1GN6o&>YVVtIzoZ%=Z_SdqJN2}E43{bE`>w+A;=y->@^k{oCC z$F*WTY&?34;kfyFV?b*Xb1Pq`Z=%OgwEg)Rz)tx=`f%5#w_INP=x&z5!jI;#;N$ma zhO)+MDm;SxOEVL15; zGq(v2pL3&P1Sl)8P*;G-fd{l1QJsv@e@d8)1PK4w2m*M%V3j-V~L^$i|&C@b?D?9tfwE{B^}Z$k8e5FmQ>v7Xz)sG32g9t}YBt zyR$+*_00RmPx+0mW+vVG4mxd(n$(eQf3-w>JPl2UJpafrPaL5@2j}%{VE-) zBI%6Qpj*dsdH<;g!S!avA~bv^0E+ zfyJbSjPb+j;J52U)<|cIcntQBI2T#>2;tOxu{%D?kML476AErF(qN9hPva5Nkc@BF zC-tLF@3ZFb%Kpj)M<{)x*l|*Ia@ECeXo2E4h2f!aV=cHAhi_E_mfUth(sM4^hJq7B zQsGWqdZUm9S%F`$nQ*_#NcuD`&)Ek%_s{&^78{9Hm ztri&rYLOxgFdG>O@+XHy z9#;|&vBCPXH5Mon^I`jSuR$&~ZWtyB67ujzFSj!51>#C}C17~TffQ{c-!QFQkTQ%! zIR^b1`zHx|*1GU?tbBx23weFLz5H?y_Q%N&t$}k?w+``2A=aotj0;2v$~AL z{scF-cL{wsdrmPvf#a9OHyYLcwQD4Kcm)`LLwMh4WT~p29f7M!iafJSU`IV}QY5Wa z(n44-9oA}?J{a+ah*@31WTs#&J#o1`H98#6IQf;Wv0N_!);f&9g7o-k(lW5rWnDUR zQBFIRG+X=6NnsI@mxnwm;tf5;_Uxg?jZ8m-m0}&6+DA!qam(p$mN5R})yA_7m$q@| zFEd|dpS595rxQr-n#GjI5i-AhnUE>Cr;jpCqSrD~EwK_DqI^7%3#p5)%T_od!t3SOmH9MyXeeGO2(UQL;ax|x?Ncixmeo1=$ z{-);Au{*tfzOG?KQ~K|ak8-HQ?`Pekhe2WM(8s{xv-p>Zmu_6{G!-oE$7$mY`MOJorI=+mMx?H;`pr!;fVYz?5~yXBACruWB`Ph zZM}90_<^OBxIhyZ9BW$`>6JvO;%VFpqVr8|7t3~AmxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}y