未验证 提交 df008208 编写于 作者: O openharmony_ci 提交者: Gitee

!2250 add case to 3.1release

Merge pull request !2250 from 火箭龟/cherry-pick-1646707403
......@@ -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
......@@ -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.
先完成此消息的编辑!
想要评论请 注册