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

!6232 【EDM】测试用例执行完后复原系统时间

Merge pull request !6232 from 李兀立/master
......@@ -170,7 +170,7 @@ export default function edmCallbackTest() {
expect(isEnabled).assertTrue();
try {
var retValue = await enterpriseDeviceManager.disableAdmin(WANT1, DEFAULT_USER_ID);
await enterpriseDeviceManager.disableAdmin(WANT1, DEFAULT_USER_ID);
console.log('enterpriseDeviceManager.disableAdmin over');
} catch (error) {
expect(error != null).assertTrue();
......@@ -247,9 +247,11 @@ export default function edmCallbackTest() {
let dsmgr = await enterpriseDeviceManager.getDeviceSettingsManager();
expect(dsmgr !== null).assertTrue();
console.log('before setDateTime');
await dsmgr.setDateTime(SELFWANT, 1526003846000, OnReceiveEvent);
async function OnReceiveEvent() {
let currentTime = new Date().getTime();
await dsmgr.setDateTime(SELFWANT, currentTime, OnReceiveEvent);
async function OnReceiveEvent(error) {
await enterpriseDeviceManager.disableSuperAdmin(SELFHAPNAME);
expect(error === null).assertTrue();
done();
}
})
......
......@@ -284,7 +284,10 @@ export default function edmPromiseTest() {
let dsmgr = await enterpriseDeviceManager.getDeviceSettingsManager();
expect(dsmgr !== null).assertTrue();
console.log('before setDateTime');
await dsmgr.setDateTime(SELFWANT, 1526003846000);
let currentTime = new Date().getTime();
await dsmgr.setDateTime(SELFWANT, currentTime).catch((error)=>{
expect(error === null).assertTrue();
})
await enterpriseDeviceManager.disableSuperAdmin(SELFHAPNAME);
done();
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册