diff --git a/customization/edm_xts_stage/entry/src/main/ets/test/edmCallback.test.ets b/customization/edm_xts_stage/entry/src/main/ets/test/edmCallback.test.ets index 8b014567022c5611ea1e3bcc6f0813d4d0a0f5bb..9b438235e79b299a9bfe52a2ec6cf28152390394 100644 --- a/customization/edm_xts_stage/entry/src/main/ets/test/edmCallback.test.ets +++ b/customization/edm_xts_stage/entry/src/main/ets/test/edmCallback.test.ets @@ -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(); } }) diff --git a/customization/edm_xts_stage/entry/src/main/ets/test/edmPromise.test.ets b/customization/edm_xts_stage/entry/src/main/ets/test/edmPromise.test.ets index 98a0fa46668277750da6c3503381583abd30425b..0854b5f9ab77ba3710afc657217ca49aac2510e8 100644 --- a/customization/edm_xts_stage/entry/src/main/ets/test/edmPromise.test.ets +++ b/customization/edm_xts_stage/entry/src/main/ets/test/edmPromise.test.ets @@ -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(); })