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

!8773 【代码上库】【xts_acts】【powermgr】【master】 power test code optimization

Merge pull request !8773 from kangqiao/master
......@@ -18,7 +18,7 @@ import runningLock from '@ohos.runningLock'
import { describe, it, expect } from '@ohos/hypium'
export default function PowerManagerRunningLockTest() {
describe('PowerManagerRunningLockTest', function () {
describe('PowerManagerRunningLockTest', function () {
console.log("*************RunningLock Unit Test Begin*************");
/**
......@@ -51,7 +51,7 @@ describe('PowerManagerRunningLockTest', function () {
* @tc.desc Checks whether a lock is held or in use (deprecated since 9)
*/
it('Running_Lock_used_JSTest0020', 0, async function (done) {
runningLock.createRunningLock("Running_Lock_used_JSTest0020", runningLock.RunningLockType.BACKGROUND)
await runningLock.createRunningLock("Running_Lock_used_JSTest0020", runningLock.RunningLockType.BACKGROUND)
.then(runninglock => {
expect(runninglock !== null).assertTrue();
let used = runninglock.isUsed();
......@@ -210,9 +210,9 @@ describe('PowerManagerRunningLockTest', function () {
console.log('Is_Runninglock_Type_Supported_Callback_JSTest0090: ' + error);
expect().assertFail();
}
})
done();
})
})
/**
* @tc.number SUB_PowerSystem_PowerManager_JSTest_0100
......@@ -271,9 +271,9 @@ describe('PowerManagerRunningLockTest', function () {
console.log('Create_Running_Lock_CallBack_JSTest0120: ' + error);
expect().assertFail();
}
})
done();
})
})
/**
* @tc.number SUB_PowerSystem_PowerManager_JSTest_0130
......@@ -336,12 +336,12 @@ describe('PowerManagerRunningLockTest', function () {
expect(typeof error === "undefined").assertTrue();
expect(runninglock !== null).assertTrue();
console.info('Create_Running_Lock_Callback_JSTest0140 success');
done();
});
} catch (e) {
console.info('Create_Running_Lock_Callback_JSTest0230 error:' + e);
expect().assertFail();
}
done();
})
/**
......@@ -362,5 +362,5 @@ describe('PowerManagerRunningLockTest', function () {
}
done();
})
})
})
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册