Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
733ada9e
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
733ada9e
编写于
5月 22, 2023
作者:
O
openharmony_ci
提交者:
Gitee
5月 22, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8644 add notification XTS test
Merge pull request !8644 from liuyanzhi2020/liu0512
上级
f24f8a7c
26f45ffb
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
734 addition
and
5 deletion
+734
-5
notification/ans_standard/actsNotificationDistributedTest/src/main/js/test/ActsNotificationDistributedTest.js
...dTest/src/main/js/test/ActsNotificationDistributedTest.js
+20
-1
notification/ans_standard/actsNotificationDistributedTest/src/main/js/test/ActsNotificationManagerDistributedTest.js
...rc/main/js/test/ActsNotificationManagerDistributedTest.js
+19
-0
notification/ans_standard/actsNotificationManagerSlotTest/src/main/js/test/ActsNotificationManagerSlotTest.js
...tTest/src/main/js/test/ActsNotificationManagerSlotTest.js
+95
-0
notification/ans_standard/actsNotificationPublishTest/src/main/js/test/ActsNotificationManagerPublishTest.js
...st/src/main/js/test/ActsNotificationManagerPublishTest.js
+217
-0
notification/ans_standard/actsNotificationPublishTest/src/main/js/test/ActsNotificationPublishTest.js
...blishTest/src/main/js/test/ActsNotificationPublishTest.js
+287
-3
notification/ans_standard/actsNotificationSlotTest/src/main/js/test/ActsNotificationSlotTest.js
...tionSlotTest/src/main/js/test/ActsNotificationSlotTest.js
+96
-1
未找到文件。
notification/ans_standard/actsNotificationDistributedTest/src/main/js/test/ActsNotificationDistributedTest.js
浏览文件 @
733ada9e
...
...
@@ -60,6 +60,25 @@ export default function ActsNotificationDistributedTest() {
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_IS_DISTRIBUTED_ENABLED_TEST_0200 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_IS_DISTRIBUTED_ENABLED_TEST_0300
* @tc.name : function isDistributedEnabled(undefined): Promise<boolean>
* @tc.desc : Obtains whether the device supports distributed notification
*/
it
(
'
SUB_NOTIFICATION_ANS_IS_DISTRIBUTED_ENABLED_TEST_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_IS_DISTRIBUTED_ENABLED_TEST_0300 START`
)
notification
.
isDistributedEnabled
(
undefined
).
then
((
data
)
=>
{
console
.
info
(
`
${
TAG
}
isDistributedEnabled Promise success:
${
data
}
`
)
expect
(
data
).
assertFalse
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
isDistributedEnabled Promise err:
${
err
.
code
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_IS_DISTRIBUTED_ENABLED_TEST_0300 END`
)
})
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_IS_DISTRIBUTED_ENABLED_TEST END
'
)
})
...
...
notification/ans_standard/actsNotificationDistributedTest/src/main/js/test/ActsNotificationManagerDistributedTest.js
浏览文件 @
733ada9e
...
...
@@ -66,6 +66,25 @@ export default function ActsNotificationManagerDistributedTest() {
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_IS_DISTRIBUTED_ENABLED_TEST_0200 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_IS_DISTRIBUTED_ENABLED_TEST_0300
* @tc.name : function isDistributedEnabled(undefined): Promise<boolean>
* @tc.desc : Obtains whether the device supports distributed notification
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_IS_DISTRIBUTED_ENABLED_TEST_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_IS_DISTRIBUTED_ENABLED_TEST_0300 START`
)
notificationManager
.
isDistributedEnabled
(
undefined
).
then
((
data
)
=>
{
console
.
info
(
`
${
TAG
}
isDistributedEnabled Promise success:
${
data
}
`
)
expect
(
data
).
assertFalse
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
isDistributedEnabled Promise err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_IS_DISTRIBUTED_ENABLED_TEST_0300 END`
)
})
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_IS_DISTRIBUTED_ENABLED_TEST END
'
)
})
...
...
notification/ans_standard/actsNotificationManagerSlotTest/src/main/js/test/ActsNotificationManagerSlotTest.js
浏览文件 @
733ada9e
...
...
@@ -1512,6 +1512,101 @@ export default function ActsNotificationManagerSlotTest() {
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_4800 END
'
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_4900
* @tc.name : addSlot(type: SlotType, undefined): Promise<void>
* @tc.desc : NotificationSlot for other purposes
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_4900
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_4900 START
'
)
await
notificationManager
.
addSlot
(
notificationManager
.
SlotType
.
OTHER_TYPES
,
undefined
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
addSlot_49 Promise success`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
addSlot_49 Promise errCode:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_4900 END
'
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_5000
* @tc.name : getSlot(SlotType: SlotType, undefined): Promise<NotificationSlot>
* @tc.desc : Get the UNKNOWN_TYPE type slot without add
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_5000
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_5000 START
'
)
await
notificationManager
.
getSlot
(
notificationManager
.
SlotType
.
UNKNOWN_TYPE
,
undefined
).
then
((
NotificationSlot
)
=>
{
console
.
info
(
`
${
TAG
}
getSlot_50 Promise success:
${
NotificationSlot
}
`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
getSlot_50 Promise errCode:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_5000 END
'
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_5100
* @tc.name : getSlots(undefined): Promise<Array<NotificationSlot>>
* @tc.desc : Get all NotificationSlot without add
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_5100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_5100 START
'
)
await
notificationManager
.
getSlots
(
undefined
).
then
((
NotificationSlot
)
=>
{
console
.
info
(
`
${
TAG
}
getSlots_51 Promise success:
${
NotificationSlot
}
`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
getSlots_51 Promise err:
${
err
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_5100 END
'
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_5200
* @tc.name : removeSlot(SlotType: SlotType, undefined): Promise<void>
* @tc.desc : Remove the UNKNOWN_TYPE type slot without add
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_5200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_5200 START
'
)
await
notificationManager
.
removeSlot
(
notificationManager
.
SlotType
.
UNKNOWN_TYPE
,
undefined
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
removeSlot_52 success`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
removeSlot_52 errCode:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_5200 END
'
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_5300
* @tc.name : removeAllSlots(undefined): Promise<void>
* @tc.desc : Removes all NotificationSlot
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_5300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_5300 START
'
)
await
notificationManager
.
removeAllSlots
(
undefined
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
removeAllSlots_53 Promise success`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
removeAllSlots_53 Promise err:
${
err
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_MANAGER_SLOT_TEST_5300 END
'
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_SLOT_ENUM_TEST_0100
* @tc.name : Describes NotificationSlot types
...
...
notification/ans_standard/actsNotificationPublishTest/src/main/js/test/ActsNotificationManagerPublishTest.js
浏览文件 @
733ada9e
...
...
@@ -102,6 +102,68 @@ export default function ActsNotificationManagerPublishTest() {
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0300 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0400
* @tc.name : function cancel(id: number, undefined): Promise<void>
* @tc.desc : Cancels a notification with the specified label and ID
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0400 START`
)
let
id
=
1
await
notificationManager
.
cancel
(
id
,
undefined
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
cancel Promise success`
)
expect
(
false
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
cancel Promise err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
true
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0400 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0500
* @tc.name : function cancel(id: number, num: number): Promise<void>
* @tc.desc : Cancels a notification with the specified label and ID
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0500
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0500 START`
)
let
id
=
1
let
num
=
2
await
notificationManager
.
cancel
(
id
,
num
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
cancel Promise success`
)
expect
(
false
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
cancel Promise err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
true
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0500 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0600
* @tc.name : function cancel(id: number, label: string, undefined): Promise<void>
* @tc.desc : Cancels a notification with the specified label and ID
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0600
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0600 START`
)
let
id
=
1
let
label
=
"
label
"
await
notificationManager
.
cancel
(
id
,
label
,
undefined
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
cancel Promise success`
)
expect
(
false
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
cancel Promise err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
true
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_TEST_0600 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_CANCELAll_TEST_0100
* @tc.name : function cancelAll(callback: AsyncCallback<void>): void
...
...
@@ -148,6 +210,25 @@ export default function ActsNotificationManagerPublishTest() {
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCELAll_TEST_0200 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_CANCELAll_TEST_0300
* @tc.name : function cancelAll(undefined): Promise<void>
* @tc.desc : Cancels all notifications of the current application
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_CANCELAll_TEST_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCELAll_TEST_0300 START`
)
await
notificationManager
.
cancelAll
(
undefined
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
cancelAll Promise success`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
cancelAll Promise err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCELAll_TEST_0300 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_CANCEL_GROUP_TEST_0100
* @tc.name : function cancelGroup(groupName: string, callback: AsyncCallback<void>): void
...
...
@@ -196,6 +277,46 @@ export default function ActsNotificationManagerPublishTest() {
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_GROUP_TEST_0200 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_CANCEL_GROUP_TEST_0300
* @tc.name : function cancelGroup(num: number): Promise<void>
* @tc.desc : Cancel the notification of a specified group for this application
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_GROUP_TEST_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_GROUP_TEST_0300 START`
)
let
num
=
1
await
notificationManager
.
cancelGroup
(
num
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
cancelGroup Promise success`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
cancelGroup Promise err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_GROUP_TEST_0300 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_CANCEL_GROUP_TEST_0400
* @tc.name : function cancelGroup(groupName: string, undefined): Promise<void>
* @tc.desc : Cancel the notification of a specified group for this application
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_GROUP_TEST_0400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_GROUP_TEST_0400 START`
)
let
groupName
=
"
groupName
"
await
notificationManager
.
cancelGroup
(
groupName
,
undefined
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
cancelGroup Promise success`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
cancelGroup Promise err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_CANCEL_GROUP_TEST_0400 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_REQUEST_ENABLE_TEST_0100
* @tc.name : function requestEnableNotification(callback: AsyncCallback<void>): void
...
...
@@ -242,6 +363,25 @@ export default function ActsNotificationManagerPublishTest() {
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_REQUEST_ENABLE_TEST_0200 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_REQUEST_ENABLE_TEST_0300
* @tc.name : function requestEnableNotification(undefined): Promise<void>
* @tc.desc : OperationType.UNKNOWN_TYPE & WantAgentFlags.ONE_TIME_FLAG
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_REQUEST_ENABLE_TEST_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_REQUEST_ENABLE_TEST_0300 START`
)
await
notificationManager
.
requestEnableNotification
(
undefined
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
requestEnableNotification Promise success`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
requestEnableNotification Promise err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_REQUEST_ENABLE_TEST_0300 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0100
* @tc.name : function getActiveNotificationCount(callback: AsyncCallback<number>): void
...
...
@@ -334,6 +474,43 @@ export default function ActsNotificationManagerPublishTest() {
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0400 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0500
* @tc.name : function getActiveNotificationCount(undefined): Promise<number>
* @tc.desc : Obtains the number of all active notifications
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0500
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0500 START`
)
await
notificationManager
.
getActiveNotificationCount
(
undefined
).
then
((
data
)
=>
{
console
.
info
(
`
${
TAG
}
getActiveNotificationCount Promise success :
${
JSON
.
stringify
(
data
)}
`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
getActiveNotificationCount Promise err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0500 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0600
* @tc.name : function getActiveNotifications(undefined): Promise<Array<NotificationRequest>>
* @tc.desc : Obtains an array of active notifications
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0600
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0600 START`
)
await
notificationManager
.
getActiveNotifications
(
undefined
).
then
((
data
)
=>
{
console
.
info
(
`
${
TAG
}
getActiveNotifications Promise success :
${
JSON
.
stringify
(
data
)}
`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
getActiveNotifications Promise err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_COUNT_TEST_0600 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_SUPPORT_TEST_0100
...
...
@@ -383,6 +560,46 @@ export default function ActsNotificationManagerPublishTest() {
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_SUPPORT_TEST_0200 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_SUPPORT_TEST_0300
* @tc.name : function isSupportTemplate(num: number): Promise<boolean>
* @tc.desc : Obtains whether the template is supported by the system
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_SUPPORT_TEST_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_SUPPORT_TEST_0300 START`
)
let
num
=
1
await
notificationManager
.
isSupportTemplate
(
num
).
then
((
data
)
=>
{
console
.
info
(
`
${
TAG
}
isSupportTemplate Promise success :
${
JSON
.
stringify
(
data
)}
`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
isSupportTemplate Promise err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_SUPPORT_TEST_0300 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_MANAGER_SUPPORT_TEST_0400
* @tc.name : function isSupportTemplate(templateName: string, undefined): Promise<boolean>
* @tc.desc : Obtains whether the template is supported by the system
*/
it
(
'
SUB_NOTIFICATION_ANS_MANAGER_SUPPORT_TEST_0400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_SUPPORT_TEST_0400 START`
)
let
templateName
=
'
test_templateName
'
await
notificationManager
.
isSupportTemplate
(
templateName
,
undefined
).
then
((
data
)
=>
{
console
.
info
(
`
${
TAG
}
isSupportTemplate Promise success :
${
JSON
.
stringify
(
data
)}
`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
isSupportTemplate Promise err:
${
err
.
code
}
, errMes:
${
err
.
message
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_MANAGER_SUPPORT_TEST_0400 END`
)
})
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_MANAGER_Publish_TEST END
'
)
})
...
...
notification/ans_standard/actsNotificationPublishTest/src/main/js/test/ActsNotificationPublishTest.js
浏览文件 @
733ada9e
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Copyright (c) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
@@ -503,6 +503,51 @@ export default function ActsNotificationPublishTest() {
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_PUBLISH_TEST_1200 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_PUBLISH_TEST_01300
* @tc.name : function publish(request: NotificationRequest, label: string): Promise<void>
* @tc.desc : Publishes a notification
*/
it
(
'
SUB_NOTIFICATION_ANS_PUBLISH_TEST_01300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_PUBLISH_TEST_01300 START`
)
let
label
=
"
label
"
let
notificationRequest
=
{
content
:
{
contentType
:
notification
.
ContentType
.
NOTIFICATION_CONTENT_BASIC_TEXT
,
id
:
1
,
normal
:
{
title
:
'
testTitle
'
,
text
:
'
testText
'
,
additionalText
:
'
testAdditionalText
'
},
},
slotType
:
notification
.
SlotType
.
SOCIAL_COMMUNICATION
,
isOngoing
:
true
,
isUnremovable
:
true
,
deliveryTime
:
0
,
tapDismissed
:
true
,
autoDeletedTime
:
500
,
wantAgent
:
wantAgentData
,
extraInfo
:
{
'
testKey
'
:
'
testValue
'
},
}
notification
.
publish
(
notificationRequest
,
label
).
then
(
data
=>
{
console
.
log
(
`
${
TAG
}
notification publish AsyncCallback success:
${
data
}
`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
(
err
=>
{
console
.
info
(
`
${
TAG
}
notification publish AsyncCallback err:
${
err
.
code
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_PUBLISH_TEST_01300 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_CANCEL_TEST_0100
* @tc.name : function cancel(id: number, label: string, callback: AsyncCallback<void>): void
...
...
@@ -569,6 +614,92 @@ export default function ActsNotificationPublishTest() {
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_CANCEL_TEST_0300 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_CANCEL_TEST_0400
* @tc.name : function cancel(id: number, label?: string, str: string): Promise<void>;
* @tc.desc : Cancels a notification with the specified label and ID
*/
it
(
'
SUB_NOTIFICATION_ANS_CANCEL_TEST_0400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_CANCEL_TEST_0400 START`
)
let
id
=
1
let
label
=
"
label
"
let
str
=
"
str
"
await
notification
.
cancel
(
id
,
label
,
str
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
cancel Promise success`
)
expect
(
false
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
cancel Promise err:
${
err
.
code
}
`
)
expect
(
true
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_CANCEL_TEST_0400 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_CANCEL_TEST_0500
* @tc.name : function cancel(id: number, label: number): Promise<void>;
* @tc.desc : Cancels a notification with the specified label and ID
*/
it
(
'
SUB_NOTIFICATION_ANS_CANCEL_TEST_0500
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_CANCEL_TEST_0500 START`
)
let
id
=
1
let
label
=
2
await
notification
.
cancel
(
id
,
label
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
cancel Promise success`
)
expect
(
false
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
cancel Promise err:
${
err
.
code
}
`
)
expect
(
true
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_CANCEL_TEST_0500 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_CANCEL_TEST_0600
* @tc.name : function cancel(id: number, label: number, callback: AsyncCallback<void>): void
* @tc.desc : Cancels a notification with the specified label and ID
*/
it
(
'
SUB_NOTIFICATION_ANS_CANCEL_TEST_0600
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_CANCEL_TEST_0600 START`
)
let
id
=
1
let
label
=
2
await
notification
.
cancel
(
id
,
label
,
(
err
)
=>
{
if
(
err
.
code
)
{
console
.
info
(
`
${
TAG
}
cancel AsyncCallback err:
${
err
.
code
}
`
)
expect
(
true
).
assertTrue
()
done
()
}
else
{
console
.
info
(
`
${
TAG
}
cancel AsyncCallback success`
)
expect
(
false
).
assertTrue
()
done
()
}
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_CANCEL_TEST_0600 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_CANCEL_TEST_0700
* @tc.name : function cancel(id: number, undefined): Promise<void>;
* @tc.desc : Cancels a notification with the ID
*/
it
(
'
SUB_NOTIFICATION_ANS_CANCEL_TEST_0700
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_CANCEL_TEST_0700 START`
)
let
id
=
1
await
notification
.
cancel
(
id
,
undefined
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
cancel Promise success`
)
expect
(
false
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
cancel Promise err:
${
err
.
code
}
`
)
expect
(
true
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_CANCEL_TEST_0700 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_CANCELAll_TEST_0100
* @tc.name : function cancelAll(callback: AsyncCallback<void>): void
...
...
@@ -609,6 +740,25 @@ export default function ActsNotificationPublishTest() {
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_CANCELAll_TEST_0200 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_CANCELAll_TEST_0300
* @tc.name : function cancelAll(undefined): Promise<void>
* @tc.desc : Cancels all notifications of the current application
*/
it
(
'
SUB_NOTIFICATION_ANS_CANCELAll_TEST_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_CANCELAll_TEST_0300 START`
)
await
notification
.
cancelAll
(
undefined
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
cancelAll Promise success`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
cancelAll Promise err:
${
err
.
code
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_CANCELAll_TEST_0300 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_CANCEL_GROUP_TEST_0100
* @tc.name : function cancelGroup(groupName: string, callback: AsyncCallback<void>): void
...
...
@@ -651,6 +801,45 @@ export default function ActsNotificationPublishTest() {
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_CANCEL_GROUP_TEST_0200 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_CANCEL_GROUP_TEST_0300
* @tc.name : function cancelGroup(number): Promise<void>
* @tc.desc : Cancel the notification of a specified group for this application
*/
it
(
'
SUB_NOTIFICATION_ANS_CANCEL_GROUP_TEST_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_CANCEL_GROUP_TEST_0300 START`
)
await
notification
.
cancelGroup
(
2
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
cancelGroup Promise success`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
cancelGroup Promise err:
${
err
.
code
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_CANCEL_GROUP_TEST_0300 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_CANCEL_GROUP_TEST_0400
* @tc.name : function cancelGroup(groupName: string, undefined): Promise<void>
* @tc.desc : Cancel the notification of a specified group for this application
*/
it
(
'
SUB_NOTIFICATION_ANS_CANCEL_GROUP_TEST_0400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_CANCEL_GROUP_TEST_0400 START`
)
let
groupName
=
"
groupName
"
await
notification
.
cancelGroup
(
groupName
,
undefined
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
cancelGroup Promise success`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
cancelGroup Promise err:
${
err
.
code
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_CANCEL_GROUP_TEST_0400 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_REQUEST_ENABLE_TEST_0100
* @tc.name : function requestEnableNotification(callback: AsyncCallback<void>): void
...
...
@@ -691,6 +880,25 @@ export default function ActsNotificationPublishTest() {
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_REQUEST_ENABLE_TEST_0200 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_REQUEST_ENABLE_TEST_0300
* @tc.name : function requestEnableNotification(undefined): Promise<void>
* @tc.desc : OperationType.UNKNOWN_TYPE & WantAgentFlags.ONE_TIME_FLAG
*/
it
(
'
SUB_NOTIFICATION_ANS_REQUEST_ENABLE_TEST_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_REQUEST_ENABLE_TEST_0300 START`
)
await
notification
.
requestEnableNotification
(
undefined
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
requestEnableNotification Promise success`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
requestEnableNotification Promise err:
${
err
.
code
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_REQUEST_ENABLE_TEST_0300 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_COUNT_TEST_0100
* @tc.name : function getActiveNotificationCount(callback: AsyncCallback<number>): void
...
...
@@ -771,6 +979,43 @@ export default function ActsNotificationPublishTest() {
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_COUNT_TEST_0400 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_COUNT_TEST_0500
* @tc.name : function getActiveNotificationCount(undefined): Promise<number>
* @tc.desc : Obtains the number of all active notifications
*/
it
(
'
SUB_NOTIFICATION_ANS_COUNT_TEST_0500
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_COUNT_TEST_0500 START`
)
await
notification
.
getActiveNotificationCount
(
undefined
).
then
((
data
)
=>
{
console
.
info
(
`
${
TAG
}
getActiveNotificationCount Promise success :
${
JSON
.
stringify
(
data
)}
`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
getActiveNotificationCount Promise err:
${
err
.
code
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_COUNT_TEST_0500 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_COUNT_TEST_0600
* @tc.name : function getActiveNotifications(undefined): Promise<Array<NotificationRequest>>
* @tc.desc : Obtains an array of active notifications
*/
it
(
'
SUB_NOTIFICATION_ANS_COUNT_TEST_0600
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_COUNT_TEST_0600 START`
)
await
notification
.
getActiveNotifications
(
undefined
).
then
((
data
)
=>
{
console
.
info
(
`
${
TAG
}
getActiveNotifications Promise success :
${
JSON
.
stringify
(
data
)}
`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
getActiveNotifications Promise err:
${
err
.
code
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_COUNT_TEST_0600 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_SUPPORT_TEST_0100
...
...
@@ -814,7 +1059,46 @@ export default function ActsNotificationPublishTest() {
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_SUPPORT_TEST_0200 END`
)
})
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_Publish_TEST END
'
)
/*
* @tc.number : SUB_NOTIFICATION_ANS_SUPPORT_TEST_0300
* @tc.name : function isSupportTemplate(templateName: number): Promise<boolean>
* @tc.desc : Obtains whether the template is supported by the system
*/
it
(
'
SUB_NOTIFICATION_ANS_SUPPORT_TEST_0300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_SUPPORT_TEST_0300 START`
)
let
templateName
=
2
await
notification
.
isSupportTemplate
(
templateName
).
then
((
data
)
=>
{
console
.
info
(
`
${
TAG
}
isSupportTemplate Promise success :
${
JSON
.
stringify
(
data
)}
`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
isSupportTemplate Promise err:
${
err
.
code
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_SUPPORT_TEST_0300 END`
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_SUPPORT_TEST_0400
* @tc.name : function isSupportTemplate(templateName: string, undefined): Promise<boolean>
* @tc.desc : Obtains whether the template is supported by the system
*/
it
(
'
SUB_NOTIFICATION_ANS_SUPPORT_TEST_0400
'
,
0
,
async
function
(
done
)
{
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_SUPPORT_TEST_0400 START`
)
let
templateName
=
'
test_templateName
'
await
notification
.
isSupportTemplate
(
templateName
,
undefined
).
then
((
data
)
=>
{
console
.
info
(
`
${
TAG
}
isSupportTemplate Promise success :
${
JSON
.
stringify
(
data
)}
`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
isSupportTemplate Promise err:
${
err
.
code
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
`
${
TAG
}
SUB_NOTIFICATION_ANS_SUPPORT_TEST_0400 END`
)
})
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_Publish_TEST END
'
)
})
}
notification/ans_standard/actsNotificationSlotTest/src/main/js/test/ActsNotificationSlotTest.js
浏览文件 @
733ada9e
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Copyright (c) 2021
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
@@ -1374,6 +1374,101 @@ export default function ActsNotificationSlotTest() {
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_SLOT_TEST_4800 END
'
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_SLOT_TEST_4900
* @tc.name : getSlot(SlotType: SlotType, undefined): Promise<NotificationSlot>
* @tc.desc : Get the OTHER_TYPES type slot without add
*/
it
(
'
SUB_NOTIFICATION_ANS_SLOT_TEST_4900
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_SLOT_TEST_4900 START
'
)
await
notification
.
getSlot
(
notification
.
SlotType
.
OTHER_TYPES
,
undefined
).
then
((
NotificationSlot
)
=>
{
console
.
info
(
`
${
TAG
}
getSlot_49 Promise success:
${
NotificationSlot
}
`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
getSlot_49 Promise err:
${
err
.
code
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_SLOT_TEST_4900 END
'
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_SLOT_TEST_5000
* @tc.name : addSlot(type: SlotType, undefined): Promise<void>
* @tc.desc : NotificationSlot of an unknown type
*/
it
(
'
SUB_NOTIFICATION_ANS_SLOT_TEST_5000
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_SLOT_TEST_5000 START
'
)
await
notification
.
addSlot
(
notification
.
SlotType
.
UNKNOWN_TYPE
,
undefined
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
addSlot_50 Promise success`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
addSlot_50 Promise err:
${
err
.
code
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_SLOT_TEST_5000 END
'
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_SLOT_TEST_5100
* @tc.name : getSlots(undefined): Promise<Array<NotificationSlot>>
* @tc.desc : Get all NotificationSlot without add
*/
it
(
'
SUB_NOTIFICATION_ANS_SLOT_TEST_5100
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_SLOT_TEST_5100 START
'
)
await
notification
.
getSlots
(
undefined
).
then
((
NotificationSlot
)
=>
{
console
.
info
(
`
${
TAG
}
getSlots_51 Promise success:
${
NotificationSlot
}
`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
getSlots_51 Promise err:
${
err
.
code
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_SLOT_TEST_5100 END
'
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_SLOT_TEST_5200
* @tc.name : removeSlot(SlotType: SlotType, undefined): Promise<void>
* @tc.desc : Remove the UNKNOWN_TYPE type slot without add
*/
it
(
'
SUB_NOTIFICATION_ANS_SLOT_TEST_5200
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_SLOT_TEST_5200 START
'
)
await
notification
.
removeSlot
(
notification
.
SlotType
.
UNKNOWN_TYPE
,
undefined
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
removeSlot_52 success`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
removeSlot_52 err:
${
err
.
code
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_SLOT_TEST_5200 END
'
)
})
/*
* @tc.number : SUB_NOTIFICATION_ANS_SLOT_TEST_5300
* @tc.name : removeAllSlots(undefined): Promise<void>
* @tc.desc : Removes all NotificationSlot
*/
it
(
'
SUB_NOTIFICATION_ANS_SLOT_TEST_5300
'
,
0
,
async
function
(
done
)
{
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_SLOT_TEST_5300 START
'
)
await
notification
.
removeAllSlots
(
undefined
).
then
(()
=>
{
console
.
info
(
`
${
TAG
}
removeAllSlots_53 Promise success`
)
expect
(
true
).
assertTrue
()
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
TAG
}
removeAllSlots_53 Promise err:
${
err
.
code
}
`
)
expect
(
false
).
assertTrue
()
done
()
})
console
.
info
(
TAG
+
'
SUB_NOTIFICATION_ANS_SLOT_TEST_5300 END
'
)
})
/*
* @tc.number : SUB_NOTIFICATION_SLOT_ENUM_TEST_0100
* @tc.name : Describes NotificationSlot types
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录