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

!7900 【杂散】【主题子系统】删掉壁纸和锁屏systemAPI和下掉的Api

Merge pull request !7900 from 张育帅/master
...@@ -114,10 +114,9 @@ export default function ScreenLockPromiseTest(){ ...@@ -114,10 +114,9 @@ export default function ScreenLockPromiseTest(){
console.info("------------------start SUB_MISC_THEME_screenLock_API_Promise_004-------------------"); console.info("------------------start SUB_MISC_THEME_screenLock_API_Promise_004-------------------");
try { try {
screenLock.unlockScreen().then((data) => { 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 success.");
console.info('====>-------------SUB_MISC_THEME_screenLock_API_Promise_004 end----------------------'); console.info('====>-------------SUB_MISC_THEME_screenLock_API_Promise_004 end----------------------');
expect(true).assertTrue()
done(); done();
}).catch( err => { }).catch( err => {
console.info("====>SUB_MISC_THEME_screenLock_API_Promise_004 failed because: " + JSON.stringify(err)); console.info("====>SUB_MISC_THEME_screenLock_API_Promise_004 failed because: " + JSON.stringify(err));
...@@ -126,10 +125,9 @@ export default function ScreenLockPromiseTest(){ ...@@ -126,10 +125,9 @@ export default function ScreenLockPromiseTest(){
}); });
} catch (error) { } catch (error) {
console.info("====>SUB_MISC_THEME_screenLock_API_Promise_004: error = " + error); console.info("====>SUB_MISC_THEME_screenLock_API_Promise_004: error = " + error);
expect(true).assertTrue(); expect().assertFail();
} }
console.info("------------------end SUB_MISC_THEME_screenLock_API_Promise_004-------------------"); console.info("------------------end SUB_MISC_THEME_screenLock_API_Promise_004-------------------");
done();
}); });
}) })
} }
...@@ -27,67 +27,6 @@ export default function screenLockJSUnit() { ...@@ -27,67 +27,6 @@ export default function screenLockJSUnit() {
beforeEach(async function (done) { beforeEach(async function (done) {
result = await screenLock.isScreenLocked(); result = await screenLock.isScreenLocked();
done(); done();
});
/*
* @tc.number SUB_MISC_THEME_screenLock_API_0012
* @tc.name Test unlock() to Unlocks the screen.
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_MISC_THEME_screenLock_API_0012', 0, async function (done) {
console.info('====>-------------SUB_MISC_THEME_screenLock_API_0012 start----------------------');
try{
screenLock.unlock((err, data) => {
try{
if (err) {
console.info("====>SUB_MISC_THEME_screenLock_API_0012 failed because: " + JSON.stringify(err));
expect().assertFail();
done();
}
let currentResult = screenLock.isLocked()
expect(currentResult).assertEqual(false)
console.info("====>SUB_MISC_THEME_screenLock_API_0012 success.");
console.info('====>-------------SUB_MISC_THEME_screenLock_API_0012 end----------------------');
done();
}catch(err){
console.info('====>SUB_MISC_THEME_screenLock_API_0012 throw_err : ' + JSON.stringify(err));
expect().assertFail();
done();
}
});
}catch(err){
console.info('====>SUB_MISC_THEME_screenLock_API_0012 catch err : ' + JSON.stringify(err));
expect(err.code).assertEqual(201);
done();
}
})
/*
* @tc.number SUB_MISC_THEME_screenLock_API_0013
* @tc.name Test unlock() to Unlocks the screen.
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_MISC_THEME_screenLock_API_0013', 0, async function (done) {
console.info('====>-------------SUB_MISC_THEME_screenLock_API_0013 start----------------------');
try{
screenLock.unlock().then((data) => {
let currentResult = screenLock.isLocked()
expect(currentResult).assertEqual(false)
console.info("====>SUB_MISC_THEME_screenLock_API_0013 success.");
console.info('====>-------------SUB_MISC_THEME_screenLock_API_0013 end----------------------');
done();
}).catch( err => {
console.info("====>SUB_MISC_THEME_screenLock_API_0013 failed because: " + JSON.stringify(err));
expect().assertFail();
done();
});
}catch(err){
console.info('====>SUB_MISC_THEME_screenLock_API_0013 catch err : ' + JSON.stringify(err));
expect().assertFail();
done();
}
}); });
/* /*
...@@ -205,8 +144,7 @@ export default function screenLockJSUnit() { ...@@ -205,8 +144,7 @@ export default function screenLockJSUnit() {
expect().assertFail(); expect().assertFail();
done(); done();
} }
let currentResult = screenLock.isLocked() expect(true).assertTrue()
expect(currentResult).assertEqual(false)
console.info("====>SUB_MISC_THEME_screenLock_API_0004 success."); console.info("====>SUB_MISC_THEME_screenLock_API_0004 success.");
console.info('====>-------------SUB_MISC_THEME_screenLock_API_0004 end----------------------'); console.info('====>-------------SUB_MISC_THEME_screenLock_API_0004 end----------------------');
done(); done();
...@@ -244,7 +182,7 @@ export default function screenLockJSUnit() { ...@@ -244,7 +182,7 @@ export default function screenLockJSUnit() {
console.info("====>logMessage SUB_MISC_THEME_screenLock_API_0007 throw_err = " + err); console.info("====>logMessage SUB_MISC_THEME_screenLock_API_0007 throw_err = " + err);
expect().assertFail(); expect().assertFail();
done(); done();
} }
}); });
} catch (err) { } catch (err) {
console.info("====>logMessage SUB_MISC_THEME_screenLock_API_0007: err = " + err); console.info("====>logMessage SUB_MISC_THEME_screenLock_API_0007: err = " + err);
...@@ -252,55 +190,6 @@ export default function screenLockJSUnit() { ...@@ -252,55 +190,6 @@ export default function screenLockJSUnit() {
done(); done();
} }
});
/*
* @tc.number SUB_MISC_THEME_screenLock_API_0010
* @tc.name Test isLocked() to Checks whether the screen is currently locked.
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_MISC_THEME_screenLock_API_0010', 0, async function (done) {
console.info('====>-------------SUB_MISC_THEME_screenLock_API_0010 start----------------------');
let lock = null;
try{
lock = await screenLock.isLocked()
console.info('====>SUB_MISC_THEME_screenLock_API_0010 data : ' + JSON.stringify(lock));
expect(lock).assertEqual(result);
console.info('====>-------------SUB_MISC_THEME_screenLock_API_0010 end----------------------');
done()
}catch(err){
console.info('====>SUB_MISC_THEME_screenLock_API_0010 err : ' + JSON.stringify(err));
expect().assertFail();
done()
}
});
/*
* @tc.number SUB_MISC_THEME_screenLock_API_0011
* @tc.name Test isSecure() to Checks whether the screen lock of the current device is secure.
* @tc.desc Function test
* @tc.level 0
*/
it('SUB_MISC_THEME_screenLock_API_0011', 0, async function (done) {
console.info('====>-------------SUB_MISC_THEME_screenLock_API_0011 start----------------------');
let secured = null;
try{
secured = screenLock.isSecure()
console.info('====>SUB_MISC_THEME_screenLock_API_0011 data : ' + JSON.stringify(secured));
if (secured == false) {
expect(true).assertTrue();
console.info('====>-------------SUB_MISC_THEME_screenLock_API_0011 end----------------------');
done()
}else{
expect().assertFail();
done()
}
}catch(err){
console.info('====>SUB_MISC_THEME_screenLock_API_0011 err : ' + JSON.stringify(err));
expect().assertFail();
done()
}
}); });
}); });
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册