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

!2694 new use case

Merge pull request !2694 from 火箭龟/mas321_1
...@@ -19,7 +19,7 @@ ohos_js_hap_suite("resourceschedule_deviceusagestatisticsjsunit_js_test") { ...@@ -19,7 +19,7 @@ ohos_js_hap_suite("resourceschedule_deviceusagestatisticsjsunit_js_test") {
":resourceschedule_js_assets", ":resourceschedule_js_assets",
":resourceschedule_js_resources", ":resourceschedule_js_resources",
] ]
certificate_profile = "./signature/openharmony_sx.p7b" certificate_profile = "./signature/ohos_device_usage_statistics.p7b"
hap_name = "ActsResourcescheduleDeviceUsageStatisticsJsunitTest" hap_name = "ActsResourcescheduleDeviceUsageStatisticsJsunitTest"
} }
ohos_js_assets("resourceschedule_js_assets") { ohos_js_assets("resourceschedule_js_assets") {
......
...@@ -55,6 +55,16 @@ ...@@ -55,6 +55,16 @@
"autoDesignWidth": false "autoDesignWidth": false
} }
} }
],
"defPermissions": [
{
"name": "ohos.permission.BUNDLE_ACTIVE_INFO"
}
],
"reqPermissions": [
{
"name": "ohos.permission.BUNDLE_ACTIVE_INFO"
}
] ]
} }
} }
...@@ -338,7 +338,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -338,7 +338,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
*/ */
it("DeviceUsageStatisticsJsTest013", 0, function (done) { it("DeviceUsageStatisticsJsTest013", 0, function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest013---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest013---------------------------');
let value1 = bundleState.intervalType.BY_OPTIMIZED; let value1 = bundleState.IntervalType.BY_OPTIMIZED;
expect(value1).assertEqual(0) expect(value1).assertEqual(0)
done(); done();
}) })
...@@ -351,7 +351,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -351,7 +351,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
*/ */
it("DeviceUsageStatisticsJsTest014", 0, function (done) { it("DeviceUsageStatisticsJsTest014", 0, function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest014---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest014---------------------------');
let value1 = bundleState.intervalType.BY_DAILY; let value1 = bundleState.IntervalType.BY_DAILY;
expect(value1).assertEqual(1) expect(value1).assertEqual(1)
done(); done();
}) })
...@@ -364,7 +364,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -364,7 +364,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
*/ */
it("DeviceUsageStatisticsJsTest015", 0, function (done) { it("DeviceUsageStatisticsJsTest015", 0, function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest015---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest015---------------------------');
let value1 = bundleState.intervalType.BY_WEEKLY; let value1 = bundleState.IntervalType.BY_WEEKLY;
expect(value1).assertEqual(2) expect(value1).assertEqual(2)
done(); done();
}) })
...@@ -377,7 +377,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -377,7 +377,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
*/ */
it("DeviceUsageStatisticsJsTest016", 0, function (done) { it("DeviceUsageStatisticsJsTest016", 0, function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest016---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest016---------------------------');
let value1 = bundleState.intervalType.BY_MONTHLY; let value1 = bundleState.IntervalType.BY_MONTHLY;
expect(value1).assertEqual(3) expect(value1).assertEqual(3)
done(); done();
}) })
...@@ -390,7 +390,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -390,7 +390,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
*/ */
it("DeviceUsageStatisticsJsTest017", 0, function (done) { it("DeviceUsageStatisticsJsTest017", 0, function (done) {
console.info('----------------------DeviceUsageStatisticsJsTest017---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest017---------------------------');
let value1 = bundleState.intervalType.BY_ANNUALLY; let value1 = bundleState.IntervalType.BY_ANNUALLY;
expect(value1).assertEqual(4) expect(value1).assertEqual(4)
done(); done();
}) })
...@@ -685,7 +685,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -685,7 +685,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
console.info('----------------------DeviceUsageStatisticsJsTest028---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest028---------------------------');
let beginTime = 10; let beginTime = 10;
let endTime = 20000000000000; let endTime = 20000000000000;
bundleState.queryCurrentBundleActiveStates(beginTime, endTime, (err, res) => { bundleState.queryBundleActiveStates(beginTime, endTime, (err, res) => {
if(err.code === 0) { if(err.code === 0) {
expect(true).assertEqual(true); expect(true).assertEqual(true);
if(res === undefined) { if(res === undefined) {
...@@ -712,7 +712,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -712,7 +712,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
console.info('----------------------DeviceUsageStatisticsJsTest029---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest029---------------------------');
let beginTime = 10; let beginTime = 10;
let endTime = 20000000000000; let endTime = 20000000000000;
bundleState.queryCurrentBundleActiveStates(beginTime, endTime, (err, res) => { bundleState.queryBundleActiveStates(beginTime, endTime, (err, res) => {
if(err.code === 0) { if(err.code === 0) {
expect(true).assertEqual(true); expect(true).assertEqual(true);
if(res === undefined) { if(res === undefined) {
...@@ -739,7 +739,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -739,7 +739,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
console.info('----------------------DeviceUsageStatisticsJsTest030---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest030---------------------------');
let beginTime = 10; let beginTime = 10;
let endTime = 20000000000000; let endTime = 20000000000000;
bundleState.queryCurrentBundleActiveStates(beginTime, endTime, (err, res) => { bundleState.queryBundleActiveStates(beginTime, endTime, (err, res) => {
if(err.code === 0) { if(err.code === 0) {
expect(true).assertEqual(true); expect(true).assertEqual(true);
if(res === undefined) { if(res === undefined) {
...@@ -766,7 +766,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -766,7 +766,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
console.info('----------------------DeviceUsageStatisticsJsTest031---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest031---------------------------');
let beginTime = 10; let beginTime = 10;
let endTime = 20000000000000; let endTime = 20000000000000;
bundleState.queryCurrentBundleActiveStates(beginTime, endTime, (err, res) => { bundleState.queryBundleActiveStates(beginTime, endTime, (err, res) => {
if(err.code === 0) { if(err.code === 0) {
expect(true).assertEqual(true); expect(true).assertEqual(true);
if(res === undefined) { if(res === undefined) {
...@@ -793,7 +793,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -793,7 +793,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
console.info('----------------------DeviceUsageStatisticsJsTest032---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest032---------------------------');
let beginTime = 10; let beginTime = 10;
let endTime = 20000000000000; let endTime = 20000000000000;
bundleState.queryCurrentBundleActiveStates(beginTime, endTime, (err, res) => { bundleState.queryBundleActiveStates(beginTime, endTime, (err, res) => {
if(err.code === 0) { if(err.code === 0) {
expect(true).assertEqual(true); expect(true).assertEqual(true);
if(res === undefined) { if(res === undefined) {
...@@ -820,7 +820,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -820,7 +820,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
console.info('----------------------DeviceUsageStatisticsJsTest033---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest033---------------------------');
let beginTime = 10; let beginTime = 10;
let endTime = 20000000000000; let endTime = 20000000000000;
bundleState.queryCurrentBundleActiveStates(beginTime, endTime, (err, res) => { bundleState.queryBundleActiveStates(beginTime, endTime, (err, res) => {
if(err.code === 0) { if(err.code === 0) {
expect(true).assertEqual(true); expect(true).assertEqual(true);
if(res === undefined) { if(res === undefined) {
...@@ -847,7 +847,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -847,7 +847,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
console.info('----------------------DeviceUsageStatisticsJsTest034---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest034---------------------------');
let beginTime = 10; let beginTime = 10;
let endTime = 20000000000000; let endTime = 20000000000000;
bundleState.queryCurrentBundleActiveStates(beginTime, endTime).then((res) => { bundleState.queryBundleStateInfos(beginTime, endTime).then((res) => {
expect(true).assertEqual(true); expect(true).assertEqual(true);
let bundleStateInfo1 = { let bundleStateInfo1 = {
bundleName: 'www.explace.com', bundleName: 'www.explace.com',
...@@ -886,7 +886,7 @@ describe("DeviceUsageStatisticsJsTest", function () { ...@@ -886,7 +886,7 @@ describe("DeviceUsageStatisticsJsTest", function () {
console.info('----------------------DeviceUsageStatisticsJsTest035---------------------------'); console.info('----------------------DeviceUsageStatisticsJsTest035---------------------------');
let beginTime = 1001; let beginTime = 1001;
let endTime = 20000000000000; let endTime = 20000000000000;
bundleState.queryCurrentBundleActiveStates(0, beginTime, endTime, (err, res) => { bundleState.queryBundleStateInfoByInterval(0, beginTime, endTime, (err, res) => {
if(err.code === 0) { if(err.code === 0) {
expect(true).assertEqual(true); expect(true).assertEqual(true);
if(res === undefined) { if(res === undefined) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册