diff --git a/notification/ans_standard/publish_test/BUILD.gn b/notification/ans_standard/publish_test/BUILD.gn
index 4eebd0054a0301434b1f8ba1fc2135513a86b6c9..90cb362daface59e3c02b42e3eda90347560ae9f 100644
--- a/notification/ans_standard/publish_test/BUILD.gn
+++ b/notification/ans_standard/publish_test/BUILD.gn
@@ -19,7 +19,8 @@ group("publish_test") {
#"actsanspublishcontroltest:ActsAnsPublishControlTest",
#"badgedisplayed:badgedisplayed",
#"badgedisplayedset:badgedisplayedset",
- #"enablenotification:enablenotification",
+ "enablenotification:enablenotification",
+
#"enablenotificationset:enablenotificationset",
"getactive:getactive",
"getwantagentinfo:getwantagentinfo",
@@ -27,6 +28,9 @@ group("publish_test") {
#"publishcontentype:ActsAnsNotificationTest",
#"subscribe:subscribe",
#"unsubscribe:ActsAnsUnSubscriberTest",
+ #"activeButton:ActsAnsActionButtonTest",
+ #"publishicontest:ActsAnsIconTest",
+ #"publishimage:ActsAnsPublishImageTest",
"wantagent:wantagent",
]
}
diff --git a/notification/ans_standard/publish_test/activeButton/.gitignore b/notification/ans_standard/publish_test/activeButton/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..82dc42bd41e44f0a17e007c62feabac9a3f35d72
--- /dev/null
+++ b/notification/ans_standard/publish_test/activeButton/.gitignore
@@ -0,0 +1,15 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+/entry/.preview
+.cxx
diff --git a/notification/ans_standard/publish_test/activeButton/.idea/.gitignore b/notification/ans_standard/publish_test/activeButton/.idea/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..eaf91e2ac647df635a09f01b8a2a254252aae8d7
--- /dev/null
+++ b/notification/ans_standard/publish_test/activeButton/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/notification/ans_standard/publish_test/activeButton/.idea/compiler.xml b/notification/ans_standard/publish_test/activeButton/.idea/compiler.xml
new file mode 100644
index 0000000000000000000000000000000000000000..245a82c8279131bde0c8c09a1f1791c8b0312984
--- /dev/null
+++ b/notification/ans_standard/publish_test/activeButton/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/activeButton/.idea/gradle.xml b/notification/ans_standard/publish_test/activeButton/.idea/gradle.xml
new file mode 100644
index 0000000000000000000000000000000000000000..c848cf9e3b543d3cc2089b7ea3ddf4ed6abda171
--- /dev/null
+++ b/notification/ans_standard/publish_test/activeButton/.idea/gradle.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/activeButton/.idea/jarRepositories.xml b/notification/ans_standard/publish_test/activeButton/.idea/jarRepositories.xml
new file mode 100644
index 0000000000000000000000000000000000000000..aa00d771aa98b60cc8db06b5e24919c06b208cda
--- /dev/null
+++ b/notification/ans_standard/publish_test/activeButton/.idea/jarRepositories.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/activeButton/.idea/misc.xml b/notification/ans_standard/publish_test/activeButton/.idea/misc.xml
new file mode 100644
index 0000000000000000000000000000000000000000..9883d055f8725da2d0f5c1cecc525b815e5dfcec
--- /dev/null
+++ b/notification/ans_standard/publish_test/activeButton/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/activeButton/BUILD.gn b/notification/ans_standard/publish_test/activeButton/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..5ec08a43df39a215c9d3aff065dbd4aa5f7b05d5
--- /dev/null
+++ b/notification/ans_standard/publish_test/activeButton/BUILD.gn
@@ -0,0 +1,30 @@
+# Copyright (c) 2021 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+import("//test/xts/tools/build/suite.gni")
+
+ohos_js_hap_suite("ActsAnsActionButtonTest") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":hjs_demo_js_assets",
+ ":hjs_demo_resources",
+ ]
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "ActsAnsActionButtonTest"
+}
+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/activeButton/Test.json b/notification/ans_standard/publish_test/activeButton/Test.json
new file mode 100644
index 0000000000000000000000000000000000000000..d61a931ff2002b8d458f458e11c333ec27a7140d
--- /dev/null
+++ b/notification/ans_standard/publish_test/activeButton/Test.json
@@ -0,0 +1,18 @@
+{
+ "description": "Configuration for hjunit demo Tests",
+ "driver": {
+ "type": "JSUnitTest",
+ "test-timeout": "60000",
+ "package": "com.example.actsansactionbuttontest",
+ "shell-timeout": "60000"
+ },
+ "kits": [
+ {
+ "test-file-name": [
+ "ActsAnsActionButtonTest"
+ ],
+ "type": "AppInstallKit",
+ "cleanup-apps": true
+ }
+ ]
+}
diff --git a/notification/ans_standard/publish_test/activeButton/entry/.gitignore b/notification/ans_standard/publish_test/activeButton/entry/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..3543521e9fef8e7322940a87c2b45dd0061b0f45
--- /dev/null
+++ b/notification/ans_standard/publish_test/activeButton/entry/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/config.json b/notification/ans_standard/publish_test/activeButton/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..947e90b4ed016b2593f66ce7438ee66a5167ea49
--- /dev/null
+++ b/notification/ans_standard/publish_test/activeButton/entry/src/main/config.json
@@ -0,0 +1,62 @@
+{
+ "app": {
+ "bundleName": "com.example.actsansactionbuttontest",
+ "vendor": "example",
+ "version": {
+ "code": 1,
+ "name": "1.0"
+ },
+ "apiVersion": {
+ "compatible": 5,
+ "target": 5,
+ "releaseType": "Beta1"
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.example.actsansactionbuttontest",
+ "name": ".MyApplication",
+ "deviceType": [
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry",
+ "moduleType": "entry"
+ },
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ],
+ "name": "com.example.actsansactionbuttontest.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
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/app.js
new file mode 100644
index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877
--- /dev/null
+++ b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/app.js
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+export default {
+ onCreate() {
+ console.info('AceApplication onCreate');
+ },
+ onDestroy() {
+ console.info('AceApplication onDestroy');
+ }
+};
diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/i18n/en-US.json
new file mode 100644
index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c
--- /dev/null
+++ b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/i18n/en-US.json
@@ -0,0 +1,6 @@
+{
+ "strings": {
+ "hello": "Hello",
+ "world": "World"
+ }
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/i18n/zh-CN.json
new file mode 100644
index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f
--- /dev/null
+++ b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/i18n/zh-CN.json
@@ -0,0 +1,6 @@
+{
+ "strings": {
+ "hello": "您好",
+ "world": "世界"
+ }
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.css
new file mode 100644
index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf
--- /dev/null
+++ b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.css
@@ -0,0 +1,9 @@
+.container {
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+}
+
+.title {
+ font-size: 100px;
+}
diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.hml
new file mode 100644
index 0000000000000000000000000000000000000000..485c1ea4f2631a1045e84574a6e492429c6152db
--- /dev/null
+++ b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.hml
@@ -0,0 +1,5 @@
+
+
+ activeButton
+
+
diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c
--- /dev/null
+++ b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/default/pages/index/index.js
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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/activeButton/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..eb3bb563e41888ba752c3a4da28e4d09cefec8b8
--- /dev/null
+++ b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/resources/base/element/string.json
@@ -0,0 +1,12 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "ActiveBtn"
+ },
+ {
+ "name": "mainability_description",
+ "value": "JS_Phone_Empty Feature Ability"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/resources/base/media/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/resources/base/media/icon.png differ
diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/test/ActiveButton.js b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/test/ActiveButton.js
new file mode 100644
index 0000000000000000000000000000000000000000..bf68277af4ad420a268f894498240488bc3f3c8d
--- /dev/null
+++ b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/test/ActiveButton.js
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import notify from '@ohos.notification'
+import wantagent from '@ohos.wantAgent'
+import image from '@ohos.multimedia.image'
+import { OperationType, Flags } from '@ohos.wantagent'
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
+
+var largeBuffer
+var smallBuffer
+var opts
+var subInfo
+var largeIcon
+var smallIcon
+var time = 1000
+describe('ActsAnsActionButtonTest', function () {
+ console.info("===========ActsDoNotSubscriberTest start====================>");
+
+ //consume
+ function consumeCallback(err,data) {
+ console.debug("==========================>consumeDoNotCallbackOne data : =======================>" +err+ JSON.stringify(data));
+ expect(typeof(data.request.actionButtons)).assertEqual('object')
+ for(let i=0; i" + data.request.actionButtons[i].title);
+ console.debug("======consumeCallback====sortings.hashCode:====>" + data.request.actionButtons[i].wantAgent);
+ console.debug("======consumeCallback====sortings.hashCode:====>" + data.request.actionButtons[i].icon);
+ }
+ }
+ //consume
+ function consumeCallbackTwo(err,data) {
+ console.debug("==========================>consumeDoNotCallbackTwo data : =======================>" +err+ JSON.stringify(data));
+ expect(typeof(data.request.actionButtons)).assertEqual('object')
+ for(let i=0; i" + data.request.actionButtons[i].title);
+ console.debug("======consumeDoNotCallbackTwo====sortings.hashCode:====>" + data.request.actionButtons[i].wantAgent);
+ console.debug("======consumeCallback====sortings.hashCode:====>" + data.request.actionButtons[i].icon);
+ }
+ }
+ //subscribe
+ function subscribeCallback(err) {
+ console.debug("==========================>subscribeDoNotCallback=======================>");
+ }
+ function publishCallback200(){
+ console.debug("==========================>publishCallback200=======================>");
+ }
+ /*
+ * @tc.number: ActsDoNotSubscriber_test_0100
+ * @tc.name: subscribe()
+ * @tc.desc: verify the function of subscribe
+ */
+ it('ActsActiveButton_test_0100', 0, async function (done) {
+ console.debug("===============ActsActiveButton_test_0100======begin====================>");
+
+ var subInfo ={
+ onConsume:consumeCallback
+ }
+ try{
+ await notify.subscribe(subInfo,subscribeCallback);
+ }catch(err) {
+ console.error('=ActsActiveButton_test_0100 订阅 activeButton err:'+err);
+ }
+ console.debug("===============ActsActiveButton_test_0100=======end3===================>");
+
+ var agentInfo = {
+ wants: [
+ {
+ deviceId: "deviceId",
+ bundleName: "com.example.test",
+ abilityName: "com.example.test.TriggerAbility",
+ action: "action1",
+ entities: ["entity1"],
+ type: "MIMETYPE",
+ uri: "key={true,true,false}",
+ parameters:
+ {
+ mykey0: 2222,
+ mykey1: [1, 2, 3],
+ mykey2: "[1, 2, 3]",
+ mykey3: "ssssssssssssssssssssssssss",
+ mykey4: [false, true, false],
+ mykey5: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"],
+ mykey6: true,
+ }
+ }
+ ],
+ operationType: OperationType.START_ABILITY,
+ requestCode: 0,
+ wantAgentFlags:[Flags.UPDATE_PRESENT_FLAG]
+ };
+ var wantAgentData = await wantagent.getWantAgent(agentInfo);
+ largeBuffer = new ArrayBuffer(64);
+ smallBuffer = new ArrayBuffer(32);
+ opts = {alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: {height: 2, width: 3}}
+ const promise_Large = image.createPixelMap(largeBuffer, opts);
+ promise_Large.then((data) => {
+ console.debug("==========================createPixelMap_promise_Large=======================>");
+ largeIcon = data;
+ console.debug("==========================createPixelMap_promise_Large largeIcon=======================>"+largeIcon);
+
+ const promise_Small = image.createPixelMap(smallBuffer, opts);
+ promise_Small.then((data) => {
+ console.debug("==========================createPixelMap_promise_Small=======================>");
+ smallIcon = data;
+ console.debug("==========================createPixelMap_promise_Small smallIcon=======================>"+smallIcon);
+
+ var notificationRequest = {
+ content:{
+ contentType: notify.ContentType.NOTIFICATION_CONTENT_LONG_TEXT,
+ longText : {
+ title: "test_title",
+ text: "test_text",
+ additionalText: "test_additionalText",
+ longText: "long_text",
+ briefText: "long_briefText",
+ expandedTitle: "long_expandedTitle"
+ },
+ },
+ id: 1,
+ slotType : notify.SlotType.SERVICE_INFORMATION,
+ actionButtons: [{title:"button", wantAgent:wantAgentData,icon:largeIcon},{title:"button", wantAgent:wantAgentData,icon:smallIcon}]
+ }
+ notify.publish(notificationRequest, publishCallback200);
+ console.info("===============ActsActiveButton_test_0100==========================>");
+ done();
+ setTimeout(function(){
+ console.debug("====>time out ActsActiveButton_test_0100====>");
+ }, time);
+ })
+ })
+})
+})
+
diff --git a/notification/ans_standard/publish_test/activeButton/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/test/List.test.js
new file mode 100644
index 0000000000000000000000000000000000000000..f5aafb6b1ff0d6cd5df4786fa4125999fa2f1dd1
--- /dev/null
+++ b/notification/ans_standard/publish_test/activeButton/entry/src/main/js/test/List.test.js
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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('./ActiveButton.js')
diff --git a/notification/ans_standard/publish_test/activeButton/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/activeButton/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5
Binary files /dev/null and b/notification/ans_standard/publish_test/activeButton/signature/openharmony_sx.p7b differ
diff --git a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/BUILD.gn b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/BUILD.gn
index 66dba9b9c7d1a6ba8d53f766c978f498dcba77c8..8c529148bb6aa77f74cf517e7e77cf33a234e55d 100644
--- a/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/BUILD.gn
+++ b/notification/ans_standard/publish_test/badgedisplayed/localcandisplay/BUILD.gn
@@ -10,20 +10,17 @@
# WITHOUT WARRANTIES 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("ActsAnsLocalCanDisplayTest") {
+ohos_js_hap_suite("ActsAnsLocalCanDisplayTest") {
hap_profile = "./entry/src/main/config.json"
- hap_name = "ActsAnsLocalCanDisplayTest"
- 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"
+ hap_name = "ActsAnsLocalCanDisplayTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/pages/index/index.hml
index 7a72ad67bddb5ffba592bf8ddfec3d8b83415302..50917a52f5704e51eb545f191f0f68bd376e0e40 100644
--- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/pages/index/index.hml
+++ b/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/default/pages/index/index.hml
@@ -1,5 +1,5 @@
- 通知许可设定--参数传空0928
+ 通知许可设定--参数传空1111
diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/test/BadgeDisplay.js
index 4c4d4115d1d2b367374e1d993fe1b95238556d26..7570d82a0352b9968d03eb696a912b26b84620dc 100644
--- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/test/BadgeDisplay.js
+++ b/notification/ans_standard/publish_test/enablenotification/enablenotificationfive/entry/src/main/js/test/BadgeDisplay.js
@@ -42,10 +42,11 @@ describe('ActsAnsEnableNotificationFiveTest', function () {
* @tc.desc: verify the function of enableNotification
*/
it('ActsEnableNotification_test_1000', 0, async function (done) {
- await notify.enableNotification(
+ var promise = notify.enableNotification(
{
bundle:"com.example.actsanslocalnotificationtest",
- },"").then(console.log("====>ActsEnableNotification_test_1000 success====>"))
+ },"")
+ expect(promise).assertEqual(undefined)
done();
setTimeout(function(){
console.debug("====>time out ActsEnableNotification_test_1000====>");
diff --git a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/test/BadgeDisplay.js
index f1cf0df3a982201b5e64d0e496118a0762272bb6..7a1980d54de3c6552ad5bb55854e982761a29fbd 100644
--- a/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/test/BadgeDisplay.js
+++ b/notification/ans_standard/publish_test/enablenotification/enablenotificationfour/entry/src/main/js/test/BadgeDisplay.js
@@ -42,10 +42,11 @@ describe('ActsAnsEnableNotificationFourTest', function () {
* @tc.desc: verify the function of enableNotification
*/
it('ActsEnableNotification_test_0800', 0, async function (done) {
- await notify.enableNotification(
+ var promise = notify.enableNotification(
{
bundle:"com.example.actsanslocalnotificationtest",
- },100).then(console.log("====>ActsEnableNotification_test_0800 success====>"))
+ },100)
+ expect(promise).assertEqual(undefined)
done();
setTimeout(function(){
console.debug("====>time out ActsEnableNotification_test_0800====>");
diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/test/BadgeDisplay.js
index 568dbd99176b95370a94120da3d785b529f12227..6f542005461f6de2c27987b4e1341d4dba40dc88 100644
--- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/test/BadgeDisplay.js
+++ b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfive/entry/src/main/js/test/BadgeDisplay.js
@@ -42,10 +42,11 @@ describe('ActsAnsEnableNotificationSetFiveTest', function () {
* @tc.desc: verify the function of enableNotification
*/
it('ActsEnableNotificationSet_test_1000', 0, async function (done) {
- await notify.enableNotification(
+ var promise = notify.enableNotification(
{
bundle:"com.example.actsanslocalnotificationtest",
- },"").then(console.log("====>ActsEnableNotificationSet_test_1000 success====>"))
+ },"")
+ expect(promise).assertEqual(undefined)
done();
setTimeout(function(){
console.debug("====>time out ActsEnableNotificationSet_test_1000====>");
diff --git a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/test/BadgeDisplay.js b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/test/BadgeDisplay.js
index 887bbb42e211824dc07349ae62ab4c28cada682c..6c30675418a0645d2d63f57ef0e3ef11797c7cf1 100644
--- a/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/test/BadgeDisplay.js
+++ b/notification/ans_standard/publish_test/enablenotificationset/enablenotificationfour/entry/src/main/js/test/BadgeDisplay.js
@@ -42,10 +42,11 @@ describe('ActsAnsEnableNotificationSetFourTest', function () {
* @tc.desc: verify the function of enableNotification
*/
it('ActsEnableNotificationSet_test_0800', 0, async function (done) {
- await notify.enableNotification(
+ var promise = notify.enableNotification(
{
bundle:"com.example.actsanslocalnotificationtest",
- },100).then(console.log("====>ActsEnableNotificationSet_test_0800 success====>"))
+ },100)
+ expect(promise).assertEqual(undefined)
done();
setTimeout(function(){
console.debug("====>time out ActsEnableNotificationSet_test_0800====>");
diff --git a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/Test.json b/notification/ans_standard/publish_test/getactive/getactivenormal/sub/Test.json
index 1e575e7e8688dffd0b671a86f0ec640a98371784..033380827174c51e440686645549042efc4d04f4 100644
--- a/notification/ans_standard/publish_test/getactive/getactivenormal/sub/Test.json
+++ b/notification/ans_standard/publish_test/getactive/getactivenormal/sub/Test.json
@@ -2,9 +2,9 @@
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
- "test-timeout": "180000",
+ "test-timeout": "21600000",
"package": "com.example.actsansactivesubscribertest",
- "shell-timeout": "60000"
+ "shell-timeout": "21600000"
},
"kits": [
{
diff --git a/notification/ans_standard/publish_test/getactive/getcancelactivenum/Test.json b/notification/ans_standard/publish_test/getactive/getcancelactivenum/Test.json
index 1a6a75964de4c615d208d9aa018b46ddebebc535..9136f33e0a49bc25f9626f7f5b98cd43d2215f51 100644
--- a/notification/ans_standard/publish_test/getactive/getcancelactivenum/Test.json
+++ b/notification/ans_standard/publish_test/getactive/getcancelactivenum/Test.json
@@ -2,9 +2,9 @@
"description": "Configuration for hjunit demo Tests",
"driver": {
"type": "JSUnitTest",
- "test-timeout": "180000",
+ "test-timeout": "21600000",
"package": "com.example.actsansgetcancelactivenumtest",
- "shell-timeout": "60000"
+ "shell-timeout": "21600000"
},
"kits": [
{
diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/test/WantAgent.test.js
index 67887422780a5b44dbb9d8223992774e01822833..c7011b02170da14a830b7115629199febe1d0aca 100644
--- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/test/WantAgent.test.js
+++ b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfoonepro/entry/src/main/js/test/WantAgent.test.js
@@ -147,17 +147,17 @@ describe('ActsAnsGetWantAgentInfoOneProTest', function () {
console.info(data);
expect(typeof(data)).assertEqual("object");
wantAgent.equal(WantAgent1,WantAgent2).then(
- (error,data) => {
+ (data) => {
console.info('----equalPromise1 success!----')
console.info(data);
- expect(typeof(data)).assertEqual("boolean");
+ expect(data).assertEqual(false);
}
)
wantAgent.equal(WantAgent1,WantAgent1).then(
- (error,data) => {
+ (data) => {
console.info('----equalPromise2 success!----')
console.info(data);
- expect(typeof(data)).assertEqual("boolean");
+ expect(data).assertEqual(true);
}
)
}
diff --git a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/test/WantAgent.test.js b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/test/WantAgent.test.js
index a62e817522c222c9cf88b02bb9f403e62ffcd886..dc2262df7f8cbb706b72e7a47bc673ea85df18f4 100644
--- a/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/test/WantAgent.test.js
+++ b/notification/ans_standard/publish_test/getwantagentinfo/getwantagentinfotwopro/entry/src/main/js/test/WantAgent.test.js
@@ -71,10 +71,10 @@ describe('ActsAnsGetWantAgentInfoTwoProTest', function () {
expect(typeof(data)).assertEqual("object");
}
done();
- }),
setTimeout(function(){
console.debug("====>time out ACTS_SetWantInfo_0700====>");
}, time)
+ }),
console.info('----getWantAgent1 after----');
})
@@ -121,17 +121,17 @@ describe('ActsAnsGetWantAgentInfoTwoProTest', function () {
console.info(data);
expect(typeof(data)).assertEqual("object");
wantAgent.equal(WantAgent1,WantAgent2).then(
- (error,data) => {
+ (data) => {
console.info('----equalPromise1 success!----')
console.info(data);
- expect(typeof(data)).assertEqual("boolean");
+ expect(data).assertEqual(false);
}
)
wantAgent.equal(WantAgent1,WantAgent1).then(
- (error,data) => {
+ (data) => {
console.info('----equalPromise2 success!----')
console.info(data);
- expect(typeof(data)).assertEqual("boolean");
+ expect(data).assertEqual(true);
}
)
}
@@ -141,10 +141,11 @@ describe('ActsAnsGetWantAgentInfoTwoProTest', function () {
expect(typeof(data)).assertEqual("object");
}
done();
- });
setTimeout(function(){
console.debug("====>time out ACTS_SetWantInfo_0800====>");
}, time)
+ });
+
console.info('----getWantAgent2 after----');
})
})
diff --git a/notification/ans_standard/publish_test/publishicontest/BUILD.gn b/notification/ans_standard/publish_test/publishicontest/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..f184f4e05abd7c08a46713fb1349ba3db60ea7c0
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishicontest/BUILD.gn
@@ -0,0 +1,31 @@
+# Copyright (c) 2021 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES 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("ActsAnsIconTest") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":hjs_demo_js_assets",
+ ":hjs_demo_resources",
+ ]
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "ActsAnsIconTest"
+}
+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/publishicontest/Test.json b/notification/ans_standard/publish_test/publishicontest/Test.json
new file mode 100755
index 0000000000000000000000000000000000000000..ddba18c7521d6781850000ebd8b01b13bee9b2f4
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishicontest/Test.json
@@ -0,0 +1,19 @@
+{
+ "description": "Configuration for hjunit demo Tests",
+ "driver": {
+ "type": "JSUnitTest",
+ "test-timeout": "120000",
+ "package": "com.example.actsansicontest",
+ "shell-timeout": "120000"
+ },
+ "kits": [
+ {
+ "test-file-name": [
+ "ActsAnsIconTest.hap"
+ ],
+ "type": "AppInstallKit",
+ "cleanup-apps": true
+ }
+ ]
+}
+
diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/config.json b/notification/ans_standard/publish_test/publishicontest/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..730f1958ad069e7eb57b45e126249a8fa0fa518e
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishicontest/entry/src/main/config.json
@@ -0,0 +1,61 @@
+{
+ "app": {
+ "bundleName": "com.example.actsansicontest",
+ "vendor": "example",
+ "version": {
+ "code": 1,
+ "name": "1.0"
+ },
+ "apiVersion": {
+ "compatible": 5,
+ "target": 5,
+ "releaseType": "Beta1"
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.example.actsansicontest",
+ "name": ".actsansicontest",
+ "deviceType": [
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry",
+ "moduleType": "entry"
+ },
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ],
+ "name": "com.example.actsansicontest.MainAbility",
+ "icon": "$media:icon",
+ "description": "$string:mainability_description",
+ "label": "$string:app_name",
+ "type": "page",
+ "isVisible": "true",
+ "launchType": "standard"
+ }
+ ],
+ "js": [
+ {
+ "pages": [
+ "pages/index/index"
+ ],
+ "name": "default",
+ "window": {
+ "designWidth": 720,
+ "autoDesignWidth": false
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/app.js
new file mode 100644
index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/app.js
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+export default {
+ onCreate() {
+ console.info('AceApplication onCreate');
+ },
+ onDestroy() {
+ console.info('AceApplication onDestroy');
+ }
+};
diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/i18n/en-US.json
new file mode 100644
index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/i18n/en-US.json
@@ -0,0 +1,6 @@
+{
+ "strings": {
+ "hello": "Hello",
+ "world": "World"
+ }
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/i18n/zh-CN.json
new file mode 100644
index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/i18n/zh-CN.json
@@ -0,0 +1,6 @@
+{
+ "strings": {
+ "hello": "您好",
+ "world": "世界"
+ }
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.css
new file mode 100644
index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.css
@@ -0,0 +1,9 @@
+.container {
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+}
+
+.title {
+ font-size: 100px;
+}
diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.hml
new file mode 100644
index 0000000000000000000000000000000000000000..60c117fb35d180619185b62bee24293514f4e896
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.hml
@@ -0,0 +1,5 @@
+
+
+ icon_pixcelMap
+
+
diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/default/pages/index/index.js
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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/publishicontest/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..30895093f1f793272b0638cbde300dd08dfcf1c0
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/resources/base/element/string.json
@@ -0,0 +1,12 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "Subscriber"
+ },
+ {
+ "name": "mainability_description",
+ "value": "JS_Phone_Empty Feature Ability"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/resources/base/media/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/resources/base/media/icon.png differ
diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/test/Icon.js b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/test/Icon.js
new file mode 100644
index 0000000000000000000000000000000000000000..5d873b21879d17cfa24aa248a0ca718c2c5d0f24
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/test/Icon.js
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import notify from '@ohos.notification'
+import image from '@ohos.multimedia.image'
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
+
+var largeBuffer
+var smallBuffer
+var opts
+var subInfo
+var largeIcon
+var smallIcon
+var time = 1000
+
+describe('ActsAnsIconTest', function () {
+ console.info("===========ActsAnsIconTest start====================>");
+
+ //consume
+ function consumeCallback(err,data) {
+ console.debug("==========================consumeCallback data : =======================>" +err+ JSON.stringify(data));
+ console.log("==========================consumeCallback smallIcon : =======================>"+JSON.stringify(data.request.smallIcon))
+ console.log("==========================consumeCallback largeIcon : =======================>"+JSON.stringify(data.request.largeIcon))
+ }
+
+ function subscribeCallback(err) {
+ console.info("==========================subscribeCallback start=======================>");
+ console.info("================subscribeCallback err : =======================>" + JSON.stringify(err));
+ console.info("==========================subscribeCallback end=======================>");
+ }
+
+ function publishCallback(err){
+ console.info("==========================publishCallback start=======================>");
+ console.info("================publishCallback err : =======================>" + JSON.stringify(err));
+ console.info("==========================publishCallback end=======================>");
+ }
+ /*
+ * @tc.number: ActsAnsIconTest_0100
+ * @tc.name: createPixelMap()
+ * @tc.desc: verify the function of subscribe
+ */
+ it('ActsAnsIconTest_0100', 0, async function (done) {
+ console.debug("===============ActsAnsIconTest_0100 start====================>");
+ subInfo ={
+ onConsume:consumeCallback,
+ }
+ await notify.subscribe(subInfo,subscribeCallback);
+
+ largeBuffer = new ArrayBuffer(64);
+ smallBuffer = new ArrayBuffer(32);
+ opts = {alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: {height: 2, width: 3}}
+ const promise_Large = image.createPixelMap(largeBuffer, opts);
+ promise_Large.then((data) => {
+ console.debug("==========================createPixelMap_promise_Large=======================>");
+ largeIcon = data;
+ console.debug("==========================createPixelMap_promise_Large largeIcon=======================>"+largeIcon);
+
+ const promise_Small = image.createPixelMap(smallBuffer, opts);
+ promise_Small.then((data) => {
+ console.debug("==========================createPixelMap_promise_Small=======================>");
+ smallIcon = data;
+ console.debug("==========================createPixelMap_promise_Small smallIcon=======================>"+smallIcon);
+ notify.publish({
+ id: 1,
+ content: {
+ contentType: notify.ContentType.NOTIFICATION_CONTENT_BASIC_TEXT,
+ normal: {
+ title: "test1_title",
+ text: "test1_text",
+ additionalText: "test1_additionalText"
+ },
+ },
+ slotType:notify.SlotType.SOCIAL_COMMUNICATION,
+ classification:"classification1",
+ sortingKey:"sortingKey1",
+ smallIcon:smallIcon,
+ largeIcon:largeIcon,
+ },publishCallback);
+ done();
+ setTimeout(function(){
+ console.debug("====>time out ActsAnsIconTest_0100====>");
+ }, time);
+ });
+ })
+ })
+});
+
+
diff --git a/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/test/List.test.js
new file mode 100644
index 0000000000000000000000000000000000000000..f6a0c80457aa4bd78d0066b7ca6c3dcbcd08b773
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishicontest/entry/src/main/js/test/List.test.js
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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('./Icon.js')
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/publishicontest/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/publishicontest/signature/openharmony_sx.p7b
new file mode 100755
index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5
Binary files /dev/null and b/notification/ans_standard/publish_test/publishicontest/signature/openharmony_sx.p7b differ
diff --git a/notification/ans_standard/publish_test/publishimage/.gitignore b/notification/ans_standard/publish_test/publishimage/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..82dc42bd41e44f0a17e007c62feabac9a3f35d72
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishimage/.gitignore
@@ -0,0 +1,15 @@
+*.iml
+.gradle
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+/entry/.preview
+.cxx
diff --git a/notification/ans_standard/publish_test/publishimage/.idea/.gitignore b/notification/ans_standard/publish_test/publishimage/.idea/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..eaf91e2ac647df635a09f01b8a2a254252aae8d7
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishimage/.idea/.gitignore
@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml
diff --git a/notification/ans_standard/publish_test/publishimage/.idea/compiler.xml b/notification/ans_standard/publish_test/publishimage/.idea/compiler.xml
new file mode 100644
index 0000000000000000000000000000000000000000..245a82c8279131bde0c8c09a1f1791c8b0312984
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishimage/.idea/compiler.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/publishimage/.idea/gradle.xml b/notification/ans_standard/publish_test/publishimage/.idea/gradle.xml
new file mode 100644
index 0000000000000000000000000000000000000000..c848cf9e3b543d3cc2089b7ea3ddf4ed6abda171
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishimage/.idea/gradle.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/publishimage/.idea/jarRepositories.xml b/notification/ans_standard/publish_test/publishimage/.idea/jarRepositories.xml
new file mode 100644
index 0000000000000000000000000000000000000000..aa00d771aa98b60cc8db06b5e24919c06b208cda
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishimage/.idea/jarRepositories.xml
@@ -0,0 +1,30 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/publishimage/.idea/misc.xml b/notification/ans_standard/publish_test/publishimage/.idea/misc.xml
new file mode 100644
index 0000000000000000000000000000000000000000..9883d055f8725da2d0f5c1cecc525b815e5dfcec
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishimage/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/publishimage/BUILD.gn b/notification/ans_standard/publish_test/publishimage/BUILD.gn
new file mode 100644
index 0000000000000000000000000000000000000000..8d55835e893f704b257b9dbd8b905fa01ee099db
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishimage/BUILD.gn
@@ -0,0 +1,30 @@
+# Copyright (c) 2021 Huawei Device Co., Ltd.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES 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("ActsAnsPublishImageTest") {
+ hap_profile = "./entry/src/main/config.json"
+ deps = [
+ ":hjs_demo_js_assets",
+ ":hjs_demo_resources",
+ ]
+ certificate_profile = "./signature/openharmony_sx.p7b"
+ hap_name = "ActsAnsPublishImageTest"
+}
+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/publishimage/Test.json b/notification/ans_standard/publish_test/publishimage/Test.json
new file mode 100644
index 0000000000000000000000000000000000000000..5fc73d5ee0b202555678c3e333cf6c8025e32ef0
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishimage/Test.json
@@ -0,0 +1,18 @@
+{
+ "description": "Configuration for hjunit demo Tests",
+ "driver": {
+ "type": "JSUnitTest",
+ "test-timeout": "60000",
+ "package": "com.example.actsanspublishimagetest",
+ "shell-timeout": "60000"
+ },
+ "kits": [
+ {
+ "test-file-name": [
+ "ActsAnsPublishImageTest"
+ ],
+ "type": "AppInstallKit",
+ "cleanup-apps": true
+ }
+ ]
+}
diff --git a/notification/ans_standard/publish_test/publishimage/entry/.gitignore b/notification/ans_standard/publish_test/publishimage/entry/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..3543521e9fef8e7322940a87c2b45dd0061b0f45
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishimage/entry/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/config.json b/notification/ans_standard/publish_test/publishimage/entry/src/main/config.json
new file mode 100644
index 0000000000000000000000000000000000000000..a0444515dc3d45f62f3f89ac642d5b49a1f1c16b
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishimage/entry/src/main/config.json
@@ -0,0 +1,62 @@
+{
+ "app": {
+ "bundleName": "com.example.actsanspublishimagetest",
+ "vendor": "example",
+ "version": {
+ "code": 1,
+ "name": "1.0"
+ },
+ "apiVersion": {
+ "compatible": 5,
+ "target": 5,
+ "releaseType": "Beta1"
+ }
+ },
+ "deviceConfig": {},
+ "module": {
+ "package": "com.example.actsanspublishimagetest",
+ "name": ".MyApplication",
+ "deviceType": [
+ "phone"
+ ],
+ "distro": {
+ "deliveryWithInstall": true,
+ "moduleName": "entry",
+ "moduleType": "entry"
+ },
+ "abilities": [
+ {
+ "skills": [
+ {
+ "entities": [
+ "entity.system.home"
+ ],
+ "actions": [
+ "action.system.home"
+ ]
+ }
+ ],
+ "name": "com.example.actsanspublishimagetest.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
+ }
+ }
+ ]
+ }
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/app.js b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/app.js
new file mode 100644
index 0000000000000000000000000000000000000000..2a68c1992145a976957d7dcdd69a7e9c2e8e9877
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/app.js
@@ -0,0 +1,22 @@
+/*
+ * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+export default {
+ onCreate() {
+ console.info('AceApplication onCreate');
+ },
+ onDestroy() {
+ console.info('AceApplication onDestroy');
+ }
+};
diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/i18n/en-US.json b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/i18n/en-US.json
new file mode 100644
index 0000000000000000000000000000000000000000..e63c70d978a3a53be988388c87182f81785e170c
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/i18n/en-US.json
@@ -0,0 +1,6 @@
+{
+ "strings": {
+ "hello": "Hello",
+ "world": "World"
+ }
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/i18n/zh-CN.json b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/i18n/zh-CN.json
new file mode 100644
index 0000000000000000000000000000000000000000..de6ee5748322f44942c1b003319d8e66c837675f
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/i18n/zh-CN.json
@@ -0,0 +1,6 @@
+{
+ "strings": {
+ "hello": "您好",
+ "world": "世界"
+ }
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.css b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.css
new file mode 100644
index 0000000000000000000000000000000000000000..6fda792753f2e15f22b529c7b90a82185b2770bf
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.css
@@ -0,0 +1,9 @@
+.container {
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+}
+
+.title {
+ font-size: 100px;
+}
diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.hml b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.hml
new file mode 100644
index 0000000000000000000000000000000000000000..2a6ecfe5b683148ed02ca6c2641962f5fc4b6343
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.hml
@@ -0,0 +1,5 @@
+
+
+ 发布图片通知
+
+
diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.js b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.js
new file mode 100644
index 0000000000000000000000000000000000000000..c3b6a96287aa8ad4c9bf0e44ccba5d69b68ae02c
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/default/pages/index/index.js
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES 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/publishimage/entry/src/main/js/resources/base/element/string.json b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/resources/base/element/string.json
new file mode 100644
index 0000000000000000000000000000000000000000..276723f49226e6b64f8dfb67e779c944bc3f58f1
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/resources/base/element/string.json
@@ -0,0 +1,12 @@
+{
+ "string": [
+ {
+ "name": "app_name",
+ "value": "Pubimage"
+ },
+ {
+ "name": "mainability_description",
+ "value": "JS_Phone_Empty Feature Ability"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/resources/base/media/icon.png b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/resources/base/media/icon.png
new file mode 100644
index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c
Binary files /dev/null and b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/resources/base/media/icon.png differ
diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/test/List.test.js b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/test/List.test.js
new file mode 100644
index 0000000000000000000000000000000000000000..0cb2aa49a0c3a2698fa90269b4e7b4bcfd02aa8b
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/test/List.test.js
@@ -0,0 +1,15 @@
+/*
+ * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT 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('./publishImage.js')
diff --git a/notification/ans_standard/publish_test/publishimage/entry/src/main/js/test/publishImage.js b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/test/publishImage.js
new file mode 100644
index 0000000000000000000000000000000000000000..038781c2c7fd5e7158ede59fe4c333df07303ef3
--- /dev/null
+++ b/notification/ans_standard/publish_test/publishimage/entry/src/main/js/test/publishImage.js
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import notify from '@ohos.notification'
+import image from '@ohos.multimedia.image'
+import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
+var imageBuffer
+var opts
+var pubimage
+var time = 1000
+describe('ActsAnsPublishImageTest', function () {
+ console.info("===========ActsDoNotSubscriberTest start====================>");
+
+ //consume
+ function consumeCallbackOne(err,data) {
+ console.debug("==========================>consumeDoNotCallback1 data : =======================>" +err+ JSON.stringify(data));
+ checkConsumeData(data)
+ }
+ function consumeCallbackTwo(err,data) {
+ console.debug("==========================>consumeDoNotCallback2 data : =======================>" +err+ JSON.stringify(data));
+ checkConsumeData(data)
+ }
+ function checkConsumeData(data){
+ expect(typeof(data)).assertEqual("object");
+ expect(data.id).assertEqual(1);
+ expect(data.content.contentType).assertEqual(notify.ContentType.NOTIFICATION_CONTENT_PICTURE);
+ expect(data.content.picture.title).assertEqual("image_title");
+ expect(data.content.picture.text).assertEqual("image_text");
+ expect(data.content.picture.additionalText).assertEqual("image_additionalText");
+ expect(data.content.picture.briefText).assertEqual("image_briefText");
+ expect(data.content.picture.expandedTitle).assertEqual("expandedTitle");
+// expect(typeof(data.content.picture.picture)).assertEqual();
+ expect(data.slotType).assertEqual(notify.SlotType.SOCIAL_COMMUNICATION);
+ expect(data.classification).assertEqual("classification1");
+ expect(data.sortingKey).assertEqual("sortingKey1");
+ }
+ //subscribeOn
+ function subscribeOnCallback(err) {
+ console.debug("==========================>subscribeDoNotOnCallback=======================>");
+ }
+ //subscribe
+ function subscribeCallback(err) {
+ console.debug("==========================>subscribeDoNotCallback=======================>");
+ }
+ function publishCallback001(){
+ console.log('ActsAnsPublishImageTest ACTS_Publish_0100 asyncCallback')
+ }
+ /*
+ * @tc.number: ActsPublishImage_test_0100
+ * @tc.name: subscribe()
+ * @tc.desc: verify the function of subscribe
+ */
+ it('ActsPublishImage_test_0100', 0, async function (done) {
+ console.debug("===============ActsDoNotSubscriber_test_0100======begin====================>");
+
+ var subInfo ={
+ onConsume:consumeCallbackOne,
+ onConnecte:subscribeOnCallback,
+ }
+ try {
+ await notify.subscribe(subInfo, subscribeCallback);
+ }
+ catch(err) {
+ console.error('=ActsDoNotSubscriber_test_0100 订阅 subscribeDoNotCallback err:'+err);
+ }
+ console.debug("===============ActsSubscriber_test_0100=======end3===================>");
+ done();
+ setTimeout(function(){
+ console.debug("====>time out ActsPublishImage_test_0100====>");
+ }, time);
+ })
+ /*
+ * @tc.number: ACTS_publishTest_0100
+ * @tc.name: publish()
+ * @tc.desc: verify the function of publish
+ */
+ it('ActsPublishImage_test_0200', 0,async function (done) {
+ imageBuffer = new ArrayBuffer(32);
+ opts = {alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: {height: 2, width: 3}}
+ const promise_Large = image.createPixelMap(imageBuffer, opts);
+ promise_Large.then((data) => {
+ console.debug("==========================createPixelMap_promise_Large=======================>");
+ pubimage = data;
+ console.debug("==========================createPixelMap_promise_Large largeIcon=======================>"+pubimage);
+ notify.publish({
+ id: 1,
+ content: {
+ contentType: notify.ContentType.NOTIFICATION_CONTENT_PICTURE,
+ picture: {
+ title: "image_title",
+ text: "image_text",
+ additionalText: "image_additionalText",
+ briefText:"image_brief",
+ expandedTitle:"expandedTitle",
+ picture:pubimage
+ },
+ },
+ slotType:notify.SlotType.SOCIAL_COMMUNICATION,
+ classification:"classification1",
+ sortingKey:"sortingKey1",
+ },publishCallback001);
+ done()
+ setTimeout(function(){
+ console.debug("====>time out ACTS_publishTest_0100====>");
+ }, time);
+ })
+ })
+})
+
diff --git a/notification/ans_standard/publish_test/publishimage/signature/openharmony_sx.p7b b/notification/ans_standard/publish_test/publishimage/signature/openharmony_sx.p7b
new file mode 100644
index 0000000000000000000000000000000000000000..9be1e98fa4c0c28ca997ed660112fa16b194f0f5
Binary files /dev/null and b/notification/ans_standard/publish_test/publishimage/signature/openharmony_sx.p7b differ
diff --git a/notification/ans_standard/publish_test/subscribe/publishfirst/BUILD.gn b/notification/ans_standard/publish_test/subscribe/publishfirst/BUILD.gn
index ed28c5922930e1dbcd73689afea11af69203d35f..9f205f33395723b30d707a5c54c49d74080fb87c 100644
--- a/notification/ans_standard/publish_test/subscribe/publishfirst/BUILD.gn
+++ b/notification/ans_standard/publish_test/subscribe/publishfirst/BUILD.gn
@@ -10,20 +10,17 @@
# WITHOUT WARRANTIES 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("ActsAnsPublishOneTest") {
+ohos_js_hap_suite("ActsAnsPublishOneTest") {
hap_profile = "./entry/src/main/config.json"
- hap_name = "ActsAnsPublishOneTest"
- 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"
+ hap_name = "ActsAnsPublishOneTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
diff --git a/notification/ans_standard/publish_test/subscribe/publishsecond/BUILD.gn b/notification/ans_standard/publish_test/subscribe/publishsecond/BUILD.gn
index f198bf413cda40508c77d6f56255e649f00885bb..3136d32fdbfd033a9efed67a68b70d61245122ea 100644
--- a/notification/ans_standard/publish_test/subscribe/publishsecond/BUILD.gn
+++ b/notification/ans_standard/publish_test/subscribe/publishsecond/BUILD.gn
@@ -10,20 +10,17 @@
# WITHOUT WARRANTIES 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("ActsAnsPublishTwoTest") {
+ohos_js_hap_suite("ActsAnsPublishTwoTest") {
hap_profile = "./entry/src/main/config.json"
- hap_name = "ActsAnsPublishTwoTest"
- 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"
+ hap_name = "ActsAnsPublishTwoTest"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
diff --git a/notification/ans_standard/publish_test/wantagent/test1/BUILD.gn b/notification/ans_standard/publish_test/wantagent/test1/BUILD.gn
index 66a1613d22418cfb4f244343fd6209362422f1c4..0c86c9de66dac91ec3c987eaaca137c7956afa42 100644
--- a/notification/ans_standard/publish_test/wantagent/test1/BUILD.gn
+++ b/notification/ans_standard/publish_test/wantagent/test1/BUILD.gn
@@ -9,21 +9,18 @@
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
-# limitations under the License.
+# limitations under the License.
+
import("//test/xts/tools/build/suite.gni")
-ohos_hap("test1") {
+ohos_js_hap_suite("test1") {
hap_profile = "./entry/src/main/config.json"
- hap_name = "test1"
- 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"
+ hap_name = "test1"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"
diff --git a/notification/ans_standard/publish_test/wantagent/test2/BUILD.gn b/notification/ans_standard/publish_test/wantagent/test2/BUILD.gn
index 2070fddace17d4ee86a7167c9f748771373b4f6a..0dadfa1b2f94410d55e0ed61acafbdac7f2b4a15 100644
--- a/notification/ans_standard/publish_test/wantagent/test2/BUILD.gn
+++ b/notification/ans_standard/publish_test/wantagent/test2/BUILD.gn
@@ -9,21 +9,18 @@
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
-# limitations under the License.
+# limitations under the License.
+
import("//test/xts/tools/build/suite.gni")
-ohos_hap("test2") {
+ohos_js_hap_suite("test2") {
hap_profile = "./entry/src/main/config.json"
- hap_name = "test2"
- 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"
+ hap_name = "test2"
}
ohos_js_assets("hjs_demo_js_assets") {
source_dir = "./entry/src/main/js/default"