Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
df008208
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,发现更多精彩内容 >>
未验证
提交
df008208
编写于
3月 09, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 09, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2250 add case to 3.1release
Merge pull request !2250 from 火箭龟/cherry-pick-1646707403
上级
4cc359e4
a3b581d2
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
387 addition
and
2 deletion
+387
-2
resourceschedule/resourceschedule_standard/backgroundtaskmanager/src/main/js/default/test/BackgroundTaskMagrJs.test.js
...ger/src/main/js/default/test/BackgroundTaskMagrJs.test.js
+0
-1
resourceschedule/resourceschedule_standard/backgroundtaskmanager/src/main/js/default/test/ContinuousTaskJsunit.test.js
...ger/src/main/js/default/test/ContinuousTaskJsunit.test.js
+117
-0
resourceschedule/resourceschedule_standard/workscheduler/src/main/js/default/test/WorkScheduler.test.js
...kscheduler/src/main/js/default/test/WorkScheduler.test.js
+270
-1
未找到文件。
resourceschedule/resourceschedule_standard/backgroundtaskmanager/src/main/js/default/test/BackgroundTaskMagrJs.test.js
浏览文件 @
df008208
...
...
@@ -180,5 +180,4 @@ describe("TransientTaskJsTest", function () {
}
done
();
})
})
resourceschedule/resourceschedule_standard/backgroundtaskmanager/src/main/js/default/test/ContinuousTaskJsunit.test.js
浏览文件 @
df008208
...
...
@@ -387,4 +387,121 @@ describe("ContinuousTaskJsTest", function () {
particleAbility
.
cancelBackgroundRunning
(
conTaskCallback
);
})
/*
* @tc.name: ContinuousTaskJsTest009
* @tc.desc: test work scheduler constant
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
ContinuousTaskJsTest009
"
,
0
,
function
(
done
)
{
console
.
info
(
'
----------------------ContinuousTaskJsTest009---------------------------
'
);
let
value1
=
backgroundTaskManager
.
BackgroundMode
.
DATA_TRANSFER
;
expect
(
value1
).
assertEqual
(
1
)
done
();
})
/*
* @tc.name: ContinuousTaskJsTest010
* @tc.desc: test work scheduler constant
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
ContinuousTaskJsTest010
"
,
0
,
function
(
done
)
{
console
.
info
(
'
----------------------ContinuousTaskJsTest010---------------------------
'
);
let
value1
=
backgroundTaskManager
.
BackgroundMode
.
AUDIO_PLAYBACK
;
expect
(
value1
).
assertEqual
(
2
)
done
();
})
/*
* @tc.name: ContinuousTaskJsTest011
* @tc.desc: test work scheduler constant
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
ContinuousTaskJsTest011
"
,
0
,
function
(
done
)
{
console
.
info
(
'
----------------------ContinuousTaskJsTest011---------------------------
'
);
let
value1
=
backgroundTaskManager
.
BackgroundMode
.
AUDIO_RECORDING
;
expect
(
value1
).
assertEqual
(
3
)
done
();
})
/*
* @tc.name: ContinuousTaskJsTest012
* @tc.desc: test work scheduler constant
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
ContinuousTaskJsTest012
"
,
0
,
function
(
done
)
{
console
.
info
(
'
----------------------ContinuousTaskJsTest012---------------------------
'
);
let
value1
=
backgroundTaskManager
.
BackgroundMode
.
LOCATION
;
expect
(
value1
).
assertEqual
(
4
)
done
();
})
/*
* @tc.name: ContinuousTaskJsTest013
* @tc.desc: test work scheduler constant
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
ContinuousTaskJsTest013
"
,
0
,
function
(
done
)
{
console
.
info
(
'
----------------------ContinuousTaskJsTest013---------------------------
'
);
let
value1
=
backgroundTaskManager
.
BackgroundMode
.
BLUETOOTH_INTERACTION
;
expect
(
value1
).
assertEqual
(
5
)
done
();
})
/*
* @tc.name: ContinuousTaskJsTest014
* @tc.desc: test work scheduler constant
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
ContinuousTaskJsTest014
"
,
0
,
function
(
done
)
{
console
.
info
(
'
----------------------ContinuousTaskJsTest014---------------------------
'
);
let
value1
=
backgroundTaskManager
.
BackgroundMode
.
MULTI_DEVICE_CONNECTION
;
expect
(
value1
).
assertEqual
(
6
)
done
();
})
/*
* @tc.name: ContinuousTaskJsTest015
* @tc.desc: test work scheduler constant
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
ContinuousTaskJsTest015
"
,
0
,
function
(
done
)
{
console
.
info
(
'
----------------------ContinuousTaskJsTest015---------------------------
'
);
let
value1
=
backgroundTaskManager
.
BackgroundMode
.
WIFI_INTERACTION
;
expect
(
value1
).
assertEqual
(
7
)
done
();
})
/*
* @tc.name: ContinuousTaskJsTest016
* @tc.desc: test work scheduler constant
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
ContinuousTaskJsTest016
"
,
0
,
function
(
done
)
{
console
.
info
(
'
----------------------ContinuousTaskJsTest016---------------------------
'
);
let
value1
=
backgroundTaskManager
.
BackgroundMode
.
VOIP
;
expect
(
value1
).
assertEqual
(
8
)
done
();
})
/*
* @tc.name: ContinuousTaskJsTest017
* @tc.desc: test work scheduler constant
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
ContinuousTaskJsTest017
"
,
0
,
function
(
done
)
{
console
.
info
(
'
----------------------ContinuousTaskJsTest017---------------------------
'
);
let
value1
=
backgroundTaskManager
.
BackgroundMode
.
TASK_KEEPING
;
expect
(
value1
).
assertEqual
(
9
)
done
();
})
})
\ No newline at end of file
resourceschedule/resourceschedule_standard/workscheduler/src/main/js/default/test/WorkScheduler.test.js
浏览文件 @
df008208
...
...
@@ -617,5 +617,274 @@ describe("WorkSchedulerJsTest", function () {
expect
(
value1
).
assertEqual
(
2
)
done
();
})
/*
* @tc.name: WorkSchedulerJsTest032
* @tc.desc: test work scheduler without conditions.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest032
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest032---------------------------
'
);
let
workInfo
=
{
workId
:
5
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
isPersisted
:
true
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
/*
* @tc.name: WorkSchedulerJsTest033
* @tc.desc: test work scheduler without conditions.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest033
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest033---------------------------
'
);
let
workInfo
=
{
workId
:
5
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
isPersisted
:
false
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
/*
* @tc.name: WorkSchedulerJsTest034
* @tc.desc: test work scheduler without conditions.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest034
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest034---------------------------
'
);
let
workInfo
=
{
workId
:
5
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
isCharging
:
true
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
true
)
done
();
})
/*
* @tc.name: WorkSchedulerJsTest035
* @tc.desc: test work scheduler without conditions.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest035
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest035---------------------------
'
);
let
workInfo
=
{
workId
:
5
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
isCharging
:
false
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
/*
* @tc.name: WorkSchedulerJsTest036
* @tc.desc: test work scheduler without conditions.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest036
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest036---------------------------
'
);
let
workInfo
=
{
workId
:
5
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
isRepeat
:
true
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
/*
* @tc.name: WorkSchedulerJsTest037
* @tc.desc: test work scheduler without conditions.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest037
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest037---------------------------
'
);
let
workInfo
=
{
workId
:
5
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
isRepeat
:
false
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
/*
* @tc.name: WorkSchedulerJsTest038
* @tc.desc: test work scheduler without conditions.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest038
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest038---------------------------
'
);
let
workInfo
=
{
workId
:
5
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
isDeepIdle
:
true
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
/*
* @tc.name: WorkSchedulerJsTest039
* @tc.desc: test work scheduler without conditions.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest039
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest039---------------------------
'
);
let
workInfo
=
{
workId
:
5
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
isDeepIdle
:
false
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
/*
* @tc.name: WorkSchedulerJsTest040
* @tc.desc: test work scheduler without conditions.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest040
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest040---------------------------
'
);
let
workInfo
=
{
workId
:
5
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
batteryLevel
:
20
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
/*
* @tc.name: WorkSchedulerJsTest041
* @tc.desc: test work scheduler without conditions.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest041
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest041---------------------------
'
);
let
workInfo
=
{
workId
:
5
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
batteryLevel
:
50
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
/*
* @tc.name: WorkSchedulerJsTest042
* @tc.desc: test work scheduler without conditions.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest042
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest042---------------------------
'
);
let
workInfo
=
{
workId
:
5
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
batteryLevel
:
80
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
/*
* @tc.name: WorkSchedulerJsTest043
* @tc.desc: test work scheduler without conditions.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest043
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest043---------------------------
'
);
let
workInfo
=
{
workId
:
5
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
isRepeat
:
true
,
repeatCycleTime
:
1800000
,
repeatCount
:
2
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
/*
* @tc.name: WorkSchedulerJsTest044
* @tc.desc: test work scheduler without conditions.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest044
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest044---------------------------
'
);
let
workInfo
=
{
workId
:
5
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
isRepeat
:
false
,
repeatCycleTime
:
2400000
,
repeatCount
:
3
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
/*
* @tc.name: WorkSchedulerJsTest045
* @tc.desc: test work scheduler without conditions.
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest045
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest045---------------------------
'
);
let
workInfo
=
{
workId
:
5
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
idleWaitTime
:
3000
,
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
false
)
done
();
})
})
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录