提交 ea6dfb4e 编写于 作者: L lwx1121892

<medialibrary修改>

Signed-off-by: Nlwx1121892 <liuxueqi3@huawei.com>
上级 c636c3e0
......@@ -228,113 +228,6 @@ describe('fileAssetTestCallback.test.js', async function() {
//======================== FILE END ==================================
//======================== ALBUM BEGIN ==================================
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_04
* @tc.name : open('rw')
* @tc.desc : open -rw the type of ALBUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_04', 0, async function(done) {
let asset;
let fd;
try {
let type = mediaLibrary.MediaType.ALBUM;
let fetchOp = {
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
const dataList = await fetchFileResult.getAllObject();
asset = dataList[0];
asset.open('rw', async (error, fd) => {
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_04 error:'
+ error);
expect(true).assertTrue();
if (fd > 0) {
asset.close(fd);
}
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_05
* @tc.name : open('r')
* @tc.desc : open -r the type of ALBUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_05', 0, async function(done) {
let asset;
let fd;
try {
let type = mediaLibrary.MediaType.ALBUM;
let fetchOp = {
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
const dataList = await fetchFileResult.getAllObject();
asset = dataList[0];
asset.open('r', async (error, fd) => {
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_05 error:'
+ error);
expect(true).assertTrue();
if (fd > 0) {
asset.close(fd);
}
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_06
* @tc.name : open('w')
* @tc.desc : open -w the type of ALBUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_06', 0, async function(done) {
let asset;
let fd;
try {
let type = mediaLibrary.MediaType.ALBUM;
let fetchOp = {
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
const dataList = await fetchFileResult.getAllObject();
asset = dataList[0];
asset.open('w', (error, fd) => {
expect(false).assertTrue();
});
} catch (error) {
console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_06 error:'
+ error);
expect(true).assertTrue();
if (fd > 0) {
asset.close(fd);
}
done();
}
});
//======================== ALBUM END ==================================
//======================== IMAGE BEGIN ==================================
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_07
......
......@@ -165,105 +165,6 @@ describe('fileAssetTestPromise.test.js', async function() {
//======================== FILE END ==================================
//======================== ALBUM BEGIN ==================================
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_04
* @tc.name : open('rw')
* @tc.desc : open -rw the type of ALBUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_04', 0, async function(done) {
let asset;
let fd;
try {
let type = mediaLibrary.MediaType.ALBUM;
let fetchOp = {
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
const dataList = await fetchFileResult.getAllObject();
asset = dataList[0];
fd = await asset.open('rw');
done();
} catch (error) {
console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_03 error:' + error);
expect(true).assertTrue();
if (fd > 0) {
asset.close(fd);
}
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_05
* @tc.name : open('r')
* @tc.desc : open -r the type of ALBUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_05', 0, async function(done) {
let asset;
let fd;
try {
let type = mediaLibrary.MediaType.ALBUM;
let fetchOp = {
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
const dataList = await fetchFileResult.getAllObject();
asset = dataList[0];
fd = await asset.open('r');
done();
} catch (error) {
console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_05 error:' + error);
expect(true).assertTrue();
if (fd > 0) {
asset.close(fd);
}
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_05
* @tc.name : open('w')
* @tc.desc : open -w the type of ALBUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_06', 0, async function(done) {
let asset;
let fd;
try {
let type = mediaLibrary.MediaType.ALBUM;
let fetchOp = {
selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?',
selectionArgs : [ type.toString() ],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
const dataList = await fetchFileResult.getAllObject();
asset = dataList[0];
fd = await asset.open('w');
done();
} catch (error) {
console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_06 error:' + error);
expect(true).assertTrue();
if (fd > 0) {
asset.close(fd);
}
done();
}
});
//======================== ALBUM END ==================================
//======================== IMAGE BEGIN ==================================
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_07
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册