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

!2811 Modify use case

Merge pull request !2811 from 火箭龟/master_323
...@@ -58,7 +58,7 @@ describe("TransientTaskJsTest", function () { ...@@ -58,7 +58,7 @@ describe("TransientTaskJsTest", function () {
it("TransientTaskJsTest001", 0, async function (done) { it("TransientTaskJsTest001", 0, async function (done) {
console.info('----------------------TransientTaskJsTest001---------------------------'); console.info('----------------------TransientTaskJsTest001---------------------------');
function callback() {} function callback() {}
var info = backgroundTaskManager.requestSuspendDelay("test", callback); let info = backgroundTaskManager.requestSuspendDelay("test", callback);
if (info.requestId != -1) { if (info.requestId != -1) {
console.info('TransientTaskJsTest001 backgroundTaskManager success, requestId:' + info.requestId); console.info('TransientTaskJsTest001 backgroundTaskManager success, requestId:' + info.requestId);
expect(true).assertTrue(); expect(true).assertTrue();
...@@ -78,10 +78,10 @@ describe("TransientTaskJsTest", function () { ...@@ -78,10 +78,10 @@ describe("TransientTaskJsTest", function () {
it("TransientTaskJsTest002", 0, async function (done) { it("TransientTaskJsTest002", 0, async function (done) {
console.info('----------------------TransientTaskJsTest002---------------------------'); console.info('----------------------TransientTaskJsTest002---------------------------');
function callback() {} function callback() {}
var info1 = backgroundTaskManager.requestSuspendDelay("test", callback); let info1 = backgroundTaskManager.requestSuspendDelay("test", callback);
var info2 = backgroundTaskManager.requestSuspendDelay("test", callback); let info2 = backgroundTaskManager.requestSuspendDelay("test", callback);
var info3 = backgroundTaskManager.requestSuspendDelay("test", callback); let info3 = backgroundTaskManager.requestSuspendDelay("test", callback);
var info4 = backgroundTaskManager.requestSuspendDelay("test", callback); let info4 = backgroundTaskManager.requestSuspendDelay("test", callback);
if (info4.requestId == -1) { if (info4.requestId == -1) {
console.info('TransientTaskJsTest002 backgroundTaskManager more than three'); console.info('TransientTaskJsTest002 backgroundTaskManager more than three');
expect(true).assertTrue(); expect(true).assertTrue();
...@@ -102,7 +102,7 @@ describe("TransientTaskJsTest", function () { ...@@ -102,7 +102,7 @@ describe("TransientTaskJsTest", function () {
*/ */
it("TransientTaskJsTest003", 0, async function (done) { it("TransientTaskJsTest003", 0, async function (done) {
function callback() {} function callback() {}
var info = backgroundTaskManager.requestSuspendDelay("test", callback); let info = backgroundTaskManager.requestSuspendDelay("test", callback);
if (info.requestId != -1) { if (info.requestId != -1) {
console.info('TransientTaskJsTest003 backgroundTaskManager success, requestId:' + info.requestId); console.info('TransientTaskJsTest003 backgroundTaskManager success, requestId:' + info.requestId);
expect(true).assertTrue(); expect(true).assertTrue();
...@@ -134,7 +134,7 @@ describe("TransientTaskJsTest", function () { ...@@ -134,7 +134,7 @@ describe("TransientTaskJsTest", function () {
*/ */
it("TransientTaskJsTest004", 0, async function (done) { it("TransientTaskJsTest004", 0, async function (done) {
function callback() {} function callback() {}
var info = backgroundTaskManager.requestSuspendDelay("test", callback); let info = backgroundTaskManager.requestSuspendDelay("test", callback);
if (info.requestId != -1) { if (info.requestId != -1) {
console.info('TransientTaskJsTest004 backgroundTaskManager success, requestId:' + info.requestId); console.info('TransientTaskJsTest004 backgroundTaskManager success, requestId:' + info.requestId);
expect(true).assertTrue(); expect(true).assertTrue();
...@@ -169,7 +169,7 @@ describe("TransientTaskJsTest", function () { ...@@ -169,7 +169,7 @@ describe("TransientTaskJsTest", function () {
it("TransientTaskJsTest005", 0, async function (done) { it("TransientTaskJsTest005", 0, async function (done) {
console.info('----------------------TransientTaskJsTest005---------------------------'); console.info('----------------------TransientTaskJsTest005---------------------------');
function callback() {} function callback() {}
var info = backgroundTaskManager.requestSuspendDelay("test", callback); let info = backgroundTaskManager.requestSuspendDelay("test", callback);
if (info.actualDealyTime != -1) { if (info.actualDealyTime != -1) {
console.info('TransientTaskJsTest001 backgroundTaskManager success, actualDealyTime:' + console.info('TransientTaskJsTest001 backgroundTaskManager success, actualDealyTime:' +
info.actualDealyTime); info.actualDealyTime);
...@@ -190,7 +190,7 @@ describe("TransientTaskJsTest", function () { ...@@ -190,7 +190,7 @@ describe("TransientTaskJsTest", function () {
it("TransientTaskJsTest006", 0, async function (done) { it("TransientTaskJsTest006", 0, async function (done) {
console.info('----------------------TransientTaskJsTest006---------------------------'); console.info('----------------------TransientTaskJsTest006---------------------------');
function callback() {} function callback() {}
var info = backgroundTaskManager.requestSuspendDelay("test", callback); let info = backgroundTaskManager.requestSuspendDelay("test", callback);
if (info.requestId != -1) { if (info.requestId != -1) {
console.info('TransientTaskJsTest006 DelaySuspendInfo actualDealyTime:' + console.info('TransientTaskJsTest006 DelaySuspendInfo actualDealyTime:' +
info.actualDealyTime); info.actualDealyTime);
......
...@@ -19,6 +19,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from ' ...@@ -19,6 +19,7 @@ import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from '
describe("DeviceUsageStatisticsJsTest", function () { describe("DeviceUsageStatisticsJsTest", function () {
beforeAll(function() { beforeAll(function() {
/* /*
* @tc.setup: setup invoked before all testcases * @tc.setup: setup invoked before all testcases
*/ */
...@@ -26,6 +27,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -26,6 +27,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
}) })
afterAll(function() { afterAll(function() {
/* /*
* @tc.teardown: teardown invoked after all testcases * @tc.teardown: teardown invoked after all testcases
*/ */
...@@ -33,6 +35,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -33,6 +35,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
}) })
beforeEach(function() { beforeEach(function() {
/* /*
* @tc.setup: setup invoked before each testcases * @tc.setup: setup invoked before each testcases
*/ */
...@@ -40,6 +43,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -40,6 +43,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
}) })
afterEach(function() { afterEach(function() {
/* /*
* @tc.teardown: teardown invoked after each testcases * @tc.teardown: teardown invoked after each testcases
*/ */
...@@ -50,7 +54,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -50,7 +54,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
* @tc.name: DeviceUsageStatisticsJsTest001 * @tc.name: DeviceUsageStatisticsJsTest001
* @tc.desc: test isIdleState promise. * @tc.desc: test isIdleState promise.
* @tc.type: FUNC * @tc.type: FUNC
* @tc.require: SR000GGTN7 AR000GH89H AR000GH89I AR000GH899 * @tc.require:
*/ */
it("DeviceUsageStatisticsJsTest001", 0, async function (done) { it("DeviceUsageStatisticsJsTest001", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest001---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest001---------------------------');
...@@ -72,7 +76,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -72,7 +76,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
* @tc.name: DeviceUsageStatisticsJsTest002 * @tc.name: DeviceUsageStatisticsJsTest002
* @tc.desc: test isIdleState callback. * @tc.desc: test isIdleState callback.
* @tc.type: FUNC * @tc.type: FUNC
* @tc.require: SR000GGTN7 AR000GH89E AR000GH89F AR000GH89G * @tc.require:
*/ */
it("DeviceUsageStatisticsJsTest002", 0, async function (done) { it("DeviceUsageStatisticsJsTest002", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest002---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest002---------------------------');
...@@ -96,7 +100,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -96,7 +100,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
* @tc.name: DeviceUsageStatisticsJsTest003 * @tc.name: DeviceUsageStatisticsJsTest003
* @tc.desc: test queryAppUsagePriorityGroup promise. * @tc.desc: test queryAppUsagePriorityGroup promise.
* @tc.type: FUNC * @tc.type: FUNC
* @tc.require: SR000GGTN7 AR000GH89H AR000GH89I AR000GH899 * @tc.require:
*/ */
it("DeviceUsageStatisticsJsTest003", 0, async function (done) { it("DeviceUsageStatisticsJsTest003", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest003---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest003---------------------------');
...@@ -117,7 +121,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -117,7 +121,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
* @tc.name: DeviceUsageStatisticsJsTest004 * @tc.name: DeviceUsageStatisticsJsTest004
* @tc.desc: test queryAppUsagePriorityGroup callback. * @tc.desc: test queryAppUsagePriorityGroup callback.
* @tc.type: FUNC * @tc.type: FUNC
* @tc.require: SR000GGTN7 AR000GH89E AR000GH89F AR000GH89G * @tc.require:
*/ */
it("DeviceUsageStatisticsJsTest004", 0, async function (done) { it("DeviceUsageStatisticsJsTest004", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest004---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest004---------------------------');
...@@ -140,7 +144,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -140,7 +144,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
* @tc.name: DeviceUsageStatisticsJsTest005 * @tc.name: DeviceUsageStatisticsJsTest005
* @tc.desc: test queryBundleActiveStates promise. * @tc.desc: test queryBundleActiveStates promise.
* @tc.type: FUNC * @tc.type: FUNC
* @tc.require: SR000GGTN7 AR000GH89H AR000GH89I AR000GH899 * @tc.require:
*/ */
it("DeviceUsageStatisticsJsTest005", 0, async function (done) { it("DeviceUsageStatisticsJsTest005", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest005---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest005---------------------------');
...@@ -163,7 +167,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -163,7 +167,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
* @tc.name: DeviceUsageStatisticsJsTest006 * @tc.name: DeviceUsageStatisticsJsTest006
* @tc.desc: test queryBundleActiveStates callback. * @tc.desc: test queryBundleActiveStates callback.
* @tc.type: FUNC * @tc.type: FUNC
* @tc.require: SR000GGTN7 AR000GH89E AR000GH89F AR000GH89G * @tc.require:
*/ */
it("DeviceUsageStatisticsJsTest006", 0, async function (done) { it("DeviceUsageStatisticsJsTest006", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest006---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest006---------------------------');
...@@ -188,7 +192,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -188,7 +192,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
* @tc.name: DeviceUsageStatisticsJsTest007 * @tc.name: DeviceUsageStatisticsJsTest007
* @tc.desc: test queryBundleStateInfos promise. * @tc.desc: test queryBundleStateInfos promise.
* @tc.type: FUNC * @tc.type: FUNC
* @tc.require: SR000GGTN7 AR000GH89H AR000GH89I AR000GH899 * @tc.require:
*/ */
it("DeviceUsageStatisticsJsTest007", 0, async function (done) { it("DeviceUsageStatisticsJsTest007", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest007---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest007---------------------------');
...@@ -211,7 +215,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -211,7 +215,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
* @tc.name: DeviceUsageStatisticsJsTest008 * @tc.name: DeviceUsageStatisticsJsTest008
* @tc.desc: test queryBundleStateInfos callback. * @tc.desc: test queryBundleStateInfos callback.
* @tc.type: FUNC * @tc.type: FUNC
* @tc.require: SR000GGTN7 AR000GH89E AR000GH89F AR000GH89G * @tc.require:
*/ */
it("DeviceUsageStatisticsJsTest008", 0, async function (done) { it("DeviceUsageStatisticsJsTest008", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest008---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest008---------------------------');
...@@ -236,7 +240,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -236,7 +240,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
* @tc.name: DeviceUsageStatisticsJsTest009 * @tc.name: DeviceUsageStatisticsJsTest009
* @tc.desc: test queryCurrentBundleActiveStates promise. * @tc.desc: test queryCurrentBundleActiveStates promise.
* @tc.type: FUNC * @tc.type: FUNC
* @tc.require: SR000GGTN7 AR000GH89H AR000GH89I AR000GH899 * @tc.require:
*/ */
it("DeviceUsageStatisticsJsTest009", 0, async function (done) { it("DeviceUsageStatisticsJsTest009", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest009---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest009---------------------------');
...@@ -259,7 +263,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -259,7 +263,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
* @tc.name: DeviceUsageStatisticsJsTest010 * @tc.name: DeviceUsageStatisticsJsTest010
* @tc.desc: test queryCurrentBundleActiveStates callback. * @tc.desc: test queryCurrentBundleActiveStates callback.
* @tc.type: FUNC * @tc.type: FUNC
* @tc.require: SR000GGTN7 AR000GH89E AR000GH89F AR000GH89G * @tc.require:
*/ */
it("DeviceUsageStatisticsJsTest010", 0, async function (done) { it("DeviceUsageStatisticsJsTest010", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest010---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest010---------------------------');
...@@ -284,7 +288,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -284,7 +288,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
* @tc.name: DeviceUsageStatisticsJsTest011 * @tc.name: DeviceUsageStatisticsJsTest011
* @tc.desc: test queryBundleStateInfoByInterval promise. * @tc.desc: test queryBundleStateInfoByInterval promise.
* @tc.type: FUNC * @tc.type: FUNC
* @tc.require: SR000GGTN7 AR000GH89H AR000GH89I AR000GH899 * @tc.require:
*/ */
it("DeviceUsageStatisticsJsTest011", 0, async function (done) { it("DeviceUsageStatisticsJsTest011", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest011---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest011---------------------------');
...@@ -308,7 +312,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -308,7 +312,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
* @tc.name: DeviceUsageStatisticsJsTest012 * @tc.name: DeviceUsageStatisticsJsTest012
* @tc.desc: test queryBundleStateInfoByInterval callback. * @tc.desc: test queryBundleStateInfoByInterval callback.
* @tc.type: FUNC * @tc.type: FUNC
* @tc.require: SR000GGTN7 AR000GH89E AR000GH89F AR000GH89G * @tc.require:
*/ */
it("DeviceUsageStatisticsJsTest012", 0, async function (done) { it("DeviceUsageStatisticsJsTest012", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest012---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest012---------------------------');
......
...@@ -63,7 +63,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -63,7 +63,7 @@ describe("WorkSchedulerJsTest", function () {
bundleName: "ohos.acts.resourceschedule.workscheduler.js.function", bundleName: "ohos.acts.resourceschedule.workscheduler.js.function",
abilityName: "com.mytest.abilityName" abilityName: "com.mytest.abilityName"
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(false) expect(res).assertEqual(false)
done(); done();
}) })
...@@ -82,7 +82,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -82,7 +82,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(true) expect(res).assertEqual(true)
done(); done();
}) })
...@@ -100,7 +100,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -100,7 +100,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(false) expect(res).assertEqual(false)
done(); done();
}) })
...@@ -118,7 +118,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -118,7 +118,7 @@ describe("WorkSchedulerJsTest", function () {
bundleName: "ohos.acts.resourceschedule.workscheduler.js.function", bundleName: "ohos.acts.resourceschedule.workscheduler.js.function",
storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(false) expect(res).assertEqual(false)
done(); done();
}) })
...@@ -136,7 +136,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -136,7 +136,7 @@ describe("WorkSchedulerJsTest", function () {
bundleName: "ohos.acts.resourceschedule.workscheduler.js.function", bundleName: "ohos.acts.resourceschedule.workscheduler.js.function",
abilityName: "com.mytest.abilityName" abilityName: "com.mytest.abilityName"
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(false) expect(res).assertEqual(false)
done(); done();
}) })
...@@ -155,7 +155,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -155,7 +155,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(true) expect(res).assertEqual(true)
done(); done();
}) })
...@@ -174,9 +174,9 @@ describe("WorkSchedulerJsTest", function () { ...@@ -174,9 +174,9 @@ describe("WorkSchedulerJsTest", function () {
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
if (res == true) { if (res == true) {
var stopRes = workScheduler.stopWork(workInfo, false); let stopRes = workScheduler.stopWork(workInfo, false);
expect(stopRes).assertEqual(true) expect(stopRes).assertEqual(true)
} else { } else {
expect(false).assertEqual(true) expect(false).assertEqual(true)
...@@ -198,9 +198,9 @@ describe("WorkSchedulerJsTest", function () { ...@@ -198,9 +198,9 @@ describe("WorkSchedulerJsTest", function () {
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
if (res == true) { if (res == true) {
var stopRes = workScheduler.stopWork(workInfo, false); let stopRes = workScheduler.stopWork(workInfo, false);
expect(stopRes).assertEqual(true) expect(stopRes).assertEqual(true)
} else { } else {
expect(false).assertEqual(true) expect(false).assertEqual(true)
...@@ -222,7 +222,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -222,7 +222,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
if (res == false) { if (res == false) {
expect(false).assertEqual(true) expect(false).assertEqual(true)
done(); done();
...@@ -257,7 +257,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -257,7 +257,7 @@ describe("WorkSchedulerJsTest", function () {
storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY, storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY,
batteryLevel: 15 batteryLevel: 15
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
if (res == false) { if (res == false) {
expect(false).assertEqual(true) expect(false).assertEqual(true)
done(); done();
...@@ -291,7 +291,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -291,7 +291,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
if (res == false) { if (res == false) {
expect(false).assertEqual(true) expect(false).assertEqual(true)
done(); done();
...@@ -326,7 +326,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -326,7 +326,7 @@ describe("WorkSchedulerJsTest", function () {
storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY, storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY,
batteryLevel: 15 batteryLevel: 15
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
if (res == false) { if (res == false) {
expect(false).assertEqual(true) expect(false).assertEqual(true)
done(); done();
...@@ -359,9 +359,9 @@ describe("WorkSchedulerJsTest", function () { ...@@ -359,9 +359,9 @@ describe("WorkSchedulerJsTest", function () {
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY storageRequest: workScheduler.StorageRequest.STORAGE_LEVEL_OKAY
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
if (res == true) { if (res == true) {
var stopRes = workScheduler.stopAndClearWorks(); let stopRes = workScheduler.stopAndClearWorks();
expect(stopRes).assertEqual(true) expect(stopRes).assertEqual(true)
} else { } else {
expect(false).assertEqual(true) expect(false).assertEqual(true)
...@@ -633,7 +633,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -633,7 +633,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
isPersisted: true isPersisted: true
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(false) expect(res).assertEqual(false)
done(); done();
}) })
...@@ -652,7 +652,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -652,7 +652,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
isPersisted: false isPersisted: false
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(false) expect(res).assertEqual(false)
done(); done();
}) })
...@@ -671,7 +671,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -671,7 +671,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
isCharging: true isCharging: true
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(true) expect(res).assertEqual(true)
done(); done();
}) })
...@@ -690,7 +690,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -690,7 +690,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
isCharging: false isCharging: false
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(false) expect(res).assertEqual(false)
done(); done();
}) })
...@@ -709,7 +709,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -709,7 +709,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
isRepeat: true isRepeat: true
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(false) expect(res).assertEqual(false)
done(); done();
}) })
...@@ -728,7 +728,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -728,7 +728,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
isRepeat: false isRepeat: false
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(false) expect(res).assertEqual(false)
done(); done();
}) })
...@@ -747,7 +747,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -747,7 +747,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
isDeepIdle: true isDeepIdle: true
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(false) expect(res).assertEqual(false)
done(); done();
}) })
...@@ -766,7 +766,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -766,7 +766,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
isDeepIdle: false isDeepIdle: false
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(false) expect(res).assertEqual(false)
done(); done();
}) })
...@@ -785,7 +785,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -785,7 +785,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
batteryLevel: 20 batteryLevel: 20
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(false) expect(res).assertEqual(false)
done(); done();
}) })
...@@ -804,7 +804,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -804,7 +804,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
batteryLevel: 50 batteryLevel: 50
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(false) expect(res).assertEqual(false)
done(); done();
}) })
...@@ -823,7 +823,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -823,7 +823,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
batteryLevel: 80 batteryLevel: 80
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(false) expect(res).assertEqual(false)
done(); done();
}) })
...@@ -844,7 +844,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -844,7 +844,7 @@ describe("WorkSchedulerJsTest", function () {
repeatCycleTime: 1800000, repeatCycleTime: 1800000,
repeatCount: 2 repeatCount: 2
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(false) expect(res).assertEqual(false)
done(); done();
}) })
...@@ -865,7 +865,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -865,7 +865,7 @@ describe("WorkSchedulerJsTest", function () {
repeatCycleTime: 2400000, repeatCycleTime: 2400000,
repeatCount: 3 repeatCount: 3
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(false) expect(res).assertEqual(false)
done(); done();
}) })
...@@ -884,7 +884,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -884,7 +884,7 @@ describe("WorkSchedulerJsTest", function () {
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
idleWaitTime: 3000, idleWaitTime: 3000,
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(false) expect(res).assertEqual(false)
done(); done();
}) })
...@@ -962,7 +962,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -962,7 +962,7 @@ describe("WorkSchedulerJsTest", function () {
bundleName: "ohos.acts.resourceschedule.workscheduler.js.function", bundleName: "ohos.acts.resourceschedule.workscheduler.js.function",
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
} }
var res = workScheduler.onWorkStart(workInfo); let res = workScheduler.onWorkStart(workInfo);
expect(res).assertEqual(false); expect(res).assertEqual(false);
done(); done();
})*/ })*/
...@@ -980,7 +980,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -980,7 +980,7 @@ describe("WorkSchedulerJsTest", function () {
bundleName: "ohos.acts.resourceschedule.workscheduler.js.function", bundleName: "ohos.acts.resourceschedule.workscheduler.js.function",
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
} }
var stopRes = workSchedulerCallback.onWorkStop(workInfo, true); let stopRes = workSchedulerCallback.onWorkStop(workInfo, true);
expect(stopRes).assertEqual(false); expect(stopRes).assertEqual(false);
done(); done();
})*/ })*/
...@@ -998,7 +998,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -998,7 +998,7 @@ describe("WorkSchedulerJsTest", function () {
bundleName: "ohos.acts.resourceschedule.workscheduler.js.function", bundleName: "ohos.acts.resourceschedule.workscheduler.js.function",
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(false); expect(res).assertEqual(false);
console.log("workScheduler workInfo bundleName :" + workInfo.bundleName); console.log("workScheduler workInfo bundleName :" + workInfo.bundleName);
done(); done();
...@@ -1017,7 +1017,7 @@ describe("WorkSchedulerJsTest", function () { ...@@ -1017,7 +1017,7 @@ describe("WorkSchedulerJsTest", function () {
bundleName: "ohos.acts.resourceschedule.workscheduler.js.function", bundleName: "ohos.acts.resourceschedule.workscheduler.js.function",
abilityName: "com.mytest.abilityName", abilityName: "com.mytest.abilityName",
} }
var res = workScheduler.startWork(workInfo); let res = workScheduler.startWork(workInfo);
expect(res).assertEqual(false); expect(res).assertEqual(false);
console.log("test workScheduler workInfo abilityName :" + workInfo.abilityName); console.log("test workScheduler workInfo abilityName :" + workInfo.abilityName);
done(); done();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册