Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
ccf63ad2
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看板
未验证
提交
ccf63ad2
编写于
3月 23, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 23, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2815 Modify use case
Merge pull request !2815 from 火箭龟/rele_323
上级
bc7c7e1e
bc3e1edb
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
391 addition
and
385 deletion
+391
-385
resourceschedule/resourceschedule_standard/backgroundtaskmanager/src/main/js/default/test/BackgroundTaskMagrJs.test.js
...ger/src/main/js/default/test/BackgroundTaskMagrJs.test.js
+9
-9
resourceschedule/resourceschedule_standard/reminderagent/src/main/js/default/test/ReminderAgentJs.test.js
...deragent/src/main/js/default/test/ReminderAgentJs.test.js
+348
-342
resourceschedule/resourceschedule_standard/workscheduler/src/main/js/default/test/WorkScheduler.test.js
...kscheduler/src/main/js/default/test/WorkScheduler.test.js
+34
-34
未找到文件。
resourceschedule/resourceschedule_standard/backgroundtaskmanager/src/main/js/default/test/BackgroundTaskMagrJs.test.js
浏览文件 @
ccf63ad2
...
...
@@ -58,7 +58,7 @@ describe("TransientTaskJsTest", function () {
it
(
"
TransientTaskJsTest001
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------TransientTaskJsTest001---------------------------
'
);
function
callback
()
{}
var
info
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
let
info
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
if
(
info
.
requestId
!=
-
1
)
{
console
.
info
(
'
TransientTaskJsTest001 backgroundTaskManager success, requestId:
'
+
info
.
requestId
);
expect
(
true
).
assertTrue
();
...
...
@@ -78,10 +78,10 @@ describe("TransientTaskJsTest", function () {
it
(
"
TransientTaskJsTest002
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------TransientTaskJsTest002---------------------------
'
);
function
callback
()
{}
var
info1
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
var
info2
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
var
info3
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
var
info4
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
let
info1
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
let
info2
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
let
info3
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
let
info4
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
if
(
info4
.
requestId
==
-
1
)
{
console
.
info
(
'
TransientTaskJsTest002 backgroundTaskManager more than three
'
);
expect
(
true
).
assertTrue
();
...
...
@@ -102,7 +102,7 @@ describe("TransientTaskJsTest", function () {
*/
it
(
"
TransientTaskJsTest003
"
,
0
,
async
function
(
done
)
{
function
callback
()
{}
var
info
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
let
info
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
if
(
info
.
requestId
!=
-
1
)
{
console
.
info
(
'
TransientTaskJsTest003 backgroundTaskManager success, requestId:
'
+
info
.
requestId
);
expect
(
true
).
assertTrue
();
...
...
@@ -134,7 +134,7 @@ describe("TransientTaskJsTest", function () {
*/
it
(
"
TransientTaskJsTest004
"
,
0
,
async
function
(
done
)
{
function
callback
()
{}
var
info
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
let
info
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
if
(
info
.
requestId
!=
-
1
)
{
console
.
info
(
'
TransientTaskJsTest004 backgroundTaskManager success, requestId:
'
+
info
.
requestId
);
expect
(
true
).
assertTrue
();
...
...
@@ -169,7 +169,7 @@ describe("TransientTaskJsTest", function () {
it
(
"
TransientTaskJsTest005
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------TransientTaskJsTest005---------------------------
'
);
function
callback
()
{}
var
info
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
let
info
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
if
(
info
.
actualDealyTime
!=
-
1
)
{
console
.
info
(
'
TransientTaskJsTest001 backgroundTaskManager success, actualDealyTime:
'
+
info
.
actualDealyTime
);
...
...
@@ -190,7 +190,7 @@ describe("TransientTaskJsTest", function () {
it
(
"
TransientTaskJsTest006
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------TransientTaskJsTest006---------------------------
'
);
function
callback
()
{}
var
info
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
let
info
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
if
(
info
.
requestId
!=
-
1
)
{
console
.
info
(
'
TransientTaskJsTest006 DelaySuspendInfo actualDealyTime:
'
+
info
.
actualDealyTime
);
...
...
resourceschedule/resourceschedule_standard/reminderagent/src/main/js/default/test/ReminderAgentJs.test.js
浏览文件 @
ccf63ad2
此差异已折叠。
点击以展开。
resourceschedule/resourceschedule_standard/workscheduler/src/main/js/default/test/WorkScheduler.test.js
浏览文件 @
ccf63ad2
...
...
@@ -63,7 +63,7 @@ describe("WorkSchedulerJsTest", function () {
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
...
...
@@ -82,7 +82,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName
:
"
com.mytest.abilityName
"
,
storageRequest
:
workScheduler
.
StorageRequest
.
STORAGE_LEVEL_OKAY
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
true
)
done
();
})
...
...
@@ -100,7 +100,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName
:
"
com.mytest.abilityName
"
,
storageRequest
:
workScheduler
.
StorageRequest
.
STORAGE_LEVEL_OKAY
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
...
...
@@ -118,7 +118,7 @@ describe("WorkSchedulerJsTest", function () {
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
storageRequest
:
workScheduler
.
StorageRequest
.
STORAGE_LEVEL_OKAY
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
...
...
@@ -136,7 +136,7 @@ describe("WorkSchedulerJsTest", function () {
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
...
...
@@ -155,7 +155,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName
:
"
com.mytest.abilityName
"
,
storageRequest
:
workScheduler
.
StorageRequest
.
STORAGE_LEVEL_OKAY
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
true
)
done
();
})
...
...
@@ -174,9 +174,9 @@ describe("WorkSchedulerJsTest", function () {
abilityName
:
"
com.mytest.abilityName
"
,
storageRequest
:
workScheduler
.
StorageRequest
.
STORAGE_LEVEL_OKAY
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
if
(
res
==
true
)
{
var
stopRes
=
workScheduler
.
stopWork
(
workInfo
,
false
);
let
stopRes
=
workScheduler
.
stopWork
(
workInfo
,
false
);
expect
(
stopRes
).
assertEqual
(
true
)
}
else
{
expect
(
false
).
assertEqual
(
true
)
...
...
@@ -198,9 +198,9 @@ describe("WorkSchedulerJsTest", function () {
abilityName
:
"
com.mytest.abilityName
"
,
storageRequest
:
workScheduler
.
StorageRequest
.
STORAGE_LEVEL_OKAY
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
if
(
res
==
true
)
{
var
stopRes
=
workScheduler
.
stopWork
(
workInfo
,
false
);
let
stopRes
=
workScheduler
.
stopWork
(
workInfo
,
false
);
expect
(
stopRes
).
assertEqual
(
true
)
}
else
{
expect
(
false
).
assertEqual
(
true
)
...
...
@@ -222,7 +222,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName
:
"
com.mytest.abilityName
"
,
storageRequest
:
workScheduler
.
StorageRequest
.
STORAGE_LEVEL_OKAY
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
if
(
res
==
false
)
{
expect
(
false
).
assertEqual
(
true
)
done
();
...
...
@@ -257,7 +257,7 @@ describe("WorkSchedulerJsTest", function () {
storageRequest
:
workScheduler
.
StorageRequest
.
STORAGE_LEVEL_OKAY
,
batteryLevel
:
15
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
if
(
res
==
false
)
{
expect
(
false
).
assertEqual
(
true
)
done
();
...
...
@@ -291,7 +291,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName
:
"
com.mytest.abilityName
"
,
storageRequest
:
workScheduler
.
StorageRequest
.
STORAGE_LEVEL_OKAY
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
if
(
res
==
false
)
{
expect
(
false
).
assertEqual
(
true
)
done
();
...
...
@@ -326,7 +326,7 @@ describe("WorkSchedulerJsTest", function () {
storageRequest
:
workScheduler
.
StorageRequest
.
STORAGE_LEVEL_OKAY
,
batteryLevel
:
15
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
if
(
res
==
false
)
{
expect
(
false
).
assertEqual
(
true
)
done
();
...
...
@@ -359,9 +359,9 @@ describe("WorkSchedulerJsTest", function () {
abilityName
:
"
com.mytest.abilityName
"
,
storageRequest
:
workScheduler
.
StorageRequest
.
STORAGE_LEVEL_OKAY
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
if
(
res
==
true
)
{
var
stopRes
=
workScheduler
.
stopAndClearWorks
();
let
stopRes
=
workScheduler
.
stopAndClearWorks
();
expect
(
stopRes
).
assertEqual
(
true
)
}
else
{
expect
(
false
).
assertEqual
(
true
)
...
...
@@ -633,7 +633,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName
:
"
com.mytest.abilityName
"
,
isPersisted
:
true
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
...
...
@@ -652,7 +652,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName
:
"
com.mytest.abilityName
"
,
isPersisted
:
false
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
...
...
@@ -671,7 +671,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName
:
"
com.mytest.abilityName
"
,
isCharging
:
true
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
true
)
done
();
})
...
...
@@ -690,7 +690,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName
:
"
com.mytest.abilityName
"
,
isCharging
:
false
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
...
...
@@ -709,7 +709,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName
:
"
com.mytest.abilityName
"
,
isRepeat
:
true
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
...
...
@@ -728,7 +728,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName
:
"
com.mytest.abilityName
"
,
isRepeat
:
false
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
...
...
@@ -747,7 +747,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName
:
"
com.mytest.abilityName
"
,
isDeepIdle
:
true
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
...
...
@@ -766,7 +766,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName
:
"
com.mytest.abilityName
"
,
isDeepIdle
:
false
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
...
...
@@ -785,7 +785,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName
:
"
com.mytest.abilityName
"
,
batteryLevel
:
20
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
...
...
@@ -804,7 +804,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName
:
"
com.mytest.abilityName
"
,
batteryLevel
:
50
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
...
...
@@ -823,7 +823,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName
:
"
com.mytest.abilityName
"
,
batteryLevel
:
80
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
...
...
@@ -844,7 +844,7 @@ describe("WorkSchedulerJsTest", function () {
repeatCycleTime
:
1800000
,
repeatCount
:
2
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
...
...
@@ -865,7 +865,7 @@ describe("WorkSchedulerJsTest", function () {
repeatCycleTime
:
2400000
,
repeatCount
:
3
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
...
...
@@ -884,7 +884,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName
:
"
com.mytest.abilityName
"
,
idleWaitTime
:
3000
,
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
...
...
@@ -962,7 +962,7 @@ describe("WorkSchedulerJsTest", function () {
bundleName: "ohos.acts.resourceschedule.workscheduler.js.function",
abilityName: "com.mytest.abilityName",
}
var
res = workScheduler.onWorkStart(workInfo);
let
res = workScheduler.onWorkStart(workInfo);
expect(res).assertEqual(false);
done();
})*/
...
...
@@ -980,7 +980,7 @@ describe("WorkSchedulerJsTest", function () {
bundleName: "ohos.acts.resourceschedule.workscheduler.js.function",
abilityName: "com.mytest.abilityName",
}
var
stopRes = workSchedulerCallback.onWorkStop(workInfo, true);
let
stopRes = workSchedulerCallback.onWorkStop(workInfo, true);
expect(stopRes).assertEqual(false);
done();
})*/
...
...
@@ -998,7 +998,7 @@ describe("WorkSchedulerJsTest", function () {
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
);
console
.
log
(
"
workScheduler workInfo bundleName :
"
+
workInfo
.
bundleName
);
done
();
...
...
@@ -1017,7 +1017,7 @@ describe("WorkSchedulerJsTest", function () {
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
);
console
.
log
(
"
test workScheduler workInfo abilityName :
"
+
workInfo
.
abilityName
);
done
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录