Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
b2f118c6
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看板
未验证
提交
b2f118c6
编写于
3月 07, 2023
作者:
O
openharmony_ci
提交者:
Gitee
3月 07, 2023
浏览文件
操作
浏览文件
下载
差异文件
!7821 【resourceschedule】【monthly_20221018】下线信息查询新增系统api用例&提醒代理模块api8用例优化
Merge pull request !7821 from 南先森/cherry-pick-1677924491
上级
0e50b772
390fb07e
变更
26
显示空白变更内容
内联
并排
Showing
26 changed file
with
464 addition
and
498 deletion
+464
-498
resourceschedule/resourceschedule_standard/BUILD.gn
resourceschedule/resourceschedule_standard/BUILD.gn
+1
-0
resourceschedule/resourceschedule_standard/deviceusagestatisticsjsunit/src/main/js/test/List.test.js
...deviceusagestatisticsjsunit/src/main/js/test/List.test.js
+1
-2
resourceschedule/resourceschedule_standard/deviceusagestatisticsjsunit/src/main/js/test/UsageStatistics.test.js
...statisticsjsunit/src/main/js/test/UsageStatistics.test.js
+0
-491
resourceschedule/resourceschedule_standard/reminderagent/src/main/js/test/List.test.js
...dule_standard/reminderagent/src/main/js/test/List.test.js
+1
-2
resourceschedule/resourceschedule_standard/reminderagent/src/main/js/test/ReminderAgentJs.test.js
...rd/reminderagent/src/main/js/test/ReminderAgentJs.test.js
+5
-3
resourceschedule/resourceschedule_standard/reminderagentManager/BUILD.gn
...e/resourceschedule_standard/reminderagentManager/BUILD.gn
+35
-0
resourceschedule/resourceschedule_standard/reminderagentManager/Test.json
.../resourceschedule_standard/reminderagentManager/Test.json
+19
-0
resourceschedule/resourceschedule_standard/reminderagentManager/signature/openharmony_sx.p7b
...tandard/reminderagentManager/signature/openharmony_sx.p7b
+0
-0
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/config.json
...hedule_standard/reminderagentManager/src/main/config.json
+107
-0
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/MainAbility/app.js
...ndard/reminderagentManager/src/main/js/MainAbility/app.js
+23
-0
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/MainAbility/i18n/en-US.json
...inderagentManager/src/main/js/MainAbility/i18n/en-US.json
+6
-0
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/MainAbility/i18n/zh-CN.json
...inderagentManager/src/main/js/MainAbility/i18n/zh-CN.json
+6
-0
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/MainAbility/pages/index/index.css
...gentManager/src/main/js/MainAbility/pages/index/index.css
+9
-0
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/MainAbility/pages/index/index.hml
...gentManager/src/main/js/MainAbility/pages/index/index.hml
+5
-0
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/MainAbility/pages/index/index.js
...agentManager/src/main/js/MainAbility/pages/index/index.js
+32
-0
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/TestAbility/app.js
...ndard/reminderagentManager/src/main/js/TestAbility/app.js
+31
-0
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/TestAbility/i18n/en-US.json
...inderagentManager/src/main/js/TestAbility/i18n/en-US.json
+8
-0
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/TestAbility/i18n/zh-CN.json
...inderagentManager/src/main/js/TestAbility/i18n/zh-CN.json
+8
-0
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/TestAbility/pages/index/index.css
...gentManager/src/main/js/TestAbility/pages/index/index.css
+30
-0
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/TestAbility/pages/index/index.hml
...gentManager/src/main/js/TestAbility/pages/index/index.hml
+5
-0
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/TestAbility/pages/index/index.js
...agentManager/src/main/js/TestAbility/pages/index/index.js
+26
-0
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/TestRunner/OpenHarmonyTestRunner.js
...ntManager/src/main/js/TestRunner/OpenHarmonyTestRunner.js
+59
-0
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/test/List.test.js
...andard/reminderagentManager/src/main/js/test/List.test.js
+19
-0
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/test/ReminderAgentManagerJs.test.js
...ntManager/src/main/js/test/ReminderAgentManagerJs.test.js
+0
-0
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/resources/base/element/string.json
...ragentManager/src/main/resources/base/element/string.json
+28
-0
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/resources/base/media/icon.png
...minderagentManager/src/main/resources/base/media/icon.png
+0
-0
未找到文件。
resourceschedule/resourceschedule_standard/BUILD.gn
浏览文件 @
b2f118c6
...
...
@@ -21,6 +21,7 @@ group("resourceschedule_standard") {
"continuoustaskrelyhap:ContinuousTaskRelyHap",
"deviceusagestatisticsjsunit:resourceschedule_deviceusagestatisticsjsunit_js_test",
"reminderagent:resourceschedule_reminderagent_js_test",
"reminderagentManager:resourceschedule_reminderagentmgr_js_test",
"workscheduler:resourceschedule_workscheduler_js_test",
]
}
...
...
resourceschedule/resourceschedule_standard/deviceusagestatisticsjsunit/src/main/js/test/List.test.js
浏览文件 @
b2f118c6
...
...
@@ -14,9 +14,8 @@
*/
import
bundlestate_test
from
'
./BundleState.test.js
'
import
DeviceUsageStatisticsJsTest
from
'
./DeviceUsageStatisticsJsunit.test.js
'
import
UsageStatisticsTest
from
'
./UsageStatistics.test.js
'
export
default
function
testsuite
()
{
bundlestate_test
()
DeviceUsageStatisticsJsTest
()
UsageStatisticsTest
()
}
resourceschedule/resourceschedule_standard/deviceusagestatisticsjsunit/src/main/js/test/UsageStatistics.test.js
已删除
100644 → 0
浏览文件 @
0e50b772
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
usageStatistics
from
'
@ohos.resourceschedule.usageStatistics
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
export
default
function
UsageStatistics
()
{
describe
(
"
UsageStatistics
"
,
function
()
{
beforeAll
(
function
()
{
/*
* @tc.setup: setup invoked before all testcases
*/
console
.
info
(
'
beforeAll called
'
)
})
afterAll
(
function
()
{
/*
* @tc.teardown: teardown invoked after all testcases
*/
console
.
info
(
'
afterAll called
'
)
})
beforeEach
(
function
()
{
/*
* @tc.setup: setup invoked before each testcases
*/
console
.
info
(
'
beforeEach called
'
)
})
afterEach
(
function
()
{
/*
* @tc.teardown: teardown invoked after each testcases
*/
console
.
info
(
'
afterEach caled
'
)
})
/*
* @tc.number:SUB_RESOURCESCHEDULE_USAGEINFO_QUERY_XTS_0025
* @tc.name: UsageStatistics001
* @tc.desc: test isIdleState promise.
*/
it
(
"
UsageStatistics001
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------UsageStatistics001---------------------------
'
);
let
bundleName
=
'
ohos.acts.resourceschedule.deviceusagestatisticsjsunit.js.function
'
;
try
{
usageStatistics
.
isIdleState
(
bundleName
).
then
((
res
)
=>
{
console
.
info
(
'
test UsageStatistics001 isIdleState promise success.
'
+
res
);
expect
(
res
).
assertFalse
();
done
()
}).
catch
((
err
)
=>
{
console
.
info
(
'
test UsageStatistics001 isIdleState promise failure.
'
+
err
.
code
);
});
}
catch
(
error
)
{
console
.
info
(
'
isIdleState throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
}
})
/*
* @tc.number:SUB_RESOURCESCHEDULE_USAGEINFO_QUERY_XTS_0026
* @tc.name: UsageStatistics002
* @tc.desc: test isIdleState callback.
*/
it
(
"
UsageStatistics002
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------UsageStatistics002---------------------------
'
);
let
bundleName
=
'
ohos.acts.resourceschedule.deviceusagestatisticsjsunit.js.function
'
;
try
{
usageStatistics
.
isIdleState
(
bundleName
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test UsageStatistics002 isIdleState callback failure.
'
+
err
.
code
);
}
else
{
console
.
info
(
'
test UsageStatistics002 isIdleState callback success.
'
+
res
);
expect
(
res
).
assertFalse
();
done
();
}
});
}
catch
(
error
)
{
console
.
info
(
'
isIdleState throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
}
})
/*
* @tc.number:SUB_RESOURCESCHEDULE_USAGEINFO_QUERY_XTS_0027
* @tc.name: UsageStatistics003
* @tc.desc: test queryAppGroup promise.
*/
it
(
"
UsageStatistics003
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------UsageStatistics003---------------------------
'
);
let
bundleName
=
'
ohos.acts.resourceschedule.deviceusagestatisticsjsunit.js.function
'
;
try
{
usageStatistics
.
queryAppGroup
(
bundleName
).
then
(
res
=>
{
console
.
info
(
'
test UsageStatistics003 queryAppGroup promise success.
'
+
res
);
expect
(
res
).
assertEqual
(
10
);
done
();
}).
catch
(
err
=>
{
console
.
info
(
'
tets UsageStatistics003 queryAppGroup promise failure.
'
+
err
.
code
);
});
}
catch
(
error
)
{
console
.
info
(
'
queryAppGroup throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
}
})
/*
* @tc.number:SUB_RESOURCESCHEDULE_USAGEINFO_QUERY_XTS_0028
* @tc.name: UsageStatistics004
* @tc.desc: test queryAppGroup callback.
*/
it
(
"
UsageStatistics004
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------UsageStatistics004---------------------------
'
);
let
bundleName
=
'
ohos.acts.resourceschedule.deviceusagestatisticsjsunit.js.function
'
;
try
{
usageStatistics
.
queryAppGroup
(
bundleName
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test UsageStatistics004 queryAppGroup callback failure.
'
+
err
.
code
);
}
else
{
console
.
info
(
'
tets UsageStatistics004 queryAppGroup callback success.
'
+
res
);
expect
(
res
).
assertEqual
(
10
);
done
();
}
});
}
catch
(
error
)
{
console
.
info
(
'
queryAppGroup throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
}
})
/*
* @tc.number:SUB_RESOURCESCHEDULE_USAGEINFO_QUERY_XTS_0029
* @tc.name: UsageStatistics005
* @tc.desc: test queryCurrentBundleEvents promise.
*/
it
(
"
UsageStatistics005
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------UsageStatistics005---------------------------
'
);
let
beginTime
=
0
;
let
endTime
=
20000000000000
;
try
{
usageStatistics
.
queryCurrentBundleEvents
(
beginTime
,
endTime
).
then
((
res
)
=>
{
console
.
info
(
'
test UsageStatistics005 queryCurrentBundleEvents promise success.
'
+
res
);
expect
(
res
).
assertInstanceOf
(
"
Array
"
);
done
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
test UsageStatistics005 queryCurrentBundleEvents promise failure.
'
+
err
.
code
);
});
}
catch
(
error
)
{
console
.
info
(
'
queryCurrentBundleEvents throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
}
})
/*
* @tc.number:SUB_RESOURCESCHEDULE_USAGEINFO_QUERY_XTS_0030
* @tc.name: UsageStatistics006
* @tc.desc: test queryCurrentBundleEvents callback.
*/
it
(
"
UsageStatistics006
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------UsageStatistics006---------------------------
'
);
let
beginTime
=
0
;
let
endTime
=
20000000000000
;
try
{
usageStatistics
.
queryCurrentBundleEvents
(
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
tets UsageStatistics006 queryCurrentBundleEvents callback failure.
'
+
err
.
code
);
}
else
{
console
.
info
(
'
test UsageStatistics006 queryCurrentBundleEvents callback success.
'
+
res
);
expect
(
res
).
assertInstanceOf
(
"
Array
"
);
done
();
}
});
}
catch
(
error
)
{
console
.
info
(
'
queryCurrentBundleEvents throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
}
})
/*
* @tc.number:SUB_RESOURCESCHEDULE_USAGEINFO_QUERY_XTS_0031
* @tc.name: UsageStatistics007
* @tc.desc: test BundleEvents bundleName.
*/
it
(
"
UsageStatistics007
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------UsageStatistics007---------------------------
'
);
let
beginTime
=
10
;
let
endTime
=
20000000000000
;
try
{
usageStatistics
.
queryCurrentBundleEvents
(
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
tets UsageStatistics007 queryCurrentBundleEvents callback failure.
'
+
err
.
code
);
}
else
{
console
.
info
(
'
test UsageStatistics007 queryCurrentBundleEvents callback success.
'
+
res
);
expect
(
res
).
assertInstanceOf
(
"
Array
"
);
if
(
res
===
undefined
)
{
res
=
[{
bundleName
:
'
www.baidu.com
'
}];
}
console
.
info
(
'
test BundleEvents bundleName :
'
+
res
[
0
].
bundleName
);
done
();
}
});
}
catch
(
error
)
{
console
.
info
(
'
queryCurrentBundleEvents throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
}
})
/*
* @tc.number:SUB_RESOURCESCHEDULE_USAGEINFO_QUERY_XTS_0032
* @tc.name: UsageStatistics008
* @tc.desc: test BundleEvents eventId.
*/
it
(
"
UsageStatistics008
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------UsageStatistics008---------------------------
'
);
let
beginTime
=
10
;
let
endTime
=
20000000000000
;
try
{
usageStatistics
.
queryCurrentBundleEvents
(
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
tets UsageStatistics008 queryCurrentBundleEvents callback failure.
'
+
err
.
code
);
}
else
{
console
.
info
(
'
test UsageStatistics008 queryCurrentBundleEvents callback success.
'
+
res
);
expect
(
res
).
assertInstanceOf
(
"
Array
"
);
if
(
res
===
undefined
)
{
res
=
[{
eventId
:
0
}];
}
console
.
info
(
'
test BundleEvents eventId :
'
+
res
[
0
].
eventId
);
done
();
}
})
}
catch
(
error
)
{
console
.
info
(
'
queryCurrentBundleEvents throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
}
})
/*
* @tc.number:SUB_RESOURCESCHEDULE_USAGEINFO_QUERY_XTS_0033
* @tc.name: UsageStatistics009
* @tc.desc: test BundleEvents eventOccurredTime.
*/
it
(
"
UsageStatistics009
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------UsageStatistics009---------------------------
'
);
let
beginTime
=
10
;
let
endTime
=
20000000000000
;
try
{
usageStatistics
.
queryCurrentBundleEvents
(
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
tets UsageStatistics009 queryCurrentBundleEvents callback failure.
'
+
err
.
code
);
}
else
{
console
.
info
(
'
test UsageStatistics009 queryCurrentBundleEvents callback success.
'
+
res
);
expect
(
res
).
assertInstanceOf
(
"
Array
"
);
if
(
res
===
undefined
)
{
res
=
[{
eventOccurredTime
:
10000000000000
}];
}
console
.
info
(
'
test BundleEvents eventOccurredTime :
'
+
res
[
0
].
eventOccurredTime
);
done
();
}
})
}
catch
(
error
)
{
console
.
info
(
'
queryCurrentBundleEvents throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
}
})
/*
* @tc.number:SUB_RESOURCESCHEDULE_USAGEINFO_QUERY_XTS_0034
* @tc.name: UsageStatistics0010
* @tc.desc: test BundleEvents appGroup.
*/
it
(
"
UsageStatistics0010
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------UsageStatistics0010---------------------------
'
);
let
beginTime
=
10
;
let
endTime
=
20000000000000
;
try
{
usageStatistics
.
queryCurrentBundleEvents
(
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
tets UsageStatistics0010 queryCurrentBundleEvents callback failure.
'
+
err
.
code
);
}
else
{
console
.
info
(
'
test UsageStatistics0010 queryCurrentBundleEvents callback success.
'
+
res
);
expect
(
res
).
assertInstanceOf
(
"
Array
"
);
if
(
res
===
undefined
)
{
res
=
[{
appGroup
:
1
}];
}
console
.
info
(
'
test BundleEvents appGroup :
'
+
res
[
0
].
appGroup
);
done
();
}
})
}
catch
(
error
)
{
console
.
info
(
'
queryCurrentBundleEvents throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
}
})
/*
* @tc.number:SUB_RESOURCESCHEDULE_USAGEINFO_QUERY_XTS_0035
* @tc.name: UsageStatistics0011
* @tc.desc: test BundleEvents indexOfLink.
*/
it
(
"
UsageStatistics0011
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------UsageStatistics0011---------------------------
'
);
let
beginTime
=
10
;
let
endTime
=
20000000000000
;
try
{
usageStatistics
.
queryCurrentBundleEvents
(
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
tets UsageStatistics0011 queryCurrentBundleEvents callback failure.
'
+
err
.
code
);
}
else
{
console
.
info
(
'
test UsageStatistics0011 queryCurrentBundleEvents callback success.
'
+
res
);
expect
(
res
).
assertInstanceOf
(
"
Array
"
);
if
(
res
===
undefined
)
{
res
=
[{
indexOfLink
:
'
id
'
}];
}
console
.
info
(
'
test BundleEvents indexOfLink :
'
+
res
[
0
].
indexOfLink
);
done
();
}
})
}
catch
(
error
)
{
console
.
info
(
'
queryCurrentBundleEvents throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
}
})
/*
* @tc.number:SUB_RESOURCESCHEDULE_USAGEINFO_QUERY_XTS_0036
* @tc.name: UsageStatistics0012
* @tc.desc: test BundleEvents nameOfClass.
*/
it
(
"
UsageStatistics0012
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------UsageStatistics0012---------------------------
'
);
let
beginTime
=
10
;
let
endTime
=
20000000000000
;
try
{
usageStatistics
.
queryCurrentBundleEvents
(
beginTime
,
endTime
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
tets UsageStatistics0012 queryCurrentBundleEvents callback failure.
'
+
err
.
code
);
}
else
{
console
.
info
(
'
test UsageStatistics0012 queryCurrentBundleEvents callback success.
'
+
res
);
expect
(
res
).
assertInstanceOf
(
"
Array
"
);
if
(
res
===
undefined
)
{
res
=
[{
nameOfClass
:
'
BundleEvents
'
}];
}
console
.
info
(
'
test BundleEvents nameOfClass :
'
+
res
[
0
].
nameOfClass
);
done
();
}
})
}
catch
(
error
)
{
console
.
info
(
'
queryCurrentBundleEvents throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
}
})
/*
* @tc.number:SUB_RESOURCESCHEDULE_USAGEINFO_QUERY_XTS_0037
* @tc.name: UsageStatistics0013
* @tc.desc: test isIdleState promise.
*/
it
(
"
UsageStatistics0013
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------UsageStatistics0013---------------------------
'
);
try
{
usageStatistics
.
isIdleState
(
12345
).
then
((
res
)
=>
{
console
.
info
(
'
test UsageStatistics0013 isIdleStateone promise success.
'
+
res
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test UsageStatistics0013 isIdleState promise failure.
'
+
err
.
code
);
});
}
catch
(
error
)
{
console
.
info
(
'
isIdleState throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
expect
(
error
.
code
).
assertEqual
(
"
401
"
);
done
();
}
})
/*
* @tc.number:SUB_RESOURCESCHEDULE_USAGEINFO_QUERY_XTS_0038
* @tc.name: UsageStatistics0014
* @tc.desc: test isIdleState callback.
*/
it
(
"
UsageStatistics0014
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------UsageStatistics0014---------------------------
'
);
try
{
usageStatistics
.
isIdleState
(
""
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test UsageStatistics0014 isIdleState callback failure.
'
+
err
.
code
);
}
else
{
console
.
info
(
'
test UsageStatistics0014 isIdleState callback success.
'
+
res
);
}
});
}
catch
(
error
)
{
console
.
info
(
'
isIdleState throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
expect
(
error
.
code
).
assertEqual
(
"
401
"
);
done
();
}
})
/*
* @tc.number:SUB_RESOURCESCHEDULE_USAGEINFO_QUERY_XTS_0039
* @tc.name: UsageStatistics0015
* @tc.desc: test queryAppGroup promise.
*/
it
(
"
UsageStatistics0015
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------UsageStatistics0015---------------------------
'
);
try
{
usageStatistics
.
queryAppGroup
(
123456
).
then
(
res
=>
{
console
.
info
(
'
test UsageStatistics0015 queryAppGroup promise success.
'
+
res
);
}).
catch
(
err
=>
{
console
.
info
(
'
tets UsageStatistics0015 queryAppGroup promise failure.
'
+
err
.
code
);
});
}
catch
(
error
)
{
console
.
info
(
'
queryAppGroup throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
expect
(
error
.
code
).
assertEqual
(
"
401
"
);
done
();
}
})
/*
* @tc.number:SUB_RESOURCESCHEDULE_USAGEINFO_QUERY_XTS_0040
* @tc.name: UsageStatistics0016
* @tc.desc: test queryAppGroup callback.
*/
it
(
"
UsageStatistics0016
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------UsageStatistics0016---------------------------
'
);
try
{
usageStatistics
.
queryAppGroup
(
null
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
test UsageStatistics0016 queryAppGroup callback failure.
'
+
err
.
code
);
}
else
{
console
.
info
(
'
tets UsageStatistics0016 queryAppGroup callback success.
'
+
res
);
}
});
}
catch
(
error
)
{
console
.
info
(
'
queryAppGroup throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
expect
(
error
.
code
).
assertEqual
(
"
401
"
);
done
();
}
})
/*
* @tc.number:SUB_RESOURCESCHEDULE_USAGEINFO_QUERY_XTS_0041
* @tc.name: UsageStatistics0017
* @tc.desc: test queryCurrentBundleEvents promise.
*/
it
(
"
UsageStatistics0017
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------UsageStatistics0017---------------------------
'
);
try
{
usageStatistics
.
queryCurrentBundleEvents
(
true
,
false
).
then
((
res
)
=>
{
console
.
info
(
'
test UsageStatistics0017 queryCurrentBundleEvents promise success.
'
+
res
);
}).
catch
((
err
)
=>
{
console
.
info
(
'
test UsageStatistics0017 queryCurrentBundleEvents promise failure.
'
+
err
.
code
);
});
}
catch
(
error
)
{
console
.
info
(
'
queryCurrentBundleEvents throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
expect
(
error
.
code
).
assertEqual
(
"
401
"
);
done
();
}
})
/*
* @tc.number:SUB_RESOURCESCHEDULE_USAGEINFO_QUERY_XTS_0042
* @tc.name: UsageStatistics0018
* @tc.desc: test queryCurrentBundleEvents callback.
*/
it
(
"
UsageStatistics0018
"
,
0
,
async
function
(
done
)
{
console
.
info
(
'
----------------------UsageStatistics0018---------------------------
'
);
try
{
usageStatistics
.
queryCurrentBundleEvents
(
""
,
"
1235456
"
,
(
err
,
res
)
=>
{
if
(
err
)
{
console
.
info
(
'
tets UsageStatistics0018 queryCurrentBundleEvents callback failure.
'
+
err
.
code
);
}
else
{
console
.
info
(
'
test UsageStatistics0018 queryCurrentBundleEvents callback success.
'
+
res
);
}
});
}
catch
(
error
)
{
console
.
info
(
'
queryCurrentBundleEvents throw error, code is:
'
+
error
.
code
+
'
,message is:
'
+
error
.
message
);
expect
(
error
.
code
).
assertEqual
(
"
401
"
);
done
();
}
})
})}
resourceschedule/resourceschedule_standard/reminderagent/src/main/js/test/List.test.js
浏览文件 @
b2f118c6
...
...
@@ -13,9 +13,8 @@
* limitations under the License.
*/
import
ReminderAgentTest
from
'
./ReminderAgentJs.test.js
'
import
ReminderAgentManagerTest
from
'
./ReminderAgentManagerJs.test.js
'
export
default
function
testsuite
()
{
ReminderAgentTest
()
ReminderAgentManagerTest
()
}
resourceschedule/resourceschedule_standard/reminderagent/src/main/js/test/ReminderAgentJs.test.js
浏览文件 @
b2f118c6
...
...
@@ -2800,6 +2800,7 @@ export default function ReminderAgentTest() {
let
firstId
=
0
;
let
secondId
=
0
;
let
diffId
=
0
reminderAgent
.
cancelAllReminders
().
then
(()
=>
{
for
(
let
i
=
0
;
i
<
maxLimitNumsOfApp
;
i
++
)
{
(
function
(
i
)
{
setTimeout
(
function
()
{
...
...
@@ -2811,12 +2812,13 @@ export default function ReminderAgentTest() {
secondId
=
reminderId
diffId
=
secondId
-
firstId
expect
(
29
).
assertEqual
(
diffId
);
done
();
}
});
},
500
*
i
);
},
500
);
})(
i
);
}
done
();
})
})
/**
...
...
resourceschedule/resourceschedule_standard/reminderagentManager/BUILD.gn
0 → 100644
浏览文件 @
b2f118c6
# Copyright (C) 2021 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("resourceschedule_reminderagentmgr_js_test") {
hap_profile = "./src/main/config.json"
deps = [
":resourceschedule_js_assets",
":resourceschedule_js_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsResourcescheduleReminderAgentMgrTest"
subsystem_name = "notification"
part_name = "distributed_notification_service"
}
ohos_js_assets("resourceschedule_js_assets") {
js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
}
ohos_resources("resourceschedule_js_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
resourceschedule/resourceschedule_standard/reminderagentManager/Test.json
0 → 100644
浏览文件 @
b2f118c6
{
"description"
:
"Configuration for resourceschedule js api Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"300000"
,
"shell-timeout"
:
"300000"
,
"bundle-name"
:
"ohos.acts.resourceschedule.reminderagentMgr.js.function"
,
"package-name"
:
"ohos.acts.resourceschedule.reminderagentMgr.js.function"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsResourcescheduleReminderAgentMgrTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
\ No newline at end of file
resourceschedule/resourceschedule_standard/reminderagentManager/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
b2f118c6
文件已添加
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/config.json
0 → 100644
浏览文件 @
b2f118c6
{
"app"
:
{
"bundleName"
:
"ohos.acts.resourceschedule.reminderagentMgr.js.function"
,
"vendor"
:
"example"
,
"version"
:
{
"code"
:
1
,
"name"
:
"1.0"
},
"apiVersion"
:
{
"compatible"
:
4
,
"target"
:
5
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"ohos.acts.resourceschedule.reminderagentMgr.js.function"
,
"name"
:
".entry"
,
"deviceType"
:
[
"tablet"
,
"default"
,
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"orientation"
:
"unspecified"
,
"formsEnabled"
:
false
,
"name"
:
".MainAbility"
,
"srcLanguage"
:
"js"
,
"srcPath"
:
"MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:MainAbility_desc"
,
"label"
:
"$string:MainAbility_label"
,
"type"
:
"page"
,
"visible"
:
true
,
"launchType"
:
"standard"
},
{
"orientation"
:
"unspecified"
,
"formsEnabled"
:
false
,
"name"
:
".TestAbility"
,
"srcLanguage"
:
"js"
,
"srcPath"
:
"TestAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:TestAbility_desc"
,
"label"
:
"$string:TestAbility_label"
,
"type"
:
"page"
,
"visible"
:
true
,
"launchType"
:
"standard"
}
],
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
},
{
"pages"
:
[
"pages/index/index"
],
"name"
:
".TestAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
],
"reqPermissions"
:
[
{
"name"
:
"ohos.permission.PUBLISH_AGENT_REMINDER"
,
"reason"
:
"SYSTEM_GRANT"
,
"usedScene"
:
{
"ability"
:
[
".FormAbility"
],
"when"
:
"inuse"
}
}
],
"testRunner"
:
{
"name"
:
"OpenHarmonyTestRunner"
,
"srcPath"
:
"TestRunner"
},
"mainAbility"
:
".MainAbility"
,
"srcPath"
:
""
}
}
\ No newline at end of file
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/MainAbility/app.js
0 → 100644
浏览文件 @
b2f118c6
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
};
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/MainAbility/i18n/en-US.json
0 → 100644
浏览文件 @
b2f118c6
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/MainAbility/i18n/zh-CN.json
0 → 100644
浏览文件 @
b2f118c6
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"鸿蒙"
}
}
\ No newline at end of file
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/MainAbility/pages/index/index.css
0 → 100644
浏览文件 @
b2f118c6
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
}
.title
{
font-size
:
100px
;
}
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/MainAbility/pages/index/index.hml
0 → 100644
浏览文件 @
b2f118c6
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/MainAbility/pages/index/index.js
0 → 100644
浏览文件 @
b2f118c6
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const
injectRef
=
Object
.
getPrototypeOf
(
global
)
||
global
injectRef
.
regeneratorRuntime
=
require
(
'
@babel/runtime/regenerator
'
)
export
default
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
},
onShow
()
{
console
.
info
(
'
onShow finish
'
)
},
onReady
()
{
},
}
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/TestAbility/app.js
0 → 100644
浏览文件 @
b2f118c6
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
{
Hypium
}
from
'
@ohos/hypium
'
import
testsuite
from
'
../test/List.test
'
export
default
{
onCreate
()
{
console
.
info
(
'
TestApplication onCreate
'
)
var
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
},
onDestroy
()
{
console
.
info
(
"
TestApplication onDestroy
"
);
}
};
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/TestAbility/i18n/en-US.json
0 → 100644
浏览文件 @
b2f118c6
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
},
"Files"
:
{
}
}
\ No newline at end of file
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/TestAbility/i18n/zh-CN.json
0 → 100644
浏览文件 @
b2f118c6
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
},
"Files"
:
{
}
}
\ No newline at end of file
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/TestAbility/pages/index/index.css
0 → 100644
浏览文件 @
b2f118c6
.container
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
left
:
0px
;
top
:
0px
;
width
:
100%
;
height
:
100%
;
}
.title
{
font-size
:
60px
;
text-align
:
center
;
width
:
100%
;
height
:
40%
;
margin
:
10px
;
}
@media
screen
and
(
device-type
:
phone
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
60px
;
}
}
@media
screen
and
(
device-type
:
tablet
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
100px
;
}
}
\ No newline at end of file
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/TestAbility/pages/index/index.hml
0 → 100644
浏览文件 @
b2f118c6
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/TestAbility/pages/index/index.js
0 → 100644
浏览文件 @
b2f118c6
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export
default
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
}
}
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/TestRunner/OpenHarmonyTestRunner.js
0 → 100644
浏览文件 @
b2f118c6
/*
* Copyright (c) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s itName
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s package
'
,
'
-s dryRun
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
+=
'
'
+
key
+
'
'
+
parameters
[
key
]
}
}
return
targetParams
.
trim
()
}
export
default
{
onPrepare
()
{
console
.
info
(
'
OpenHarmonyTestRunner OnPrepare
'
)
},
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
var
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
var
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
parameters
[
'
-p
'
]
+
'
.TestAbility
'
var
cmd
=
'
aa start -d 0 -a
'
+
testAbilityName
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
]
console
.
info
(
'
debug value :
'
+
debug
)
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
data
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
data
.
exitCode
);
})
}
};
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/js/test/List.test.js
0 → 100644
浏览文件 @
b2f118c6
/*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
ReminderAgentManagerTest
from
'
./ReminderAgentManagerJs.test.js
'
export
default
function
testsuite
()
{
ReminderAgentManagerTest
()
}
resourceschedule/resourceschedule_standard/reminderagent/src/main/js/test/ReminderAgentManagerJs.test.js
→
resourceschedule/resourceschedule_standard/reminderagent
Manager
/src/main/js/test/ReminderAgentManagerJs.test.js
浏览文件 @
b2f118c6
文件已移动
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
b2f118c6
{
"string"
:
[
{
"name"
:
"app_name"
,
"value"
:
"ResourcescheduleJSApiTest"
},
{
"name"
:
"mainability_description"
,
"value"
:
"JS_Phone_Empty Feature Ability"
},
{
"name"
:
"MainAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_label"
,
"value"
:
"label"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"label"
}
]
}
\ No newline at end of file
resourceschedule/resourceschedule_standard/reminderagentManager/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
b2f118c6
6.6 KB
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录