Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9ce8d13a
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看板
未验证
提交
9ce8d13a
编写于
3月 23, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 23, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2788 Modify use case
Merge pull request !2788 from 火箭龟/release_322
上级
d71bb573
b82e883b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
144 addition
and
128 deletion
+144
-128
resourceschedule/resourceschedule_standard/reminderagent/src/main/js/default/test/ReminderAgentJs.test.js
...deragent/src/main/js/default/test/ReminderAgentJs.test.js
+138
-122
resourceschedule/resourceschedule_standard/workscheduler/src/main/js/default/test/WorkScheduler.test.js
...kscheduler/src/main/js/default/test/WorkScheduler.test.js
+6
-6
未找到文件。
resourceschedule/resourceschedule_standard/reminderagent/src/main/js/default/test/ReminderAgentJs.test.js
浏览文件 @
9ce8d13a
...
...
@@ -107,10 +107,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_003
* @tc.name testAddNotificationSlotNorFun00
1
* @tc.name testAddNotificationSlotNorFun00
3
* @tc.desc Adds a reminder notification slot with the callback function.
*/
it
(
'
testAddNotificationSlotNorFun00
1
'
,
0
,
async
function
(
done
)
{
it
(
'
testAddNotificationSlotNorFun00
3
'
,
0
,
async
function
(
done
)
{
function
reminderCallback
(
err
,
data
)
{
let
i
=
0
;
expect
(
0
).
assertEqual
(
i
);
...
...
@@ -121,10 +121,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_004
* @tc.name testAddNotificationSlotNorFun00
2
* @tc.name testAddNotificationSlotNorFun00
4
* @tc.desc Adds a reminder notification slot with the promise function and null mySlot.
*/
it
(
'
testAddNotificationSlotNorFun00
2
'
,
0
,
async
function
(
done
)
{
it
(
'
testAddNotificationSlotNorFun00
4
'
,
0
,
async
function
(
done
)
{
let
mySlot
=
null
;
try
{
reminderAgent
.
addNotificationSlot
(
mySlot
,
function
(
err
)
{
...
...
@@ -145,10 +145,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_005
* @tc.name testAddNotificationSlotNorFun00
3
* @tc.name testAddNotificationSlotNorFun00
5
* @tc.desc Adds a reminder notification slot with the promise function and mySlot type 3.
*/
it
(
'
testAddNotificationSlotNorFun00
3
'
,
0
,
async
function
(
done
)
{
it
(
'
testAddNotificationSlotNorFun00
5
'
,
0
,
async
function
(
done
)
{
let
mySlot
=
{
type
:
3
}
...
...
@@ -167,10 +167,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_006
* @tc.name testAddNotificationSlotNorFun00
4
* @tc.name testAddNotificationSlotNorFun00
6
* @tc.desc Adds a reminder notification slot with the promise function and mySlot more types.
*/
it
(
'
testAddNotificationSlotNorFun00
4
'
,
0
,
async
function
(
done
)
{
it
(
'
testAddNotificationSlotNorFun00
6
'
,
0
,
async
function
(
done
)
{
let
mySlot0
=
{
type
:
0
}
...
...
@@ -205,10 +205,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_007
* @tc.name testGetValidRemindersNorFun00
1
* @tc.name testGetValidRemindersNorFun00
7
* @tc.desc Obtains all valid remindeers set by the current application.
*/
it
(
'
testGetValidRemindersNorFun00
1
'
,
0
,
async
function
(
done
)
{
it
(
'
testGetValidRemindersNorFun00
7
'
,
0
,
async
function
(
done
)
{
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
...
...
@@ -228,10 +228,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_008
* @tc.name testCancelAllRemindersNorFun00
1
* @tc.name testCancelAllRemindersNorFun00
8
* @tc.desc test cancel all reminders can cancel all exist reminders
*/
it
(
'
testCancelAllRemindersNorFun00
1
'
,
0
,
async
function
(
done
)
{
it
(
'
testCancelAllRemindersNorFun00
8
'
,
0
,
async
function
(
done
)
{
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
...
...
@@ -251,10 +251,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_009
* @tc.name testCancelRemindersNorFun00
1
* @tc.name testCancelRemindersNorFun00
9
* @tc.desc test cancelReminder with not exit reminder.
*/
it
(
'
testCancelRemindersNorFun00
1
'
,
0
,
async
function
(
done
)
{
it
(
'
testCancelRemindersNorFun00
9
'
,
0
,
async
function
(
done
)
{
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
...
...
@@ -284,10 +284,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_010
* @tc.name testCancelRemindersNorFun0
02
* @tc.name testCancelRemindersNorFun0
10
* @tc.desc test cancel reminder with not exit reminder.
*/
it
(
'
testCancelRemindersNorFun0
02
'
,
0
,
async
function
(
done
)
{
it
(
'
testCancelRemindersNorFun0
10
'
,
0
,
async
function
(
done
)
{
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
...
...
@@ -317,10 +317,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_011
* @tc.name testCancelRemindersNorFun0
03
* @tc.name testCancelRemindersNorFun0
11
* @tc.desc test cancel reminder with exist reminder.
*/
it
(
'
testCancelRemindersNorFun0
03
'
,
0
,
async
function
(
done
)
{
it
(
'
testCancelRemindersNorFun0
11
'
,
0
,
async
function
(
done
)
{
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
21
,
...
...
@@ -354,10 +354,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_012
* @tc.name testCancelRemindersNorFun0
04
* @tc.name testCancelRemindersNorFun0
12
* @tc.desc test cancel reminder with exist reminder with the promise function.
*/
it
(
'
testCancelRemindersNorFun0
04
'
,
0
,
async
function
(
done
)
{
it
(
'
testCancelRemindersNorFun0
12
'
,
0
,
async
function
(
done
)
{
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
21
,
...
...
@@ -391,18 +391,18 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_013
* @tc.name testGetValidRemindersNorFun0
02
* @tc.name testGetValidRemindersNorFun0
13
* @tc.desc test get valid reminders verify all the information is correct.
*/
it
(
'
testGetValidRemindersNorFun0
02
'
,
0
,
async
function
(
done
)
{
var
alarm
=
{
it
(
'
testGetValidRemindersNorFun0
13
'
,
0
,
async
function
(
done
)
{
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
21
,
minute
:
14
,
title
:
"
this is title
"
,
content
:
"
this is content
"
}
var
timer
=
{
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
}
...
...
@@ -421,18 +421,18 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_014
* @tc.name testGetValidRemindersNorFun0
03
* @tc.name testGetValidRemindersNorFun0
14
* @tc.desc test get valid reminders verify all the information is correct with the callback function.
*/
it
(
'
testGetValidRemindersNorFun0
03
'
,
0
,
async
function
(
done
)
{
var
alarm
=
{
it
(
'
testGetValidRemindersNorFun0
14
'
,
0
,
async
function
(
done
)
{
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
21
,
minute
:
14
,
title
:
"
this is title
"
,
content
:
"
this is content
"
}
var
timer
=
{
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
}
...
...
@@ -451,10 +451,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_015
* @tc.name testRemonveNotificationSlotNorFun0
01
* @tc.name testRemonveNotificationSlotNorFun0
15
* @tc.desc test remove notification Slot with not exist slot.
*/
it
(
'
testRemonveNotificationSlotNorFun0
01
'
,
0
,
async
function
(
done
)
{
it
(
'
testRemonveNotificationSlotNorFun0
15
'
,
0
,
async
function
(
done
)
{
function
reminderCallback
(
err
,
data
)
{
let
i
=
0
;
expect
(
0
).
assertEqual
(
i
);
...
...
@@ -465,10 +465,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_016
* @tc.name testRemonveNotificationSlotNorFun0
02
* @tc.name testRemonveNotificationSlotNorFun0
16
* @tc.desc test remove notification Slot with not exist slot with the promise function.
*/
it
(
'
testRemonveNotificationSlotNorFun0
02
'
,
0
,
async
function
(
done
)
{
it
(
'
testRemonveNotificationSlotNorFun0
16
'
,
0
,
async
function
(
done
)
{
let
promise
=
new
Promise
((
resolve
,
reject
)
=>
{
reminderAgent
.
removeNotificationSlot
(
1
).
then
(()
=>
{
resolve
();
...
...
@@ -485,10 +485,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_017
* @tc.name testRemonveNotificationSlotNorFun0
03
* @tc.name testRemonveNotificationSlotNorFun0
17
* @tc.desc test remove notification Slot with exist slot.
*/
it
(
'
testRemonveNotificationSlotNorFun0
03
'
,
0
,
async
function
(
done
)
{
it
(
'
testRemonveNotificationSlotNorFun0
17
'
,
0
,
async
function
(
done
)
{
let
tarRemoveSlot
=
{
type
:
1
}
...
...
@@ -502,10 +502,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_018
* @tc.name testRemonveNotificationSlotNorFun0
04
* @tc.name testRemonveNotificationSlotNorFun0
18
* @tc.desc test remove notification Slot with exist slot with the promise function.
*/
it
(
'
testRemonveNotificationSlotNorFun0
04
'
,
0
,
async
function
(
done
)
{
it
(
'
testRemonveNotificationSlotNorFun0
18
'
,
0
,
async
function
(
done
)
{
let
tarRemoveSlot
=
{
type
:
1
}
...
...
@@ -519,10 +519,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_019
* @tc.name testGetValidRemindersNorFun0
04
* @tc.name testGetValidRemindersNorFun0
19
* @tc.desc test get valid reminders with promise function.
*/
it
(
'
testGetValidRemindersNorFun0
04
'
,
0
,
async
function
(
done
)
{
it
(
'
testGetValidRemindersNorFun0
19
'
,
0
,
async
function
(
done
)
{
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
3
...
...
@@ -538,10 +538,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_020
* @tc.name testGetValidRemindersNorFun0
05
* @tc.name testGetValidRemindersNorFun0
20
* @tc.desc test get valid reminders with the callback function.
*/
it
(
'
testGetValidRemindersNorFun0
05
'
,
0
,
async
function
(
done
)
{
it
(
'
testGetValidRemindersNorFun0
20
'
,
0
,
async
function
(
done
)
{
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
3
...
...
@@ -557,10 +557,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_021
* @tc.name testPublishReminderNorAlarmFun0
0
1
* @tc.name testPublishReminderNorAlarmFun0
2
1
* @tc.desc test publish reminder with a nomal alarm promise function.
*/
it
(
'
testPublishReminderNorAlarmFun0
0
1
'
,
0
,
async
function
(
done
)
{
it
(
'
testPublishReminderNorAlarmFun0
2
1
'
,
0
,
async
function
(
done
)
{
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
21
,
...
...
@@ -577,10 +577,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_022
* @tc.name testPublishReminderNorAlarmFun0
0
2
* @tc.name testPublishReminderNorAlarmFun0
2
2
* @tc.desc test publish reminder with a nomal alarm callback function.
*/
it
(
'
testPublishReminderNorAlarmFun0
0
2
'
,
0
,
async
function
(
done
)
{
it
(
'
testPublishReminderNorAlarmFun0
2
2
'
,
0
,
async
function
(
done
)
{
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
hour
:
21
,
...
...
@@ -598,10 +598,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_023
* @tc.name testPublishReminderAbNorFun0
01
* @tc.name testPublishReminderAbNorFun0
23
* @tc.desc test publish reminder with max number limit of each application.
*/
it
(
'
testPublishReminderAbNorFun0
01
'
,
0
,
async
function
(
done
)
{
it
(
'
testPublishReminderAbNorFun0
23
'
,
0
,
async
function
(
done
)
{
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
...
...
@@ -631,10 +631,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_024
* @tc.name testReminderTypeCalendarFun0
01
* @tc.name testReminderTypeCalendarFun0
24
* @tc.desc test cancelAllReminders can cancel all exist reminders with type of calendar.
*/
it
(
'
testReminderTypeCalendarFun0
01
'
,
0
,
async
function
(
done
)
{
it
(
'
testReminderTypeCalendarFun0
24
'
,
0
,
async
function
(
done
)
{
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
100
...
...
@@ -663,10 +663,10 @@ describe('ReminderAgentTest', function () {
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_025
* @tc.name testPublishReminderTypeCalendarFun0
01
* @tc.name testPublishReminderTypeCalendarFun0
25
* @tc.desc test pulish reminders with type of calendar.
*/
it
(
'
testReminderTypeCalendarFun0
01
'
,
0
,
async
function
(
done
)
{
it
(
'
testReminderTypeCalendarFun0
25
'
,
0
,
async
function
(
done
)
{
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -742,11 +742,11 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
71
* @tc.name testActionButtonTypeClose0
01
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
26
* @tc.name testActionButtonTypeClose0
26
* @tc.desc test acton butto type is close.
*/
it
(
'
testActionButtonTypeClose0
01
'
,
0
,
async
function
(
done
)
{
it
(
'
testActionButtonTypeClose0
26
'
,
0
,
async
function
(
done
)
{
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
ACTION_BUTTON_TYPE_CLOSE
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
...
...
@@ -763,11 +763,11 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
72
* @tc.name testActionButtonTypeSnooze0
01
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
27
* @tc.name testActionButtonTypeSnooze0
27
* @tc.desc test acton butto type is snooze.
*/
it
(
'
testActionButtonTypeSnooze0
01
'
,
0
,
async
function
(
done
)
{
it
(
'
testActionButtonTypeSnooze0
27
'
,
0
,
async
function
(
done
)
{
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
ACTION_BUTTON_TYPE_SNOOZE
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
...
...
@@ -784,36 +784,46 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
73
* @tc.name testActionButtonType0
01
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
28
* @tc.name testActionButtonType0
28
* @tc.desc test acton butto type type = 0.
*/
it
(
"
testActionButtonType0
01
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------
testActionButtonType001
---------------------------
'
);
it
(
"
testActionButtonType0
28
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------
qigongmingtestActionButtonType028
---------------------------
'
);
let
type1
=
reminderAgent
.
ActionButtonType
.
ACTION_BUTTON_TYPE_CLOSE
;
except
(
type1
).
assertEqual
(
0
);
console
.
log
(
type1
+
typeof
(
type1
));
if
(
type1
==
0
)
{
expect
(
true
).
assertTrue
();
}
else
{
except
(
false
).
assertTrue
();
}
done
();
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
74
* @tc.name testActionButtonType0
02
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
29
* @tc.name testActionButtonType0
29
* @tc.desc test acton butto type type = 0.
*/
it
(
"
testActionButtonType0
02
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testActionButtonType0
02
---------------------------
'
);
it
(
"
testActionButtonType0
29
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testActionButtonType0
29
---------------------------
'
);
let
type1
=
reminderAgent
.
ActionButtonType
.
ACTION_BUTTON_TYPE_SNOOZE
;
except
(
type1
).
assertEqual
(
1
);
console
.
log
(
type1
+
typeof
(
type1
));
if
(
type1
==
1
)
{
expect
(
true
).
assertTrue
();
}
else
{
except
(
false
).
assertTrue
();
}
done
();
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
75
* @tc.name testActionButton0
01
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
30
* @tc.name testActionButton0
30
* @tc.desc test ActionButton title.
*/
it
(
"
testActionButton0
01
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testActionButton0
01
---------------------------
'
);
it
(
"
testActionButton0
30
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testActionButton0
30
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
...
...
@@ -831,7 +841,7 @@ describe('ReminderAgentTest', function () {
expect
(
false
).
assertEqual
(
false
);
}
},(
error
)
=>
{
expect
(
false
).
assert
Equal
();
expect
(
false
).
assert
True
();
});
});
...
...
@@ -841,12 +851,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
76
* @tc.name testActionButton0
02
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
31
* @tc.name testActionButton0
31
* @tc.desc test ActionButton
*/
it
(
"
testActionButton0
02
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testActionButton0
02
---------------------------
'
);
it
(
"
testActionButton0
31
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testActionButton0
31
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
...
...
@@ -862,11 +872,11 @@ describe('ReminderAgentTest', function () {
console
.
log
(
'
ActionButton type:
'
+
actionButton
[
0
].
type
);
}
else
{
reminder
=
[{
actionButton
:
[{
type
:
1
}]}];
console
.
log
(
'
ActionButtonType:
'
+
reminder
[
0
].
actionButton
[
0
].
type
);
expect
(
false
).
assertEqual
(
false
);
console
.
log
(
'
ActionButton
Type:
'
+
reminder
[
0
].
actionButton
[
0
].
type
);
expect
(
true
).
assertTrue
(
);
}
},(
error
)
=>
{
expect
(
false
).
assert
Equal
();
expect
(
false
).
assert
True
();
});
});
...
...
@@ -876,29 +886,32 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
77
* @tc.name testWantAgentAbilityName0
01
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
32
* @tc.name testWantAgentAbilityName0
32
* @tc.desc test wantAgent abilityName
*/
it
(
"
testWantAgentAbilityName0
01
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testWantAgentAbilityName0
01
---------------------------
'
);
it
(
"
testWantAgentAbilityName0
32
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testWantAgentAbilityName0
32
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
}
triggerTimeInSeconds
:
4
,
wantAgent
:
{
pkgName
:
"
ohos.samples.jshelloworld
"
,
abilityName
:
"
ohos.samples.jshelloworld.MainAbility
"
},
};
reminderAgent
.
publishReminder
(
timer
).
then
((
reminderId
)
=>
{
console
.
log
(
"
reminderId =
"
+
reminderId
);
reminderAgent
.
getValidReminders
(
).
then
((
reminder
)
=>
{
reminderAgent
.
getValidReminders
(
(
err
,
reminder
)
=>
{
if
(
reminder
.
length
!==
0
)
{
let
wantAgent
=
reminder
[
0
].
wantAgent
;
console
.
log
(
'
WantAgent abilityName:
'
+
wantAgent
.
abilityName
);
}
else
{
reminder
=
[{
wantAgent
:
{
abilityName
:
'
title.com.oh.phone.MainAbility
'
}}];
console
.
log
(
'
WantAgent abilityName:
'
+
reminder
[
0
].
wantAgent
.
abilityName
);
expect
(
false
).
assertEqual
(
false
);
};
},(
error
)
=>
{
expect
(
false
).
assertEqual
();
let
wantAgent
=
reminder
[
0
].
wantAgent
.
abilityName
;
//expect(wantAgent).assertEqual("ohos.samples.jshelloworld.MainAbility");
if
(
wantAgent
==
"
ohos.samples.jshelloworld.MainAbility
"
)
{
expect
(
true
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
}
}
});
});
...
...
@@ -908,12 +921,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
78
* @tc.name testMaxScreenWantAgentAbilityName0
01
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
33
* @tc.name testMaxScreenWantAgentAbilityName0
33
* @tc.desc test MaxScreenWantAgent abilityName
*/
it
(
"
testMaxScreenWantAgentAbilityName0
01
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testMaxScreenWantAgentAbilityName0
01
---------------------------
'
);
it
(
"
testMaxScreenWantAgentAbilityName0
33
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testMaxScreenWantAgentAbilityName0
33
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
...
...
@@ -929,7 +942,7 @@ describe('ReminderAgentTest', function () {
expect
(
false
).
assertEqual
(
false
);
};
},(
error
)
=>
{
expect
(
false
).
assert
Equal
();
expect
(
false
).
assert
True
();
});
});
...
...
@@ -939,12 +952,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
79
* @tc.name testReminderRequestTitle0
01
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
34
* @tc.name testReminderRequestTitle0
34
* @tc.desc test ReminderRequest title
*/
it
(
"
testReminderRequestTitle0
01
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderRequestTitle0
01
---------------------------
'
);
it
(
"
testReminderRequestTitle0
34
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderRequestTitle0
34
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
...
...
@@ -961,7 +974,7 @@ describe('ReminderAgentTest', function () {
expect
(
false
).
assertEqual
(
false
);
};
},(
error
)
=>
{
expect
(
false
).
assert
Equal
();
expect
(
false
).
assert
True
();
});
});
...
...
@@ -971,12 +984,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
80
* @tc.name testReminderRequestContent0
01
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
35
* @tc.name testReminderRequestContent0
35
* @tc.desc test ReminderRequest content
*/
it
(
"
testReminderRequestContent0
01
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderRequestContent0
01
---------------------------
'
);
it
(
"
testReminderRequestContent0
35
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderRequestContent0
35
---------------------------
'
);
let
timer
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_TIMER
,
triggerTimeInSeconds
:
TRIGGER_TIME_IN_SECONDS
...
...
@@ -993,7 +1006,7 @@ describe('ReminderAgentTest', function () {
expect
(
false
).
assertEqual
(
false
);
};
},(
error
)
=>
{
expect
(
false
).
assert
Equal
();
expect
(
false
).
assert
True
();
});
});
...
...
@@ -1003,12 +1016,12 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
81
* @tc.name testReminderRequestType0
01
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
36
* @tc.name testReminderRequestType0
36
* @tc.desc test ReminderRequest LocalDateTime second
*/
it
(
"
testReminderRequestType0
01
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderRequestType0
01
---------------------------
'
);
it
(
"
testReminderRequestType0
36
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderRequestType0
36
---------------------------
'
);
let
calendar
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_CALENDAR
,
dateTime
:
{
...
...
@@ -1030,22 +1043,25 @@ describe('ReminderAgentTest', function () {
})
/**
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
82
* @tc.name testReminderRequestType0
02
* @tc.number SUB_RESOURCESCHEDULE_REMINDER_AGENT_0
37
* @tc.name testReminderRequestType0
37
* @tc.desc test ReminderRequest ReminderRequestAlarm daysOfWeek
*/
it
(
"
testReminderRequestType0
02
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderRequestType0
02
---------------------------
'
);
it
(
"
testReminderRequestType0
37
"
,
0
,
async
function
(
done
)
{
console
.
log
(
'
----------------------testReminderRequestType0
37
---------------------------
'
);
let
alarm
=
{
reminderType
:
reminderAgent
.
ReminderType
.
REMINDER_TYPE_ALARM
,
reminderRequestAlarm
:
{
hour
:
7
,
minute
:
10
,
daysOfWeek
:
[
1
,
2
,
3
,
4
,
5
]
}
hour
:
7
,
minute
:
10
,
daysOfWeek
:
[
1
,
2
,
3
,
4
,
5
]
}
reminderAgent
.
publishReminder
(
alarm
).
then
((
reminderId
)
=>
{
if
(
reminderId
!=
-
1
)
{
expect
(
true
).
assertTrue
();
}
console
.
log
(
"
reminderId =
"
+
reminderId
);
},
error
=>
{
expect
(
false
).
assertTrue
();
});
setTimeout
(()
=>
{
...
...
resourceschedule/resourceschedule_standard/workscheduler/src/main/js/default/test/WorkScheduler.test.js
浏览文件 @
9ce8d13a
...
...
@@ -898,10 +898,10 @@ describe("WorkSchedulerJsTest", function () {
it
(
"
WorkSchedulerJsTest046
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest046---------------------------
'
);
let
workInfo
=
{
workId
:
7
,
workId
:
5
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
networkType
:
NETWORK_TYPE_ANY
networkType
:
workScheduler
.
NetworkType
.
NETWORK_TYPE_ANY
}
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
);
...
...
@@ -955,7 +955,7 @@ describe("WorkSchedulerJsTest", function () {
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest049
"
,
0
,
async
function
(
done
)
{
/*
it("WorkSchedulerJsTest049", 0, async function (done) {
console.info('----------------------WorkSchedulerJsTest049---------------------------');
let workInfo = {
workId: 2,
...
...
@@ -965,7 +965,7 @@ describe("WorkSchedulerJsTest", function () {
var res = workScheduler.onWorkStart(workInfo);
expect(res).assertEqual(false);
done();
})
})
*/
/*
* @tc.name: WorkSchedulerJsTest050
...
...
@@ -973,7 +973,7 @@ describe("WorkSchedulerJsTest", function () {
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest050
"
,
0
,
async
function
(
done
)
{
/*
it("WorkSchedulerJsTest050", 0, async function (done) {
console.info('----------------------WorkSchedulerJsTest050---------------------------');
let workInfo = {
workId: 2,
...
...
@@ -983,7 +983,7 @@ describe("WorkSchedulerJsTest", function () {
var stopRes = workSchedulerCallback.onWorkStop(workInfo, true);
expect(stopRes).assertEqual(false);
done();
})
})
*/
/*
* @tc.name: WorkSchedulerJsTest051
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录