Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
fc11e4ec
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看板
未验证
提交
fc11e4ec
编写于
3月 18, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 18, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2602 new use case
Merge pull request !2602 from 火箭龟/rmds0317
上级
ca8b7a37
cf75f51a
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
753 addition
and
3 deletion
+753
-3
resourceschedule/resourceschedule_standard/backgroundtaskmanager/src/main/js/default/test/BackgroundTaskMagrJs.test.js
...ger/src/main/js/default/test/BackgroundTaskMagrJs.test.js
+23
-0
resourceschedule/resourceschedule_standard/deviceusagestatisticsjsunit/src/main/js/default/test/DeviceUsageStatisticsJsunit.test.js
.../main/js/default/test/DeviceUsageStatisticsJsunit.test.js
+587
-0
resourceschedule/resourceschedule_standard/workscheduler/src/main/js/default/test/WorkScheduler.test.js
...kscheduler/src/main/js/default/test/WorkScheduler.test.js
+143
-3
未找到文件。
resourceschedule/resourceschedule_standard/backgroundtaskmanager/src/main/js/default/test/BackgroundTaskMagrJs.test.js
浏览文件 @
fc11e4ec
...
...
@@ -180,4 +180,27 @@ describe("TransientTaskJsTest", function () {
}
done
();
})
/*
* @tc.name: TransientTaskJsTest006
* @tc.desc: test DelaySuspendInfo actualDealyTime
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
TransientTaskJsTest006
"
,
0
,
async
function
(
done
)
{
function
callback
()
{}
var
info
=
backgroundTaskManager
.
requestSuspendDelay
(
"
test
"
,
callback
);
if
(
info
.
requestId
!=
-
1
)
{
console
.
info
(
'
TransientTaskJsTest006 DelaySuspendInfo actualDealyTime:
'
+
info
.
actualDealyTime
);
expect
(
info
).
assertTrue
();
}
else
{
expect
(
false
).
assertTrue
();
done
();
}
setTimeout
(()
=>
{
done
();
},
500
);
})
})
resourceschedule/resourceschedule_standard/deviceusagestatisticsjsunit/src/main/js/default/test/DeviceUsageStatisticsJsunit.test.js
浏览文件 @
fc11e4ec
此差异已折叠。
点击以展开。
resourceschedule/resourceschedule_standard/workscheduler/src/main/js/default/test/WorkScheduler.test.js
浏览文件 @
fc11e4ec
...
...
@@ -13,6 +13,7 @@
* limitations under the License.
*/
import
workScheduler
from
'
@ohos.workScheduler
'
import
workSchedulerCallback
from
'
@ohos.workSchedulerExtensionAbility
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
...
...
@@ -848,8 +849,8 @@ describe("WorkSchedulerJsTest", function () {
done
();
})
/*
* @tc.name: WorkSchedulerJsTest044
/*
* @tc.name: WorkSchedulerJsTest044
* @tc.desc: test work scheduler without conditions.
* @tc.type: FUNC
* @tc.require:
...
...
@@ -869,7 +870,7 @@ describe("WorkSchedulerJsTest", function () {
done
();
})
/*
/*
* @tc.name: WorkSchedulerJsTest045
* @tc.desc: test work scheduler without conditions.
* @tc.type: FUNC
...
...
@@ -887,4 +888,143 @@ describe("WorkSchedulerJsTest", function () {
expect
(
res
).
assertEqual
(
false
)
done
();
})
/*
* @tc.name: WorkSchedulerJsTest046
* @tc.desc: test workScheduler workInfo networkType
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest046
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest046---------------------------
'
);
let
workInfo
=
{
workId
:
7
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
networkType
:
workScheduler
.
NetworkType
.
NETWORK_TYPE_ANY
}
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
true
)
console
.
info
(
"
workschedulerLog workInfo networkType :
"
+
workInfo
.
networkType
)
done
();
})
/*
* @tc.name: WorkSchedulerJsTest047
* @tc.desc: test workScheduler workInfo ChargingType
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest047
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest047---------------------------
'
);
let
workInfo
=
{
workId
:
5
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
ChargingType
:
workScheduler
.
ChargingType
.
CHARGING_PLUGGED_AC
}
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
true
)
console
.
info
(
"
workschedulerLog workInfo ChargingType :
"
+
workInfo
.
ChargingType
.
CHARGING_PLUGGED_AC
)
done
();
})
/*
* @tc.name: WorkSchedulerJsTest048
* @tc.desc: test workScheduler workInfo BatteryStatus
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest048
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest048---------------------------
'
);
let
workInfo
=
{
workId
:
5
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
batteryStatus
:
workScheduler
.
BatteryStatus
.
BATTERY_STATUS_LOW
}
let
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
true
)
console
.
info
(
"
workschedulerLog workInfo BatteryStatus :
"
+
workInfo
.
BatteryStatus
.
BATTERY_STATUS_LOW
)
done
();
})
/*
* @tc.name: WorkSchedulerJsTest049
* @tc.desc: test workSchedulerExtensionAbility onWorkStart
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest049
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest049---------------------------
'
);
let
workInfo
=
{
workId
:
2
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
}
var
res
=
workScheduler
.
onWorkStart
(
workInfo
);
expect
(
res
).
assertEqual
(
true
)
done
();
})
/*
* @tc.name: WorkSchedulerJsTest050
* @tc.desc: test workSchedulerExtensionAbility onWorkStop
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest050
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest050---------------------------
'
);
let
workInfo
=
{
workId
:
2
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
}
var
res
=
workSchedulerCallback
.
onWorkStart
(
workInfo
);
if
(
res
===
true
)
{
let
stopRes
=
workSchedulerCallback
.
onWorkStop
(
workInfo
,
false
);
except
(
stopRes
).
assertEqual
(
true
)
}
else
{
expect
(
false
).
assertEqual
(
true
)
}
done
();
})
/*
* @tc.name: WorkSchedulerJsTest051
* @tc.desc: test workScheduler bundleName
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest051
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest051---------------------------
'
);
let
workInfo
=
{
workId
:
4
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
true
)
console
.
log
(
'
test workScheduler workInfo bundleName :
'
+
info
.
bundleName
);
done
();
})
/*
* @tc.name: WorkSchedulerJsTest052
* @tc.desc: test workScheduler workInfo abilityName
* @tc.type: FUNC
* @tc.require:
*/
it
(
"
WorkSchedulerJsTest052
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------WorkSchedulerJsTest052---------------------------
'
);
let
workInfo
=
{
workId
:
8
,
bundleName
:
"
ohos.acts.resourceschedule.workscheduler.js.function
"
,
abilityName
:
"
com.mytest.abilityName
"
,
}
var
res
=
workScheduler
.
startWork
(
workInfo
);
expect
(
res
).
assertEqual
(
true
)
console
.
log
(
'
test workScheduler workInfo abilityName :
'
+
info
.
abilityName
);
done
();
})
})
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录