提交 1f9009b8 编写于 作者: 1 15829070344 提交者: 何海涛

fixed 61d90814 from https://gitee.com/murphy1984/acts/pulls/6464

【主题】锁屏服务遗留接口覆盖
Signed-off-by: N15829070344 <hehaitao5@huawei.com>
Change-Id: Icb3e4824f2f7c73ecff5412fe0a32cd86a14da2f
上级 37337840
......@@ -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.
先完成此消息的编辑!
想要评论请 注册