提交 adce5539 编写于 作者: G greada

每行代码应该少于 120 个字符

Signed-off-by: Ngreada <kangqiao1@huawei.com>
上级 784f4d75
...@@ -37,24 +37,25 @@ describe('appInfoTest_battery3', function () { ...@@ -37,24 +37,25 @@ describe('appInfoTest_battery3', function () {
}) })
//createRunningLock(name: string, type: RunningLockType, callback: AsyncCallback<RunningLock>) //createRunningLock(name: string, type: RunningLockType, callback: AsyncCallback<RunningLock>)
it('create_running_lock_callback_test', 0, async function (done) { it('create_running_lock_callback_test', 0, async function (done) {
runningLock.createRunningLock("running_lock_test_2", runningLock.RunningLockType.BACKGROUND, (error, runninglock) => { runningLock.createRunningLock("running_lock_test_2", runningLock.RunningLockType.BACKGROUND,
if (typeof error === "undefined") { (error, runninglock) => {
console.info('create_running_lock_callback_test: runningLock is ' + runninglock); if (typeof error === "undefined") {
expect(runninglock !== null).assertTrue(); console.info('create_running_lock_callback_test: runningLock is ' + runninglock);
let used = runninglock.isUsed(); expect(runninglock !== null).assertTrue();
console.info('create_running_lock_callback_test is used: ' + used); let used = runninglock.isUsed();
expect(used).assertFalse(); console.info('create_running_lock_callback_test is used: ' + used);
runninglock.lock(500); expect(used).assertFalse();
used = runninglock.isUsed(); runninglock.lock(500);
console.info('after lock create_running_lock_callback_test is used: ' + used); used = runninglock.isUsed();
expect(used).assertTrue(); console.info('after lock create_running_lock_callback_test is used: ' + used);
console.info('create_running_lock_callback_test success'); expect(used).assertTrue();
done(); console.info('create_running_lock_callback_test success');
} else { done();
console.log('create_running_lock_callback_test: ' + error); } else {
expect().assertFail(); console.log('create_running_lock_callback_test: ' + error);
done(); expect().assertFail();
} done();
}
}) })
}) })
//lock(timeout: number) //lock(timeout: number)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册