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

!6464 【主题】锁屏服务遗留接口覆盖

Merge pull request !6464 from 何海涛/theme1110
......@@ -101,5 +101,35 @@ export default function ScreenLockPromiseTest(){
done();
}
});
/*
* @tc.number SUB_MISC_THEME_screenLock_API_Promise_004
* @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Test ScreenLock API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MISC_THEME_screenLock_API_Promise_004", 0, async function (done) {
console.info("------------------start SUB_MISC_THEME_screenLock_API_Promise_004-------------------");
try {
screenLock.unlockScreen().then((data) => {
let currentResult = screenLock.isLocked()
expect(currentResult).assertEqual(false)
console.info("====>SUB_MISC_THEME_screenLock_API_Promise_004 success.");
console.info('====>-------------SUB_MISC_THEME_screenLock_API_Promise_004 end----------------------');
done();
}).catch( err => {
console.info("====>SUB_MISC_THEME_screenLock_API_Promise_004 failed because: " + JSON.stringify(err));
expect().assertFail();
done();
});
} catch (error) {
console.info("====>SUB_MISC_THEME_screenLock_API_Promise_004: error = " + error);
expect(true).assertTrue();
}
console.info("------------------end SUB_MISC_THEME_screenLock_API_Promise_004-------------------");
done();
});
})
}
......@@ -36,7 +36,7 @@ export default function screenLockJSUnit() {
* @tc.level 0
*/
it('SUB_MISC_THEME_screenLock_API_0012', 0, async function (done) {
console.info('====>-------------SUB_MISC_THEME_screenLock_API_0012 start----------------------');
console.info('====>-------------SUB_MISC_THEME_screenLock_API_0012 start----------------------');
try{
screenLock.unlock((err, data) => {
try{
......@@ -177,15 +177,50 @@ export default function screenLockJSUnit() {
console.info("====>logMessage SUB_MISC_THEME_screenLock_API_0003 throw_err = " + err);
expect().assertFail();
done();
}
}
});
} catch (err) {
console.info("====>logMessage SUB_MISC_THEME_screenLock_API_0003: err = " + err);
expect().assertFail();
done();
}
});
/*
* @tc.number SUB_MISC_THEME_screenLock_API_0004
* @tc.name Set to locked screen, query the lock screen state is locked state
* @tc.desc Test ScreenLock API functionality.
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MISC_THEME_screenLock_API_0004", 0, async function (done) {
console.info("------------------start SUB_MISC_THEME_screenLock_API_0004-------------------");
try {
screenLock.unlockScreen((err) => {
console.info("SUB_MISC_THEME_screenLock_API_0004: send unlockScreen issue success");
try{
if (err) {
console.info("====>SUB_MISC_THEME_screenLock_API_0004 failed because: " + JSON.stringify(err));
expect().assertFail();
done();
}
let currentResult = screenLock.isLocked()
expect(currentResult).assertEqual(false)
console.info("====>SUB_MISC_THEME_screenLock_API_0004 success.");
console.info('====>-------------SUB_MISC_THEME_screenLock_API_0004 end----------------------');
done();
}catch(err){
console.info('====>SUB_MISC_THEME_screenLock_API_0004 throw_err : ' + JSON.stringify(err));
expect().assertFail();
done();
}
});
} catch (error) {
console.info("SUB_MISC_THEME_screenLock_API_0004: error = " + error);
expect().assertFail();
done();
}
});
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册