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

!9217 用例结束增加删除数据库命令,避免重复执行相同文件名资源创建失败

Merge pull request !9217 from 秦莉文/master
...@@ -19,7 +19,11 @@ ...@@ -19,7 +19,11 @@
"power-shell setmode 602" "power-shell setmode 602"
], ],
"teardown-command":[ "teardown-command":[
"power-shell setmode 600" "power-shell setmode 600",
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*",
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner",
"sleep 5"
] ]
}, },
{ {
......
...@@ -775,27 +775,36 @@ describe('CameraManagerTest', function () { ...@@ -775,27 +775,36 @@ describe('CameraManagerTest', function () {
* @tc.level : Level 1 * @tc.level : Level 1
*/ */
it('SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100', 1, async function (done) { it('SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100', 1, async function (done) {
console.info("--------------SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100--------------"); console.info("--------------SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100--------------");
if (isEmpty(mCameraManager)) { if (isEmpty(mCameraManager)) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100 mCameraManager == null || undefined") console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100 mCameraManager == null || undefined")
expect().assertFail(); expect().assertFail();
} else {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100 to operate");
mCameraManager.on('cameraStatus', async (err, data) => {
if (!err) {
expect(true).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100 success");
} else { } else {
expect().assertFail(); console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100 to operate");
console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100 FAILED: " + err.message); mCameraManager.on('cameraStatus', async (err, CameraStatusInfo) => {
if (!err) {
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100 camera:" + JSON.stringify(CameraStatusInfo.camera));
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100 status:" + JSON.stringify(CameraStatusInfo.status));
expect(true).assertTrue();
console.info(TAG + "Entering SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100 success");
} else {
expect().assertFail();
console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100 FAILED: " + err.message);
}
done();
})
try {
let camerasArray = mCameraDevicesArray;
let cameraInputPromise = mCameraManager.createCameraInput(camerasArray[0]);
await cameraInputPromise.open()
await sleep(500)
await cameraInputPromise.close()
} catch (err) {
expect().assertFail();
console.info(TAG + "Error in SUB_MULTIMEDIA_CAMERA_ON_CAMERASTATUS_0100 err: " + JSON.stringify(err));
done()
}
} }
await sleep(1000); })
done();
})
}
await sleep(1000);
done();
})
}) })
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册