diff --git a/notification/ans_standard/publish_test/wantagent/BUILD.gn b/notification/ans_standard/publish_test/wantagent/BUILD.gn index 8c7eecdf629dfc6b09c1f6e299e5ea3e0f8a9e9e..48b82e1c0ae44319253d7e295e43579340649e8b 100644 --- a/notification/ans_standard/publish_test/wantagent/BUILD.gn +++ b/notification/ans_standard/publish_test/wantagent/BUILD.gn @@ -17,7 +17,6 @@ group("wantagent") { testonly = true if (is_standard_system) { deps = [ - "sub:ActsAnsCommonSubscriberTest", "test1:test1", "test2:test2", "wantagent1:ActsAnsWantAgentOneTest", diff --git a/notification/ans_standard/publish_test/wantagent/sub/BUILD.gn b/notification/ans_standard/publish_test/wantagent/sub/BUILD.gn deleted file mode 100644 index ac8d2eb90a2df0c1f8e05db6a76fc6cf12e818cb..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/sub/BUILD.gn +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (c) 2021 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_hap("ActsAnsCommonSubscriberTest") { - hap_profile = "./entry/src/main/config.json" - hap_name = "ActsAnsCommonSubscriberTest" - subsystem_name = XTS_SUITENAME - final_hap_path = - "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" - testonly = true - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" -} -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "./entry/src/main/js/default" -} -ohos_resources("hjs_demo_resources") { - sources = [ "./entry/src/main/js/resources" ] - hap_profile = "./entry/src/main/config.json" -} diff --git a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/config.json b/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/config.json deleted file mode 100644 index 1703667793a4438d350888636f2c72e14409bcc3..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/config.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsanscommonsubscribertest", - "vendor": "example", - "version": { - "code": 1, - "name": "1.0" - }, - "apiVersion": { - "compatible": 5, - "target": 5, - "releaseType": "Beta1" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.actsanscommonsubscribertest", - "name": ".MyApplication", - "deviceType": [ - "phone" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry" - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "name": "com.example.actsanscommonsubscribertest.MainAbility", - "icon": "$media:icon", - "description": "$string:mainability_description", - "label": "$string:app_name", - "type": "page", - "isVisible": "true", - "launchType": "standard", - "visible": true - } - ], - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} diff --git a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/app.js deleted file mode 100644 index 2a68c1992145a976957d7dcdd69a7e9c2e8e9877..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/app.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d978a3a53be988388c87182f81785e170c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748322f44942c1b003319d8e66c837675f..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/pages/index/index.css deleted file mode 100644 index 6fda792753f2e15f22b529c7b90a82185b2770bf..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,9 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} - -.title { - font-size: 100px; -} diff --git a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/pages/index/index.hml deleted file mode 100644 index 223f355bd902b758644a01a45069bff99ba2fe30..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - 发布公共事件 - -
diff --git a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/pages/index/index.js deleted file mode 100644 index c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import file from '@system.file' -import {Core, ExpectExtend} from 'deccjsunit/index' - -const injectRef = Object.getPrototypeOf(global) || global -injectRef.regeneratorRuntime = require('@babel/runtime/regenerator') - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - - const configService = core.getDefaultService('config') - configService.setConfig(this) - - require('../../../test/List.test') - core.execute() - }, - onReady() { - console.info('onReady'); - }, -} diff --git a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/resources/base/element/string.json deleted file mode 100644 index 6d530caefcdbe79f49db0b49fb864ed4daaeaac0..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "Sub1" - }, - { - "name": "mainability_description", - "value": "JS_Phone_Empty Feature Ability" - } - ] -} \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/resources/base/media/icon.png and /dev/null differ diff --git a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/test/List.test.js deleted file mode 100644 index 41999288d49304127387014dc88894130a148ab4..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/test/List.test.js +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -require('./Subscriber.js') \ No newline at end of file diff --git a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/test/Subscriber.js b/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/test/Subscriber.js deleted file mode 100644 index e944e0caa2258ea7dce3708ad974ed8b7360ba72..0000000000000000000000000000000000000000 --- a/notification/ans_standard/publish_test/wantagent/sub/entry/src/main/js/test/Subscriber.js +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import Subscriber from '@ohos.commonevent' -import wantAgent from '@ohos.wantAgent'; -import { OperationType, Flags } from '@ohos.wantagent'; -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' -var commonEventSubscribeInfo; -var commonEventSubscriber; -var WantAgent; -var time = 1000 -describe('ActsAnsCommonSubscriberTest', function () { - console.info("===========ActsSubscriberTest start====================>"); - - //consume - async function getSubscribeInfoCallBack(err, data) { - console.log("============data=========="+JSON.stringify(data)) -// expect(data.events[0]).assertEqual("action1"); - await Subscriber.subscribe(commonEventSubscriber, subscriberCallBack001); - } - function subscriberCallBack001(err, data) { - console.info("==========================>subscriberCallBack001"); - expect(data.event).assertEqual("action1"); - expect(data.bundleName).assertEqual(""); - expect(data.code).assertEqual(0); - expect(data.data).assertEqual(""); - } - //subscribe - function subscribeCallback(err) { - console.debug("==========================>subscribeCallback=======================>"); - } - - /* - * @tc.number : ActsSubscriberTestUnorder_0100 - * @tc.name : verify subscribe and publish : Check subscribe and publish common event data - * @tc.desc : Check the subscriber can receive event "publish_event0100" type of the interface (by Promise) - */ - it('ActsSubscriberTestUnorder_0100', 0, async function (done) { - console.info("===============ActsSubscriberTestUnorder_0100=============================>"); - commonEventSubscribeInfo = { - events: ["action1"], - }; - - await Subscriber.createSubscriber( - commonEventSubscribeInfo - ).then(async (data) =>{ - console.info("===============ActsSubscriberTestUnorder_0100=========createSubscriber promise"+JSON.stringify(data)); - commonEventSubscriber = data; - await data.getSubscribeInfo().then(async (data)=>{ - console.info("===============ActsSubscriberTestUnorder_0100=========getSubscribeInfo promise"); - await getSubscribeInfoCallBack(data); - }); - }) - console.info("===============ActsSubscriberTestUnorder_0100==============================>"); - done(); - setTimeout(function(){ - console.debug("====>time out ActsSubscriberTestUnorder_0100====>"); - }, time) - }) -}) - diff --git a/notification/ans_standard/publish_test/wantagent/sub/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/wantagent/sub/signature/openharmony_sx.p7b deleted file mode 100644 index 9be1e98fa4c0c28ca997ed660112fa16b194f0f5..0000000000000000000000000000000000000000 Binary files a/notification/ans_standard/publish_test/wantagent/sub/signature/openharmony_sx.p7b and /dev/null differ