Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
21f964f7
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
21f964f7
编写于
12月 20, 2021
作者:
Z
zhaoyuan17
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add session notification test case
Signed-off-by:
N
zhaoyuan17
<
zhaoyuan17@huawei.com
>
上级
6aec3310
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
400 addition
and
83 deletion
+400
-83
notification/ans_standard/publish_test/BUILD.gn
notification/ans_standard/publish_test/BUILD.gn
+1
-0
notification/ans_standard/publish_test/activebtn/activebutton/entry/src/main/js/test/ActsAnsPublishInput.js
...ctivebutton/entry/src/main/js/test/ActsAnsPublishInput.js
+20
-83
notification/ans_standard/publish_test/actsanspublishconversation/BUILD.gn
...standard/publish_test/actsanspublishconversation/BUILD.gn
+31
-0
notification/ans_standard/publish_test/actsanspublishconversation/Test.json
...tandard/publish_test/actsanspublishconversation/Test.json
+18
-0
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/config.json
...est/actsanspublishconversation/entry/src/main/config.json
+71
-0
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/js/default/app.js
...tsanspublishconversation/entry/src/main/js/default/app.js
+22
-0
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/js/default/i18n/en-US.json
...ishconversation/entry/src/main/js/default/i18n/en-US.json
+6
-0
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/js/default/i18n/zh-CN.json
...ishconversation/entry/src/main/js/default/i18n/zh-CN.json
+6
-0
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/js/default/pages/index/index.css
...versation/entry/src/main/js/default/pages/index/index.css
+9
-0
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/js/default/pages/index/index.hml
...versation/entry/src/main/js/default/pages/index/index.hml
+5
-0
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/js/default/pages/index/index.js
...nversation/entry/src/main/js/default/pages/index/index.js
+45
-0
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/js/resources/base/element/string.json
...tion/entry/src/main/js/resources/base/element/string.json
+12
-0
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/js/resources/base/media/icon.png
...versation/entry/src/main/js/resources/base/media/icon.png
+0
-0
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/js/test/ActsAnsPublishConversation.js
...tion/entry/src/main/js/test/ActsAnsPublishConversation.js
+139
-0
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/js/test/List.test.js
...nspublishconversation/entry/src/main/js/test/List.test.js
+15
-0
notification/ans_standard/publish_test/actsanspublishconversation/signature/openharmony_sx.p7b
...t/actsanspublishconversation/signature/openharmony_sx.p7b
+0
-0
未找到文件。
notification/ans_standard/publish_test/BUILD.gn
浏览文件 @
21f964f7
...
...
@@ -17,6 +17,7 @@ group("publish_test") {
if (is_standard_system) {
deps = [
"actsanspublishcontroltest:ActsAnsPublishControlTest",
"actsanspublishconversation:ActsAnsConversationTest",
"badgedisplayed:badgedisplayed",
"enablenotification:enablenotification",
"getactive:getactive",
...
...
notification/ans_standard/publish_test/activebtn/activebutton/entry/src/main/js/test/ActsAnsPublishInput.js
浏览文件 @
21f964f7
...
...
@@ -25,11 +25,26 @@ describe('ActsAnsPublishInput', function () {
console
.
info
(
"
=========Ans_PublishInput_0100 onConsume start==============>
"
);
console
.
info
(
"
=========Ans_PublishInput_0100 onConsume data:==============>
"
+
JSON
.
stringify
(
data
));
var
inputKey
=
data
.
request
.
actionButtons
[
0
].
userInput
.
inputKey
var
tag
=
data
.
request
.
actionButtons
[
0
].
userInput
.
tag
var
options
=
data
.
request
.
actionButtons
[
0
].
userInput
.
options
var
permitMimeTypes
=
data
.
request
.
actionButtons
[
0
].
userInput
.
permitMimeTypes
var
editType
=
data
.
request
.
actionButtons
[
0
].
userInput
.
editType
var
additionalData
=
data
.
request
.
actionButtons
[
0
].
userInput
.
additionalData
console
.
info
(
"
=========Ans_PublishInput_0100 onConsume inputKey================>
"
+
inputKey
);
console
.
info
(
"
=========Ans_PublishInput_0100 onConsume tag================>
"
+
tag
);
console
.
info
(
"
=========Ans_PublishInput_0100 onConsume options================>
"
+
options
);
console
.
info
(
"
=========Ans_PublishInput_0100 onConsume permitMimeTypes================>
"
+
permitMimeTypes
);
console
.
info
(
"
=========Ans_PublishInput_0100 onConsume editType================>
"
+
editType
);
expect
(
inputKey
).
assertEqual
(
"
inputKey_0100
"
);
expect
(
tag
).
assertEqual
(
"
tag_0100
"
);
expect
(
options
).
assertEqual
(
"
options_0100
"
);
expect
(
permitMimeTypes
).
assertEqual
(
"
permitMimeTypes_0100
"
);
expect
(
editType
).
assertEqual
(
1
);
expect
(
additionalData
.
key0100
).
assertEqual
(
"
0100
"
);
console
.
info
(
"
=========Ans_PublishInput_0100 onConsume end================>
"
);
}
/*
* @tc.number: Ans_PublishInput_0100
* @tc.name: publish(request: NotificationRequest): Promise<void>;
...
...
@@ -89,6 +104,11 @@ describe('ActsAnsPublishInput', function () {
wantAgent
:
wantAgentData
,
userInput
:
{
inputKey
:
"
inputKey_0100
"
,
tag
:
"
tag_0100
"
,
options
:
[
"
options_0100
"
],
permitMimeTypes
:[
"
permitMimeTypes_0100
"
],
editType
:
1
,
additionalData
:{
"
key0100
"
:
"
0100
"
}
}
}]
}
...
...
@@ -103,87 +123,4 @@ describe('ActsAnsPublishInput', function () {
done
();
}),
timeout
);
})
function
onConsumeTwo
(
data
)
{
console
.
info
(
"
=========Ans_PublishInput_0200 onConsume start==============>
"
);
console
.
info
(
"
=========Ans_PublishInput_0200 onConsume data:==============>
"
+
JSON
.
stringify
(
data
));
var
inputKey
=
data
.
request
.
actionButtons
[
0
].
userInput
.
inputKey
console
.
info
(
"
=========Ans_PublishInput_0200 onConsume inputKey================>
"
+
inputKey
);
expect
(
inputKey
).
assertEqual
(
"
"
);
console
.
info
(
"
=========Ans_PublishInput_0200 onConsume end================>
"
);
}
/*
* @tc.number: Ans_PublishInput_0200
* @tc.name: publish(request: NotificationRequest): Promise<void>;
* @tc.desc: Verify that the inputKey information can be received in the received notification.(inputKey = " ")
*/
it
(
'
Ans_PublishInput_0200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
==================Ans_PublishInput_0200 start==================>
"
);
var
subscriber
=
{
onConsume
:
onConsumeTwo
,
}
var
agentInfo
=
{
wants
:
[
{
deviceId
:
"
deviceId
"
,
bundleName
:
"
com.example.actsanspublishinput
"
,
abilityName
:
"
com.example.actsanspublishinput.MainAbility
"
,
action
:
"
action1
"
,
entities
:
[
"
entity1
"
],
type
:
"
MIMETYPE
"
,
uri
:
"
key={true,true,false}
"
,
parameters
:
{
mykey0
:
2222
,
mykey1
:
[
1
,
2
,
3
],
mykey2
:
"
[1, 2, 3]
"
,
mykey3
:
"
ssssssssssssssssssssssssss
"
,
mykey4
:
[
false
,
true
,
false
],
mykey5
:
[
"
qqqqq
"
,
"
wwwwww
"
,
"
aaaaaaaaaaaaaaaaa
"
],
mykey6
:
true
,
}
}
],
operationType
:
OperationType
.
START_ABILITY
,
requestCode
:
0
,
wantAgentFlags
:[
WantAgentFlags
.
UPDATE_PRESENT_FLAG
]
};
var
wantAgentData
=
await
wantagent
.
getWantAgent
(
agentInfo
);
console
.
info
(
"
===========Ans_PublishInput_0200 getWantAgent promise======>
"
);
var
notificationRequest
=
{
content
:{
contentType
:
notify
.
ContentType
.
NOTIFICATION_CONTENT_LONG_TEXT
,
longText
:
{
title
:
"
test_title
"
,
text
:
"
test_text
"
,
additionalText
:
"
test_additionalText
"
,
longText
:
"
long_text
"
,
briefText
:
"
long_briefText
"
,
expandedTitle
:
"
long_expandedTitle
"
},
},
id
:
2
,
slotType
:
notify
.
SlotType
.
SERVICE_INFORMATION
,
wantAgent
:
wantAgentData
,
actionButtons
:
[
{
title
:
"
button2
"
,
wantAgent
:
wantAgentData
,
userInput
:
{
inputKey
:
"
"
,
}
}]
}
await
notify
.
subscribe
(
subscriber
);
console
.
info
(
"
===========Ans_PublishInput_0200 subscribe promise======>
"
);
await
notify
.
publish
(
notificationRequest
);
console
.
info
(
"
===========Ans_PublishInput_0200 publish promise========>
"
);
setTimeout
((
async
function
(){
console
.
info
(
"
======Ans_PublishInput_0200 setTimeout==============>
"
);
notify
.
unsubscribe
(
subscriber
);
console
.
info
(
"
======Ans_PublishInput_0200 setTimeout unsubscribe==>
"
);
done
();
}),
timeout
);
})
})
\ No newline at end of file
notification/ans_standard/publish_test/actsanspublishconversation/BUILD.gn
0 → 100644
浏览文件 @
21f964f7
# Copyright (c) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsAnsConversationTest") {
hap_profile = "./entry/src/main/config.json"
deps = [
":hjs_demo_js_assets",
":hjs_demo_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsAnsConversationTest"
}
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"
}
notification/ans_standard/publish_test/actsanspublishconversation/Test.json
0 → 100644
浏览文件 @
21f964f7
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"JSUnitTest"
,
"test-timeout"
:
"60000"
,
"package"
:
"com.example.actsansconversationtest"
,
"shell-timeout"
:
"60000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsAnsConversationTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/config.json
0 → 100644
浏览文件 @
21f964f7
{
"app"
:
{
"bundleName"
:
"com.example.actsansconversationtest"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
5
,
"releaseType"
:
"Beta1"
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"com.example.actsansconversationtest"
,
"name"
:
".actsansconversationtest"
,
"deviceType"
:
[
"phone"
],
"reqPermissions"
:
[{
"name"
:
"ohos.permission.NOTIFICATION_CONTROLLER"
,
"reason"
:
"install bundle"
,
"usedScene"
:
{
"ability"
:
[
"KitFramework"
],
"when"
:
"always"
}
}],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"name"
:
"com.example.actsansconversationtest.MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:mainability_description"
,
"label"
:
"$string:app_name"
,
"type"
:
"page"
,
"launchType"
:
"standard"
,
"visible"
:
true
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
\ No newline at end of file
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/js/default/app.js
0 → 100644
浏览文件 @
21f964f7
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT 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
'
);
}
};
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/js/default/i18n/en-US.json
0 → 100644
浏览文件 @
21f964f7
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/js/default/i18n/zh-CN.json
0 → 100644
浏览文件 @
21f964f7
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/js/default/pages/index/index.css
0 → 100644
浏览文件 @
21f964f7
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/js/default/pages/index/index.hml
0 → 100644
浏览文件 @
21f964f7
<div class="container">
<text class="title">
publishConversation
</text>
</div>
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/js/default/pages/index/index.js
0 → 100644
浏览文件 @
21f964f7
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
file
from
'
@system.file
'
import
app
from
'
@system.app
'
import
device
from
'
@system.device
'
import
router
from
'
@system.router
'
import
{
Core
,
ExpectExtend
,
ReportExtend
}
from
'
deccjsunit/index
'
export
default
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
},
onShow
()
{
console
.
info
(
'
onShow finish
'
)
const
core
=
Core
.
getInstance
()
const
expectExtend
=
new
ExpectExtend
({
'
id
'
:
'
extend
'
})
const
reportExtend
=
new
ReportExtend
(
file
)
core
.
addService
(
'
expect
'
,
expectExtend
)
core
.
addService
(
'
report
'
,
reportExtend
)
core
.
init
()
const
configService
=
core
.
getDefaultService
(
'
config
'
)
configService
.
setConfig
(
this
)
require
(
'
../../../test/List.test
'
)
core
.
execute
()
}
}
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/js/resources/base/element/string.json
0 → 100644
浏览文件 @
21f964f7
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"conversation"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
}
]
}
\ No newline at end of file
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/js/resources/base/media/icon.png
0 → 100644
浏览文件 @
21f964f7
6.6 KB
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/js/test/ActsAnsPublishConversation.js
0 → 100644
浏览文件 @
21f964f7
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES 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
timeout
=
500
;
describe
(
'
ActsAnsConversationTest
'
,
function
()
{
console
.
info
(
"
===========ActsAnsConversationTest start====================>
"
);
function
onConsumeOne
(
data
)
{
console
.
info
(
"
=========Ans_Conversation_0100 onConsume start==============>
"
);
console
.
info
(
"
=========Ans_Conversation_0100 onConsume data:==============>
"
+
JSON
.
stringify
(
data
));
expect
(
data
.
request
.
content
.
contentType
).
assertEqual
(
notify
.
ContentType
.
NOTIFICATION_CONTENT_CONVERSATION
);
expect
(
data
.
request
.
content
.
conversation
.
title
).
assertEqual
(
"
test_title
"
);
expect
(
data
.
request
.
content
.
conversation
.
text
).
assertEqual
(
"
test_text
"
);
expect
(
data
.
request
.
content
.
conversation
.
additionalText
).
assertEqual
(
"
test_additionalText
"
);
expect
(
data
.
request
.
content
.
conversation
.
conversationTitle
).
assertEqual
(
"
conversationTitle_0100
"
);
expect
(
data
.
request
.
content
.
conversation
.
conversationGroup
).
assertEqual
(
true
);
expect
(
data
.
request
.
content
.
conversation
.
messages
[
0
].
text
).
assertEqual
(
"
conversation_text_1
"
);
expect
(
data
.
request
.
content
.
conversation
.
messages
[
0
].
timestamp
).
assertEqual
(
1
);
expect
(
data
.
request
.
content
.
conversation
.
messages
[
0
].
sender
.
name
).
assertEqual
(
"
sender_name_1
"
);
expect
(
data
.
request
.
content
.
conversation
.
messages
[
0
].
sender
.
key
).
assertEqual
(
"
sender_key_1
"
);
expect
(
data
.
request
.
content
.
conversation
.
messages
[
0
].
sender
.
uri
).
assertEqual
(
"
sender_uri_1
"
);
expect
(
data
.
request
.
content
.
conversation
.
messages
[
0
].
sender
.
isMachine
).
assertEqual
(
true
);
expect
(
data
.
request
.
content
.
conversation
.
messages
[
0
].
sender
.
isUserImportant
).
assertEqual
(
true
);
expect
(
data
.
request
.
content
.
conversation
.
messages
[
0
].
mimeType
).
assertEqual
(
"
conversation_mimeType_1
"
);
expect
(
data
.
request
.
content
.
conversation
.
messages
[
0
].
uri
).
assertEqual
(
"
conversation_uri_1
"
);
expect
(
data
.
request
.
content
.
conversation
.
messages
[
1
].
text
).
assertEqual
(
"
conversation_text_2
"
);
expect
(
data
.
request
.
content
.
conversation
.
messages
[
1
].
timestamp
).
assertEqual
(
1
);
expect
(
data
.
request
.
content
.
conversation
.
messages
[
1
].
sender
.
name
).
assertEqual
(
"
sender_name_2
"
);
expect
(
data
.
request
.
content
.
conversation
.
messages
[
1
].
sender
.
key
).
assertEqual
(
"
sender_key_2
"
);
expect
(
data
.
request
.
content
.
conversation
.
messages
[
1
].
sender
.
uri
).
assertEqual
(
"
sender_uri_2
"
);
expect
(
data
.
request
.
content
.
conversation
.
messages
[
1
].
sender
.
isMachine
).
assertEqual
(
true
);
expect
(
data
.
request
.
content
.
conversation
.
messages
[
1
].
sender
.
isUserImportant
).
assertEqual
(
true
);
expect
(
data
.
request
.
content
.
conversation
.
messages
[
1
].
mimeType
).
assertEqual
(
"
conversation_mimeType_2
"
);
expect
(
data
.
request
.
content
.
conversation
.
messages
[
1
].
uri
).
assertEqual
(
"
conversation_uri_2
"
);
console
.
info
(
"
=========Ans_Conversation_0100 onConsume end================>
"
);
}
/*
* @tc.number: Ans_Conversation_0100
* @tc.name: publish(request: NotificationRequest): Promise<void>;
* @tc.desc: Verify that the conversation information can be received in the received notification.
*/
it
(
'
Ans_Conversation_0100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
"
==================Ans_Conversation_0100 start==================>
"
);
var
bufferA
=
new
ArrayBuffer
(
4
*
2
*
25
);
var
optionA
=
{
alphaType
:
0
,
editable
:
true
,
pixelFormat
:
4
,
scaleMode
:
1
,
size
:
{
height
:
25
,
width
:
2
}}
var
conversationIconA
=
await
image
.
createPixelMap
(
bufferA
,
optionA
);
console
.
info
(
"
===========Ans_Conversation_0100 createPixelMap A promise======>
"
);
var
bufferB
=
new
ArrayBuffer
(
4
*
2
*
24
);
var
optionB
=
{
alphaType
:
0
,
editable
:
true
,
pixelFormat
:
4
,
scaleMode
:
1
,
size
:
{
height
:
24
,
width
:
2
}}
var
conversationIconB
=
await
image
.
createPixelMap
(
bufferB
,
optionB
);
console
.
info
(
"
===========Ans_Conversation_0100 createPixelMap B promise======>
"
);
var
bufferC
=
new
ArrayBuffer
(
4
*
2
*
23
);
var
optionC
=
{
alphaType
:
0
,
editable
:
true
,
pixelFormat
:
4
,
scaleMode
:
1
,
size
:
{
height
:
23
,
width
:
2
}}
var
conversationIconC
=
await
image
.
createPixelMap
(
bufferC
,
optionC
);
console
.
info
(
"
===========Ans_Conversation_0100 createPixelMap C promise======>
"
);
var
subscriber
=
{
onConsume
:
onConsumeOne
,
}
await
notify
.
subscribe
(
subscriber
);
console
.
info
(
"
==================Ans_Conversation_0100 subscribe promise==================>
"
);
var
notificationRequest
=
{
content
:{
contentType
:
notify
.
ContentType
.
NOTIFICATION_CONTENT_CONVERSATION
,
conversation
:
{
title
:
"
test_title
"
,
text
:
"
test_text
"
,
additionalText
:
"
test_additionalText
"
,
user
:{
name
:
"
user_name
"
,
key
:
"
user_key
"
,
uri
:
"
user_uri
"
,
isMachine
:
true
,
isUserImportant
:
true
,
icon
:
conversationIconA
},
messages
:[
{
text
:
"
conversation_text_1
"
,
timestamp
:
1
,
sender
:{
name
:
"
sender_name_1
"
,
key
:
"
sender_key_1
"
,
uri
:
"
sender_uri_1
"
,
isMachine
:
true
,
isUserImportant
:
true
,
icon
:
conversationIconB
},
mimeType
:
"
conversation_mimeType_1
"
,
uri
:
"
conversation_uri_1
"
,
},
{
text
:
"
conversation_text_2
"
,
timestamp
:
1
,
sender
:{
name
:
"
sender_name_2
"
,
key
:
"
sender_key_2
"
,
uri
:
"
sender_uri_2
"
,
isMachine
:
true
,
isUserImportant
:
true
,
icon
:
conversationIconC
},
mimeType
:
"
conversation_mimeType_2
"
,
uri
:
"
conversation_uri_2
"
,
},],
conversationGroup
:
true
,
conversationTitle
:
"
conversationTitle_0100
"
,
},
},
}
await
notify
.
publish
(
notificationRequest
);
console
.
info
(
"
===========Ans_Conversation_0100 publish promise========>
"
);
setTimeout
((
async
function
(){
console
.
info
(
"
======Ans_Conversation_0100 setTimeout==============>
"
);
notify
.
unsubscribe
(
subscriber
);
console
.
info
(
"
======Ans_Conversation_0100 setTimeout unsubscribe==>
"
);
done
();
}),
timeout
);
})
})
\ No newline at end of file
notification/ans_standard/publish_test/actsanspublishconversation/entry/src/main/js/test/List.test.js
0 → 100644
浏览文件 @
21f964f7
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT 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
(
'
./ActsAnsPublishConversation.js
'
)
notification/ans_standard/publish_test/actsanspublishconversation/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
21f964f7
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录