提交 4672db87 编写于 作者: Q qigongming

master分支下架系统api用例

Signed-off-by: Nqigongming <qigongming@huawei.com>
Change-Id: I13bd9cc540874e949affb24888bbdfaf21b7922c
上级 99d78993
...@@ -2398,514 +2398,4 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -2398,514 +2398,4 @@ describe("DeviceUsageStatisticsJsTest", function () {
done(); done();
}, 500); }, 500);
}) })
/*
* @tc.name: DeviceUsageStatisticsJsTest098
* @tc.desc: test bundleState setBundleGroup bundleName newGroup promise.
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest098", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest098---------------------------');
let bundleName = "ohos.sample.shopping";
let newGroup = bundleState.GroupType.ACTIVE_GROUP_DAILY;
bundleState.setBundleGroup(bundleName, newGroup).then( () => {
console.log('test DeviceUsageStatisticsJsTest098 promise succeeded. ' );
expect(true).assertEqual(true);
}).catch( err => {
console.log('test DeviceUsageStatisticsJsTest098 promise failed. because: ' + err.code);
expect(false).assertEqual(true);
});
setTimeout(()=>{
done();
}, 500);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest099
* @tc.desc: test bundleState setBundleGroup bundleName newGroup callback.
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest099", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest099---------------------------');
let bundleName = "ohos.sample.shopping";
let newGroup = bundleState.GroupType.ACTIVE_GROUP_FIXED;
bundleState.setBundleGroup(bundleName, newGroup, (err) => {
if(err) {
console.log('test DeviceUsageStatisticsJsTest099 callback failed. because: ' + err.code);
expect(err.code).assertEqual(true);
} else {
console.log('test DeviceUsageStatisticsJsTest099 callback succeeded. result: ' );
expect(true).assertEqual(true);
}
});
setTimeout(()=>{
done();
}, 500);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0100
* @tc.desc: test bundleState onBundleGroupChanged callback promise.
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest0100", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest0100---------------------------');
let onBundleGroupChanged = (err,res) =>{
console.log('test DeviceUsageStatisticsJsTest0100 callback success.');
console.log('test DeviceUsageStatisticsJsTest0100 result oldGroup is : ' + res.oldGroup);
console.log('test DeviceUsageStatisticsJsTest0100 result newGroup is : ' + res.newGroup);
console.log('test DeviceUsageStatisticsJsTest0100 result changeReason is : ' + res.newGroup);
console.log('test DeviceUsageStatisticsJsTest0100 result userId is : ' + res.userId);
console.log('test DeviceUsageStatisticsJsTest0100 result bundleName is : ' + res.bundleName);
};
bundleState.registerGroupCallBack(onBundleGroupChanged).then( ()=> {
console.log('test DeviceUsageStatisticsJsTest0100 promise succeeded. ' );
expect(true).assertEqual(true);
}).catch( err => {
console.log('test DeviceUsageStatisticsJsTest0100 promise failed. ' );
expect(false).assertEqual(true);
});
setTimeout(()=>{
done();
}, 500);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0102
* @tc.desc: test bundleState unRegisterGroupCallBack promise.
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest0102", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest0102---------------------------');
bundleState.unRegisterGroupCallBack().then( () => {
console.log('test DeviceUsageStatisticsJsTest0102 promise succeeded. ' );
expect(true).assertEqual(true);
}).catch( err => {
console.log('test DeviceUsageStatisticsJsTest0102 promise failed. because: ' + err.code);
expect(false).assertEqual(true);
});
setTimeout(()=>{
done();
}, 500);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0101
* @tc.desc: test bundleState setBundleGroup callback.
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest0101", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest0101---------------------------');
let onBundleGroupChanged = (err,res) =>{
console.log('test DeviceUsageStatisticsJsTest0101 callback success.');
console.log('test DeviceUsageStatisticsJsTest0101 result oldGroup is : ' + res.oldGroup);
console.log('test DeviceUsageStatisticsJsTest0101 result newGroup is : ' + res.newGroup);
console.log('test DeviceUsageStatisticsJsTest0101 result changeReason is : ' + res.newGroup);
console.log('test DeviceUsageStatisticsJsTest0101 result userId is : ' + res.userId);
console.log('test DeviceUsageStatisticsJsTest0101 result bundleName is : ' + res.bundleName);
};
bundleState.registerGroupCallBack(onBundleGroupChanged, (err)=>{
if(err) {
console.log('test DeviceUsageStatisticsJsTest0101 callback failed, ' );
expect(false).assertEqual(true);
} else {
console.log('test DeviceUsageStatisticsJsTest0101 callback success.');
expect(true).assertEqual(true);
}
});
setTimeout(()=>{
done();
}, 500);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0103
* @tc.desc: test bundleState unRegisterGroupCallBack callback.
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest0103", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest0103---------------------------');
bundleState.unRegisterGroupCallBack((err) => {
if(err) {
console.log('test DeviceUsageStatisticsJsTest0103 callback failed. because: ' + err.code);
expect(false).assertEqual(false);
} else {
console.log('test DeviceUsageStatisticsJsTest0103 callback success.');
expect(true).assertEqual(true);
}
});
setTimeout(()=>{
done();
}, 500);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0104
* @tc.desc: test bundleState queryBundleActiveEventStates promise.
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest0104", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest0104---------------------------');
bundleState.queryBundleActiveEventStates(0, 20000000000000).then( res => {
console.log('test DeviceUsageStatisticsJsTest0104 promise success.');
console.log('test DeviceUsageStatisticsJsTest0104 promise result ' + JSON.stringify(res));
expect(res).assertInstanceOf('Array');
}).catch( err=> {
console.log('test DeviceUsageStatisticsJsTest0104 promise failed, because: ' + err.code);
expect(err.code).assertFalse();
});
setTimeout(()=>{
done();
}, 500);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0105
* @tc.desc: test bundleState queryBundleActiveEventStates callback.
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest0105", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest0105---------------------------');
bundleState.queryBundleActiveEventStates(0, 20000000000000, (err, res) => {
if(err) {
console.log('test DeviceUsageStatisticsJsTest0105 callback failed, because: ' + err.code);
expect(err.code).assertFalse();
} else {
console.log('test DeviceUsageStatisticsJsTest0105 callback success.');
console.log('test DeviceUsageStatisticsJsTest0105 callback result ' + JSON.stringify(res));
expect(res).assertInstanceOf('Array');
}
});
setTimeout(()=>{
done();
}, 500);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0106
* @tc.desc: test bundleState queryAppNotificationNumber promise.
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest0106", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest0106---------------------------');
bundleState.queryAppNotificationNumber(0, 20000000000000).then( res => {
console.log('test DeviceUsageStatisticsJsTest0106 promise success.');
console.log('test DeviceUsageStatisticsJsTest0106 promise result ' + JSON.stringify(res));
expect(res).assertInstanceOf('Array');
}).catch( err=> {
console.log('test DeviceUsageStatisticsJsTest0106 promise failed, because: ' + err.code);
expect(err.code).assertFalse();
});
setTimeout(()=>{
done();
}, 500);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0107
* @tc.desc: test bundleState queryAppNotificationNumber callback.
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest0107", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest0107---------------------------');
bundleState.queryAppNotificationNumber(0, 20000000000000, (err, res) => {
if(err) {
console.log('test DeviceUsageStatisticsJsTest0107 callback failed, because: ' + err.code);
expect(err.code).assertFalse();
} else {
console.log('test DeviceUsageStatisticsJsTest0107 callback success.');
console.log('test DeviceUsageStatisticsJsTest0107 callback result ' + JSON.stringify(res));
expect(res).assertInstanceOf('Array');
}
});
setTimeout(()=>{
done();
}, 500);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0108
* @tc.desc: test bundleState GroupType constant
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest0108", 0, function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest0108---------------------------');
let value1 = bundleState.GroupType.ACTIVE_GROUP_ALIVE;
expect(value1).assertEqual(10)
done();
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0109
* @tc.desc: test bundleState GroupType constant
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest0109", 0, function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest0109---------------------------');
let value1 = bundleState.GroupType.ACTIVE_GROUP_DAILY;
expect(value1).assertEqual(20)
done();
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0110
* @tc.desc: test bundleState GroupType constant
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest0110", 0, function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest0110---------------------------');
let value1 = bundleState.GroupType.ACTIVE_GROUP_FIXED;
expect(value1).assertEqual(30)
done();
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0111
* @tc.desc: test bundleState GroupType constant
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest0111", 0, function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest0111---------------------------');
let value1 = bundleState.GroupType.ACTIVE_GROUP_RARE;
expect(value1).assertEqual(40)
done();
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0112
* @tc.desc: test bundleState GroupType constant
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest0112", 0, function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest0112---------------------------');
let value1 = bundleState.GroupType.ACTIVE_GROUP_LIMIT;
expect(value1).assertEqual(50)
done();
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0113
* @tc.desc: test bundleState GroupType constant
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest0113", 0, function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest0113---------------------------');
let value1 = bundleState.GroupType.ACTIVE_GROUP_NEVER;
expect(value1).assertEqual(60)
done();
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0114
* @tc.desc: test bundleState onBundleGroupChanged callback appUsageOldGroup promise.
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest0114", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest0114---------------------------');
let onBundleGroupChanged = (err,res) =>{
if(res === undefined) {
let res = {
appUsageOldGroup : 20
};
console.info('test DeviceUsageStatisticsJsTest0114 result appUsageOldGroup is : ' +
res.appUsageOldGroup);
} else {
console.log('test DeviceUsageStatisticsJsTest0114 callback success.');
console.log('test DeviceUsageStatisticsJsTest0114 result oldGroup is : ' + res.oldGroup);
console.log('test DeviceUsageStatisticsJsTest0114 result newGroup is : ' + res.newGroup);
console.log('test DeviceUsageStatisticsJsTest0114 result changeReason is : ' + res.newGroup);
console.log('test DeviceUsageStatisticsJsTest0114 result userId is : ' + res.userId);
console.log('test DeviceUsageStatisticsJsTest0114 result bundleName is : ' + res.bundleName);
};
};
bundleState.registerGroupCallBack(onBundleGroupChanged).then( ()=> {
console.log('test DeviceUsageStatisticsJsTest0114 promise succeeded. ' );
expect(true).assertEqual(true);
}).catch( err => {
console.log('test DeviceUsageStatisticsJsTest0114 promise failed. ' );
expect(false).assertEqual(true);
});
setTimeout(()=>{
done();
}, 500);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0115
* @tc.desc: test bundleState onBundleGroupChanged callback appUsageNewGroup promise.
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest0115", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest0115---------------------------');
let onBundleGroupChanged = (err,res) =>{
if(res === undefined) {
let res = {
appUsageNewGroup : 30
};
console.info('test DeviceUsageStatisticsJsTest0115 result appUsageNewGroup is : ' +
res.appUsageNewGroup);
} else {
console.log('test DeviceUsageStatisticsJsTest0115 callback success.');
console.log('test DeviceUsageStatisticsJsTest0115 result oldGroup is : ' + res.oldGroup);
console.log('test DeviceUsageStatisticsJsTest0115 result newGroup is : ' + res.newGroup);
console.log('test DeviceUsageStatisticsJsTest0115 result changeReason is : ' + res.newGroup);
console.log('test DeviceUsageStatisticsJsTest0115 result userId is : ' + res.userId);
console.log('test DeviceUsageStatisticsJsTest0115 result bundleName is : ' + res.bundleName);
}
};
bundleState.unRegisterGroupCallBack().then( () => {
bundleState.registerGroupCallBack(onBundleGroupChanged).then( ()=> {
console.log('test DeviceUsageStatisticsJsTest0115 promise succeeded. ' );
expect(true).assertEqual(true);
}).catch( err => {
console.log('test DeviceUsageStatisticsJsTest0115 promise failed. ' );
expect(false).assertEqual(true);
});
});
setTimeout(()=>{
done();
}, 500);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0116
* @tc.desc: test bundleState onBundleGroupChanged callback useId promise.
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest0116", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest0115---------------------------');
let onBundleGroupChanged = (err,res) =>{
if(res === undefined) {
let res = {
useId : 100
};
console.info('test DeviceUsageStatisticsJsTest0116 result useId is : ' + res.useId);
} else {
console.log('test DeviceUsageStatisticsJsTest0116 callback success.');
console.log('test DeviceUsageStatisticsJsTest0116 result oldGroup is : ' + res.oldGroup);
console.log('test DeviceUsageStatisticsJsTest0116 result newGroup is : ' + res.newGroup);
console.log('test DeviceUsageStatisticsJsTest0116 result changeReason is : ' + res.newGroup);
console.log('test DeviceUsageStatisticsJsTest0116 result userId is : ' + res.userId);
console.log('test DeviceUsageStatisticsJsTest0116 result bundleName is : ' + res.bundleName);
}
};
bundleState.unRegisterGroupCallBack().then( () => {
bundleState.registerGroupCallBack(onBundleGroupChanged).then( ()=> {
console.log('test DeviceUsageStatisticsJsTest0116 promise succeeded. ' );
expect(true).assertEqual(true);
}).catch( err => {
console.log('test DeviceUsageStatisticsJsTest0116 promise failed. ' );
expect(false).assertEqual(true);
});
});
setTimeout(()=>{
done();
}, 500);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0117
* @tc.desc: test bundleState onBundleGroupChanged callback changeReason promise.
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest0117", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest0115---------------------------');
let onBundleGroupChanged = (err,res) =>{
if(res === undefined) {
let res = {
changeReason : 1024
};
console.info('test DeviceUsageStatisticsJsTest0117 result changeReason is : ' +
res.changeReason);
} else {
console.log('test DeviceUsageStatisticsJsTest0116 callback success.');
console.log('test DeviceUsageStatisticsJsTest0116 result oldGroup is : ' + res.oldGroup);
console.log('test DeviceUsageStatisticsJsTest0116 result newGroup is : ' + res.newGroup);
console.log('test DeviceUsageStatisticsJsTest0116 result changeReason is : ' + res.newGroup);
console.log('test DeviceUsageStatisticsJsTest0116 result userId is : ' + res.userId);
console.log('test DeviceUsageStatisticsJsTest0116 result bundleName is : ' + res.bundleName);
}
};
bundleState.unRegisterGroupCallBack().then( () => {
bundleState.registerGroupCallBack(onBundleGroupChanged).then( ()=> {
console.log('test DeviceUsageStatisticsJsTest0117 promise succeeded. ' );
expect(true).assertEqual(true);
}).catch( err => {
console.log('test DeviceUsageStatisticsJsTest0117 promise failed. ' );
expect(false).assertEqual(true);
});
});
setTimeout(()=>{
done();
}, 500);
})
/*
* @tc.name: DeviceUsageStatisticsJsTest0118
* @tc.desc: test bundleState queryBundleActiveEventStates evenId promise.
* @tc.type: FUNC
* @tc.require:
*/
it("DeviceUsageStatisticsJsTest0118", 0, async function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest0118---------------------------');
bundleState.queryBundleActiveEventStates(0, 20000000000000).then( res => {
if(res === undefined) {
let res = {
evenId : {
SYSTEM_UNLOCK : 1
}
};
console.info('test DeviceUsageStatisticsJsTest0118 result evenId is :' + res.evenId.SYSTEM_UNLOCK)
} else {
console.log('test DeviceUsageStatisticsJsTest0118 promise success.');
console.log('test DeviceUsageStatisticsJsTest0118 promise result ' + JSON.stringify(res));
}
expect(res).assertInstanceOf('Array');
}).catch( err=> {
console.log('test DeviceUsageStatisticsJsTest0118 promise failed, because: ' + err.code);
expect(err.code).assertFalse();
});
setTimeout(()=>{
done();
}, 500);
})
}) })
\ No newline at end of file
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
// @ts-nocheck // @ts-nocheck
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index' import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'
import reminderAgent from '@ohos.reminderAgent' import reminderAgent from '@ohos.reminderAgent'
import notification from '@ohos.notification'
describe('ReminderAgentTest', function () { describe('ReminderAgentTest', function () {
...@@ -2109,7 +2110,7 @@ describe('ReminderAgentTest', function () { ...@@ -2109,7 +2110,7 @@ describe('ReminderAgentTest', function () {
*/ */
it("testReminderAgentRequest_079", 0, async function (done) { it("testReminderAgentRequest_079", 0, async function (done) {
console.log('----------------------testReminderAgentRequest_079---------------------------'); console.log('----------------------testReminderAgentRequest_079---------------------------');
let type = notification.SlotType.SERVICE.INFORMATION; let type = notification.SlotType.SERVICE_INFORMATION;
expect(type).assertEqual(2); expect(type).assertEqual(2);
done(); done();
}) })
...@@ -2133,7 +2134,7 @@ describe('ReminderAgentTest', function () { ...@@ -2133,7 +2134,7 @@ describe('ReminderAgentTest', function () {
*/ */
it("testReminderAgentRequest_081", 0, async function (done) { it("testReminderAgentRequest_081", 0, async function (done) {
console.log('----------------------testReminderAgentRequest_081---------------------------'); console.log('----------------------testReminderAgentRequest_081---------------------------');
let type = notificationId.SlotType.OTHER_TYPES; let type = notification.SlotType.OTHER_TYPES;
expect(type).assertEqual(65535); expect(type).assertEqual(65535);
done(); done();
}) })
......
...@@ -949,42 +949,6 @@ describe("WorkSchedulerJsTest", function () { ...@@ -949,42 +949,6 @@ describe("WorkSchedulerJsTest", function () {
done(); done();
}) })
/*
* @tc.name: WorkSchedulerJsTest049
* @tc.desc: test WorkSchedulerExtensoinAbility 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",
}
let res = workScheduler.onWorkStart(workInfo);
expect(res).assertEqual(false);
done();
})*/
/*
* @tc.name: WorkSchedulerJsTest050
* @tc.desc: test WorkSchedulerExtensoinAbility 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",
}
let stopRes = workSchedulerCallback.onWorkStop(workInfo, true);
expect(stopRes).assertEqual(false);
done();
})*/
/* /*
* @tc.name: WorkSchedulerJsTest051 * @tc.name: WorkSchedulerJsTest051
* @tc.desc: test workScheduler bundleName * @tc.desc: test workScheduler bundleName
......
...@@ -16,7 +16,7 @@ import workscheduler from '@ohos.workScheduler' ...@@ -16,7 +16,7 @@ import workscheduler from '@ohos.workScheduler'
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index' import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/index'
describe("WorkSchedulerJsTest", function () { describe("WorkSchedulerPerformanceTest", function () {
console.log("**********WorkScheduler Performance Test Begin**********") console.log("**********WorkScheduler Performance Test Begin**********")
performanceStartWork() performanceStartWork()
performanceStopWork() performanceStopWork()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册