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

!5626 【3.2-Beta3】userfilemgr delete createAsset

Merge pull request !5626 from yangbo/cherry-pick-1663902964
......@@ -61,25 +61,6 @@ export default function userFileMgrNoPermissionCallback(abilityContext) {
}
}
const createAssetTest = async function (done, testNum, type, name, path) {
try {
await userfile_mgr.createAsset(type, name, path, async (err, creatAsset) => {
if (err != undefined) {
console.info(`${testNum}, err: ${err}`);
expect(true).assertTrue();
done();
return;
}
expect(false).assertTrue();
done();
})
} catch (error) {
console.info(`${testNum}, failed error: ${error}`)
expect(false).assertTrue();
done();
}
}
const getAlbumsTest = async function (done, testNum, media_type) {
try {
await userfile_mgr.getAlbums(media_type, allFetchOp(), async (err, albumList) => {
......@@ -141,56 +122,6 @@ export default function userFileMgrNoPermissionCallback(abilityContext) {
await getFileAssetsTest(done, testNum, media_type);
});
//---------------------------------------------------------------------------------------
/**
* @tc.number : SUB_USERFILE_MGR_CREATEASSET_NOPERMISSION_CALLBACK_01
* @tc.name : createAsset
* @tc.desc : createAsset(image) with no permission
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_CREATEASSET_NOPERMISSION_CALLBACK_01', 0, async function (done) {
const testNum = 'SUB_USERFILE_MGR_CREATEASSET_NOPERMISSION_CALLBACK_01';
let type = IMAGE_TYPE;
let name = new Date().getTime() + '.jpg';
let path = 'Pictures/Create/';
await createAssetTest(done, testNum, type, name, path);
});
/**
* @tc.number : SUB_USERFILE_MGR_CREATEASSET_NOPERMISSION_CALLBACK_02
* @tc.name : createAsset
* @tc.desc : createAsset(audio) with no permission
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_CREATEASSET_NOPERMISSION_CALLBACK_02', 0, async function (done) {
const testNum = 'SUB_USERFILE_MGR_CREATEASSET_NOPERMISSION_CALLBACK_02';
let type = AUDIO_TYPE;
let name = new Date().getTime() + '.mp3';
let path = 'Audios/Create/';
await createAssetTest(done, testNum, type, name, path);
});
/**
* @tc.number : SUB_USERFILE_MGR_CREATEASSET_NOPERMISSION_CALLBACK_03
* @tc.name : createAsset
* @tc.desc : createAsset(video) with no permission
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_CREATEASSET_NOPERMISSION_CALLBACK_03', 0, async function (done) {
const testNum = 'SUB_USERFILE_MGR_CREATEASSET_NOPERMISSION_CALLBACK_03';
let type = VIDEO_TYPE;
let name = new Date().getTime() + '.mp4';
let path = 'Videos/Create/';
await createAssetTest(done, testNum, type, name, path);
});
//--------------------------------------------------------------------------------------
/**
......
......@@ -54,18 +54,6 @@ export default function userFileMgrNoPermissionPromise(abilityContext) {
}
}
const createAssetTest = async function (done, testNum, type, name, path) {
try {
await userfile_mgr.createAsset(type, name, path);
expect(false).assertTrue();
done();
} catch (error) {
console.info(`${testNum}, failed error: ${error}`)
expect(true).assertTrue();
done();
}
}
const getAlbumsTest = async function (done, testNum, media_type) {
try {
await userfile_mgr.getAlbums(media_type, allFetchOp());
......@@ -120,56 +108,6 @@ export default function userFileMgrNoPermissionPromise(abilityContext) {
await getFileAssetsTest(done, testNum, media_type);
});
//---------------------------------------------------------------------------------------
/**
* @tc.number : SUB_USERFILE_MGR_CREATEASSET_NOPERMISSION_PROMISE_01
* @tc.name : createAsset
* @tc.desc : createAsset(image) with no permission
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_CREATEASSET_NOPERMISSION_PROMISE_01', 0, async function (done) {
const testNum = 'SUB_USERFILE_MGR_CREATEASSET_NOPERMISSION_PROMISE_01';
let type = IMAGE_TYPE;
let name = new Date().getTime() + '.jpg';
let path = 'Pictures/Create/';
await createAssetTest(done, testNum, type, name, path);
});
/**
* @tc.number : SUB_USERFILE_MGR_CREATEASSET_NOPERMISSION_PROMISE_02
* @tc.name : createAsset
* @tc.desc : createAsset(audio) with no permission
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_CREATEASSET_NOPERMISSION_PROMISE_02', 0, async function (done) {
const testNum = 'SUB_USERFILE_MGR_CREATEASSET_NOPERMISSION_PROMISE_02';
let type = AUDIO_TYPE;
let name = new Date().getTime() + '.mp3';
let path = 'Audios/Create/';
await createAssetTest(done, testNum, type, name, path);
});
/**
* @tc.number : SUB_USERFILE_MGR_CREATEASSET_NOPERMISSION_PROMISE_03
* @tc.name : createAsset
* @tc.desc : createAsset(video) with no permission
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_CREATEASSET_NOPERMISSION_PROMISE_03', 0, async function (done) {
const testNum = 'SUB_USERFILE_MGR_CREATEASSET_NOPERMISSION_PROMISE_03';
let type = VIDEO_TYPE;
let name = new Date().getTime() + '.mp4';
let path = 'Videos/Create/';
await createAssetTest(done, testNum, type, name, path);
});
//--------------------------------------------------------------------------------------
/**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册