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

!3445 medialibrary:fix wrong media type in createAsset

Merge pull request !3445 from qilongzhang/xts_merge_06062
......@@ -84,7 +84,7 @@ export default function fileAssetCallBack2Test(abilityContext){
try {
const fetchFileResult = await media.getFileAssets(imagesfetchOp);
const asset = await fetchFileResult.getFirstObject();
const newName = 'newName' + new Date().getTime();
const newName = 'newName' + new Date().getTime() + '.jpg';
asset.displayName = newName;
const id = asset.id;
asset.commitModify(async () => {
......
......@@ -85,7 +85,7 @@ export default function fileAssetPromise2Test(abilityContext){
try {
const fetchFileResult = await media.getFileAssets(imagesfetchOp);
const asset = await fetchFileResult.getFirstObject();
const newName = 'newName' + new Date().getTime();
const newName = 'newName' + new Date().getTime() + '.jpg';
asset.displayName = newName;
const id = asset.id;
await asset.commitModify();
......
......@@ -843,7 +843,7 @@ export default function mediaLibraryTestPromiseTest(abilityContext){
const fileAssets = await media.getFileAssets(filesfetchOp);
const dataList = await fileAssets.getAllObject();
const asset1 = dataList[0];
const creatAsset1 = await media.createAsset(fileType, fileName, path);
const creatAsset1 = await media.createAsset(audioType, fileName, path);
const fd1 = await asset1.open('rw');
const creatAssetFd1 = await creatAsset1.open('rw');
await copyFile(fd1, creatAssetFd1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册