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

!2663 add video/audio thumbnail

Merge pull request !2663 from 潘强标/master
...@@ -336,475 +336,527 @@ describe('FileAssetGetThumbnailPromise.test.js', function () { ...@@ -336,475 +336,527 @@ describe('FileAssetGetThumbnailPromise.test.js', function () {
}); });
// ------------------------------image type end-------------------------- // ------------------------------image type end--------------------------
// // ------------------------------video type start ----------------------- // ------------------------------video type start -----------------------
// /** /**
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_01 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_01
// * @tc.name : getThumbnail * @tc.name : getThumbnail
// * @tc.desc : getThumbnail(video) by { width: 128, height: 128 } * @tc.desc : getThumbnail(video) by { width: 128, height: 128 }
// * @tc.size : MEDIUM * @tc.size : MEDIUM
// * @tc.type : Function * @tc.type : Function
// * @tc.level : Level 0 * @tc.level : Level 0
// */ */
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_01', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_01', 0, async function (done) {
// try { try {
// const fetchFileResult = await media.getFileAssets(videoFetchOp); const fetchFileResult = await media.getFileAssets(videoFetchOp);
// const dataList = await fetchFileResult.getAllObject(); const dataList = await fetchFileResult.getAllObject();
// const asset = dataList[0]; const asset = dataList[0];
// let size = { width: 128, height: 128 }; let size = { width: 128, height: 128 };
// const pixelmap = await asset.getThumbnail(size); asset.getThumbnail(size, async (err, pixelmap) => {
// const info = await pixelmap.getImageInfo(); const info = await pixelmap.getImageInfo();
// console.info('MediaLibraryTest : 002_01 pixel image info ' + info); console.info('MediaLibraryTest : 002_01 pixel image info ' + info);
// console.info('MediaLibraryTest : 002_01 pixel width ' + info.size.width); console.info('MediaLibraryTest : 002_01 pixel width ' + info.size.width);
// console.info('MediaLibraryTest : 002_01 pixel height ' + info.size.height); console.info('MediaLibraryTest : 002_01 pixel height ' + info.size.height);
// if (info.size.width == size.width && info.size.height == size.height) { if (info.size.width == size.width && info.size.height == size.height) {
// expect(true).assertTrue(); expect(true).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 002_01 passed'); console.info('MediaLibraryTest : getThumbnail 002_01 passed');
// done(); done();
// } else { } else {
// expect(false).assertTrue(); expect(false).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 002_01 failed'); console.info('MediaLibraryTest : getThumbnail 002_01 failed');
// done(); done();
// } }
// } catch (error) { });
// console.info('MediaLibraryTest : getThumbnail 002_01 failed ' + error.message);
// expect(false).assertTrue(); } catch (error) {
// done(); console.info('MediaLibraryTest : getThumbnail 002_01 failed ' + error.message);
// } expect(false).assertTrue();
// }); done();
}
// /** });
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_02
// * @tc.name : getThumbnail /**
// * @tc.desc : getThumbnail(video) by { width: 128, height: 256 } * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_02
// * @tc.size : MEDIUM * @tc.name : getThumbnail
// * @tc.type : Function * @tc.desc : getThumbnail(video) by { width: 128, height: 256 }
// * @tc.level : Level 0 * @tc.size : MEDIUM
// */ * @tc.type : Function
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_02', 0, async function (done) { * @tc.level : Level 0
// try { */
// const fetchFileResult = await media.getFileAssets(videoFetchOp); it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_02', 0, async function (done) {
// const dataList = await fetchFileResult.getAllObject(); try {
// const asset = dataList[0]; const fetchFileResult = await media.getFileAssets(videoFetchOp);
// let size = { width: 128, height: 256 }; const dataList = await fetchFileResult.getAllObject();
// const pixelmap = await asset.getThumbnail(size); const asset = dataList[0];
// const info = await pixelmap.getImageInfo(); let size = { width: 128, height: 256 };
// console.info('MediaLibraryTest : 002_02 pixel image info ' + info); asset.getThumbnail(size, async (err, pixelmap) => {
// console.info('MediaLibraryTest : 002_02 pixel width ' + info.size.width); const info = await pixelmap.getImageInfo();
// console.info('MediaLibraryTest : 002_02 pixel height ' + info.size.height); console.info('MediaLibraryTest : 002_02 pixel image info ' + info);
// if (info.size.width == size.width && info.size.height == size.height) { console.info('MediaLibraryTest : 002_02 pixel width ' + info.size.width);
// expect(true).assertTrue(); console.info('MediaLibraryTest : 002_02 pixel height ' + info.size.height);
// console.info('MediaLibraryTest : getThumbnail 002_02 passed'); if (info.size.width == size.width && info.size.height == size.height) {
// done(); expect(true).assertTrue();
// } else { console.info('MediaLibraryTest : getThumbnail 002_02 passed');
// expect(false).assertTrue(); done();
// console.info('MediaLibraryTest : getThumbnail 002_02 failed'); } else {
// done(); expect(false).assertTrue();
// } console.info('MediaLibraryTest : getThumbnail 002_02 failed');
// } catch (error) { done();
// console.info('MediaLibraryTest : getThumbnail 002_02 failed ' + error.message); }
// expect(false).assertTrue(); });
// done();
// } } catch (error) {
// }); console.info('MediaLibraryTest : getThumbnail 002_02 failed ' + error.message);
expect(false).assertTrue();
// /** done();
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_03 }
// * @tc.name : getThumbnail });
// * @tc.desc : getThumbnail(video) by no arg
// * @tc.size : MEDIUM /**
// * @tc.type : Function * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_03
// * @tc.level : Level 0 * @tc.name : getThumbnail
// */ * @tc.desc : getThumbnail(video) by no arg
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_03', 0, async function (done) { * @tc.size : MEDIUM
// try { * @tc.type : Function
// const fetchFileResult = await media.getFileAssets(videoFetchOp); * @tc.level : Level 0
// const dataList = await fetchFileResult.getAllObject(); */
// const asset = dataList[0]; it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_03', 0, async function (done) {
// let size = { width: 256, height: 256 }; try {
// const pixelmap = await asset.getThumbnail(); const fetchFileResult = await media.getFileAssets(videoFetchOp);
// console.info('MediaLibraryTest : getThumbnail 002_03 Successfull ' + pixelmap); const dataList = await fetchFileResult.getAllObject();
// const info = await pixelmap.getImageInfo(); const asset = dataList[0];
// console.info('MediaLibraryTest : 002_03 pixel image info ' + info); let size = { width: 256, height: 256 };
// console.info('MediaLibraryTest : 002_03 pixel width ' + info.size.width); asset.getThumbnail(async (err, pixelmap) => {
// console.info('MediaLibraryTest : 002_03 pixel height ' + info.size.height); console.info('MediaLibraryTest : getThumbnail 002_03 Successfull ' + pixelmap);
// if (info.size.width == size.width && info.size.height == size.height) { const info = await pixelmap.getImageInfo();
// expect(true).assertTrue(); console.info('MediaLibraryTest : 002_03 pixel image info ' + info);
// console.info('MediaLibraryTest : getThumbnail 002_03 passed'); console.info('MediaLibraryTest : 002_03 pixel width ' + info.size.width);
// done(); console.info('MediaLibraryTest : 002_03 pixel height ' + info.size.height);
// } else { if (info.size.width == size.width && info.size.height == size.height) {
// expect(false).assertTrue(); expect(true).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 002_03 failed'); console.info('MediaLibraryTest : getThumbnail 002_03 passed');
// done(); done();
// } } else {
// } catch (error) { expect(false).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 002_03 failed ' + error.message); console.info('MediaLibraryTest : getThumbnail 002_03 failed');
// expect(false).assertTrue(); done();
// done(); }
// } });
// });
} catch (error) {
// /** console.info('MediaLibraryTest : getThumbnail 002_03 failed ' + error.message);
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_04 expect(false).assertTrue();
// * @tc.name : getThumbnail done();
// * @tc.desc : getThumbnail(video) by { width: 1, height: 1 } }
// * @tc.size : MEDIUM });
// * @tc.type : Function
// * @tc.level : Level 0 /**
// */ * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_04
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_04', 0, async function (done) { * @tc.name : getThumbnail
// try { * @tc.desc : getThumbnail(video) by { width: 1, height: 1 }
// const fetchFileResult = await media.getFileAssets(videoFetchOp); * @tc.size : MEDIUM
// const dataList = await fetchFileResult.getAllObject(); * @tc.type : Function
// const asset = dataList[0]; * @tc.level : Level 0
// let size = { width: 1, height: 1 }; */
// const pixelmap = await asset.getThumbnail(size); it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_04', 0, async function (done) {
// const info = await pixelmap.getImageInfo(); try {
// console.info('MediaLibraryTest : 002_04 pixel image info ' + info); const fetchFileResult = await media.getFileAssets(videoFetchOp);
// console.info('MediaLibraryTest : 002_04 pixel width ' + info.size.width); const dataList = await fetchFileResult.getAllObject();
// console.info('MediaLibraryTest : 002_04 pixel height ' + info.size.height); const asset = dataList[0];
// if (info.size.width == size.width && info.size.height == size.height) { let size = { width: 1, height: 1 };
// expect(true).assertTrue(); asset.getThumbnail(size, async (err, pixelmap) => {
// console.info('MediaLibraryTest : getThumbnail 001_05 passed'); const info = await pixelmap.getImageInfo();
// done(); console.info('MediaLibraryTest : 002_04 pixel image info ' + info);
// } else { console.info('MediaLibraryTest : 002_04 pixel width ' + info.size.width);
// expect(false).assertTrue(); console.info('MediaLibraryTest : 002_04 pixel height ' + info.size.height);
// console.info('MediaLibraryTest : getThumbnail 001_05 failed'); if (info.size.width == size.width && info.size.height == size.height) {
// done(); expect(true).assertTrue();
// } console.info('MediaLibraryTest : getThumbnail 001_05 passed');
// } catch (error) { done();
// console.info('MediaLibraryTest : getThumbnail 002_04 failed ' + error.message); } else {
// expect(false).assertTrue(); expect(false).assertTrue();
// done(); console.info('MediaLibraryTest : getThumbnail 001_05 failed');
// } done();
// }); }
});
// /**
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_05 } catch (error) {
// * @tc.name : getThumbnail console.info('MediaLibraryTest : getThumbnail 002_04 failed ' + error.message);
// * @tc.desc : getThumbnail(video) by { width: 0, height: 0 } expect(false).assertTrue();
// * @tc.size : MEDIUM done();
// * @tc.type : Function }
// * @tc.level : Level 0 });
// */
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_05', 0, async function (done) { /**
// try { * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_05
// const fetchFileResult = await media.getFileAssets(videoFetchOp); * @tc.name : getThumbnail
// const dataList = await fetchFileResult.getAllObject(); * @tc.desc : getThumbnail(video) by { width: 0, height: 0 }
// const asset = dataList[0]; * @tc.size : MEDIUM
// let size = { width: 0, height: 0 }; * @tc.type : Function
// const pixelmap = await asset.getThumbnail(size); * @tc.level : Level 0
// const info = await pixelmap.getImageInfo(); */
// console.info('MediaLibraryTest : 002_05 pixel image info ' + info); it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_05', 0, async function (done) {
// console.info('MediaLibraryTest : 002_05 pixel width ' + info.size.width); try {
// console.info('MediaLibraryTest : 002_05 pixel height ' + info.size.height); const fetchFileResult = await media.getFileAssets(videoFetchOp);
// console.info('MediaLibraryTest : getThumbnail 002_05 failed'); const dataList = await fetchFileResult.getAllObject();
// expect(true).assertTrue(); const asset = dataList[0];
// done(); let size = { width: 0, height: 0 };
// } catch (error) { asset.getThumbnail(size, async (err, pixelmap) => {
// console.info('MediaLibraryTest : getThumbnail 002_05 passed'); if(pixelmap == undefined) {
// expect(false).assertTrue(); console.info('MediaLibraryTest : getThumbnail 002_05 passed');
// done(); expect(true).assertTrue();
// } done();
// }); } else {
const info = await pixelmap.getImageInfo();
// /** console.info('MediaLibraryTest : 002_05 pixel image info ' + info);
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_06 console.info('MediaLibraryTest : 002_05 pixel width ' + info.size.width);
// * @tc.name : getThumbnail console.info('MediaLibraryTest : 002_05 pixel height ' + info.size.height);
// * @tc.desc : getThumbnail(video) by { width: -128, height: -128 } console.info('MediaLibraryTest : getThumbnail 002_05 failed');
// * @tc.size : MEDIUM expect(false).assertTrue();
// * @tc.type : Function done();
// * @tc.level : Level 0 }
// */ });
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_06', 0, async function (done) {
// try { } catch (error) {
// const fetchFileResult = await media.getFileAssets(videoFetchOp); console.info('MediaLibraryTest : getThumbnail 002_05 failed');
// const dataList = await fetchFileResult.getAllObject(); expect(false).assertTrue();
// const asset = dataList[0]; done();
// let size = { width: -128, height: -128 }; }
// const pixelmap = await asset.getThumbnail(size); });
// const info = await pixelmap.getImageInfo();
// console.info('MediaLibraryTest : 002_06 pixel image info ' + info); /**
// console.info('MediaLibraryTest : 002_06 pixel width ' + info.size.width); * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_06
// console.info('MediaLibraryTest : 002_06 pixel height ' + info.size.height); * @tc.name : getThumbnail
// console.info('MediaLibraryTest : getThumbnail 003_01 failed'); * @tc.desc : getThumbnail(video) by { width: -128, height: -128 }
// expect(true).assertTrue(); * @tc.size : MEDIUM
// done(); * @tc.type : Function
// } catch (error) { * @tc.level : Level 0
// console.info('MediaLibraryTest : getThumbnail 002_06 passed'); */
// expect(false).assertTrue(); it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_06', 0, async function (done) {
// done(); try {
// } const fetchFileResult = await media.getFileAssets(videoFetchOp);
// }); const dataList = await fetchFileResult.getAllObject();
const asset = dataList[0];
// /** let size = { width: -128, height: -128 };
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_07 const pixelmap = await asset.getThumbnail(size, async (err, pixelmap) => {
// * @tc.name : getThumbnail if(pixelmap ==undefined) {
// * @tc.desc : getThumbnail(audio) by { width: 1024, height: 1024 } console.info('MediaLibraryTest : getThumbnail 002_06 passed');
// * @tc.size : MEDIUM expect(true).assertTrue();
// * @tc.type : Function done();
// * @tc.level : Level 0 }else {
// */ const info = await pixelmap.getImageInfo();
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_07', 0, async function (done) { console.info('MediaLibraryTest : 002_06 pixel image info ' + info);
// try { console.info('MediaLibraryTest : 002_06 pixel width ' + info.size.width);
// const fetchFileResult = await media.getFileAssets(videoFetchOp); console.info('MediaLibraryTest : 002_06 pixel height ' + info.size.height);
// const dataList = await fetchFileResult.getAllObject(); console.info('MediaLibraryTest : getThumbnail 003_01 failed');
// const asset = dataList[0]; expect(false).assertTrue();
// let size = { width: 1024, height: 1024 }; done();
// const pixelmap = await asset.getThumbnail(size); }
// const info = await pixelmap.getImageInfo(); });
// console.info('MediaLibraryTest : 003_06 pixel image info ' + info);
// console.info('MediaLibraryTest : 003_06 pixel width ' + info.size.width); } catch (error) {
// console.info('MediaLibraryTest : 003_06 pixel height ' + info.size.height); console.info('MediaLibraryTest : getThumbnail 002_06 failed');
// if (info.size.width == size.width && info.size.height == size.height) { expect(false).assertTrue();
// expect(true).assertTrue(); done();
// console.info('MediaLibraryTest : getThumbnail 002_07 passed'); }
// done(); });
// } else {
// expect(false).assertTrue(); /**
// console.info('MediaLibraryTest : getThumbnail 002_07 failed'); * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_07
// done(); * @tc.name : getThumbnail
// } * @tc.desc : getThumbnail(audio) by { width: 1024, height: 1024 }
// } catch (error) { * @tc.size : MEDIUM
// console.info('MediaLibraryTest : getThumbnail 002_07 failed ' + error.message); * @tc.type : Function
// expect(false).assertTrue(); * @tc.level : Level 0
// done(); */
// } it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_002_07', 0, async function (done) {
// }); try {
// // ------------------------------video type end-------------------------- const fetchFileResult = await media.getFileAssets(videoFetchOp);
const dataList = await fetchFileResult.getAllObject();
// // ------------------------------audio type start ----------------------- const asset = dataList[0];
// /** let size = { width: 1024, height: 1024 };
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_01 asset.getThumbnail(size, async (err, pixelmap) => {
// * @tc.name : getThumbnail const info = await pixelmap.getImageInfo();
// * @tc.desc : getThumbnail(audio) by { width: 128, height: 128 } console.info('MediaLibraryTest : 003_06 pixel image info ' + info);
// * @tc.size : MEDIUM console.info('MediaLibraryTest : 003_06 pixel width ' + info.size.width);
// * @tc.type : Function console.info('MediaLibraryTest : 003_06 pixel height ' + info.size.height);
// * @tc.level : Level 0 if (info.size.width == size.width && info.size.height == size.height) {
// */ expect(true).assertTrue();
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_01', 0, async function (done) { console.info('MediaLibraryTest : getThumbnail 002_07 passed');
// try { done();
// const fetchFileResult = await media.getFileAssets(audioFetchOp); } else {
// const dataList = await fetchFileResult.getAllObject(); expect(false).assertTrue();
// const asset = dataList[0]; console.info('MediaLibraryTest : getThumbnail 002_07 failed');
// let size = { width: 128, height: 128 }; done();
// const pixelmap = await asset.getThumbnail(size); }
// const info = await pixelmap.getImageInfo(); });
// console.info('MediaLibraryTest : 003_01 pixel image info ' + info);
// console.info('MediaLibraryTest : 003_01 pixel width ' + info.size.width); } catch (error) {
// console.info('MediaLibraryTest : 003_01 pixel height ' + info.size.height); console.info('MediaLibraryTest : getThumbnail 002_07 failed ' + error.message);
// if (info.size.width == size.width && info.size.height == size.height) { expect(false).assertTrue();
// expect(true).assertTrue(); done();
// console.info('MediaLibraryTest : getThumbnail 003_01 passed'); }
// done(); });
// } else { // ------------------------------video type end--------------------------
// expect(false).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 003_01 failed'); // ------------------------------audio type start -----------------------
// done(); /**
// } * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_01
// } catch (error) { * @tc.name : getThumbnail
// console.info('MediaLibraryTest : getThumbnail 003_01 failed ' + error.message); * @tc.desc : getThumbnail(audio) by { width: 128, height: 128 }
// expect(false).assertTrue(); * @tc.size : MEDIUM
// done(); * @tc.type : Function
// } * @tc.level : Level 0
// }); */
it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_01', 0, async function (done) {
// /** try {
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_02 const fetchFileResult = await media.getFileAssets(audioFetchOp);
// * @tc.name : getThumbnail const dataList = await fetchFileResult.getAllObject();
// * @tc.desc : getThumbnail(audio) by { width: 128, height: 256 } const asset = dataList[0];
// * @tc.size : MEDIUM let size = { width: 128, height: 128 };
// * @tc.type : Function asset.getThumbnail(size, async (err, pixelmap) => {
// * @tc.level : Level 0 const info = await pixelmap.getImageInfo();
// */ console.info('MediaLibraryTest : 003_01 pixel image info ' + info);
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_02', 0, async function (done) { console.info('MediaLibraryTest : 003_01 pixel width ' + info.size.width);
// try { console.info('MediaLibraryTest : 003_01 pixel height ' + info.size.height);
// const fetchFileResult = await media.getFileAssets(audioFetchOp); if (info.size.width == size.width && info.size.height == size.height) {
// const dataList = await fetchFileResult.getAllObject(); expect(true).assertTrue();
// const asset = dataList[0]; console.info('MediaLibraryTest : getThumbnail 003_01 passed');
// let size = { width: 128, height: 256 }; done();
// const pixelmap = await asset.getThumbnail(size); } else {
// const info = await pixelmap.getImageInfo(); expect(false).assertTrue();
// console.info('MediaLibraryTest : 003_02 pixel image info ' + info); console.info('MediaLibraryTest : getThumbnail 003_01 failed');
// console.info('MediaLibraryTest : 003_02 pixel width ' + info.size.width); done();
// console.info('MediaLibraryTest : 003_02 pixel height ' + info.size.height); }
// if (info.size.width == size.width && info.size.height == size.height) { });
// expect(true).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 003_02 passed'); } catch (error) {
// done(); console.info('MediaLibraryTest : getThumbnail 003_01 failed ' + error.message);
// } else { expect(false).assertTrue();
// expect(false).assertTrue(); done();
// console.info('MediaLibraryTest : getThumbnail 003_02 failed'); }
// done(); });
// }
// } catch (error) { /**
// console.info('MediaLibraryTest : getThumbnail 003_02 failed ' + error.message); * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_02
// expect(false).assertTrue(); * @tc.name : getThumbnail
// done(); * @tc.desc : getThumbnail(audio) by { width: 128, height: 256 }
// } * @tc.size : MEDIUM
// }); * @tc.type : Function
* @tc.level : Level 0
// /** */
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_03 it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_02', 0, async function (done) {
// * @tc.name : getThumbnail try {
// * @tc.desc : getThumbnail(audio) by no arg const fetchFileResult = await media.getFileAssets(audioFetchOp);
// * @tc.size : MEDIUM const dataList = await fetchFileResult.getAllObject();
// * @tc.type : Function const asset = dataList[0];
// * @tc.level : Level 0 let size = { width: 128, height: 256 };
// */ asset.getThumbnail(size, async (err, pixelmap) => {
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_03', 0, async function (done) { const info = await pixelmap.getImageInfo();
// try { console.info('MediaLibraryTest : 003_02 pixel image info ' + info);
// const fetchFileResult = await media.getFileAssets(audioFetchOp); console.info('MediaLibraryTest : 003_02 pixel width ' + info.size.width);
// const dataList = await fetchFileResult.getAllObject(); console.info('MediaLibraryTest : 003_02 pixel height ' + info.size.height);
// const asset = dataList[0]; if (info.size.width == size.width && info.size.height == size.height) {
// let size = { width: 256, height: 256 }; expect(true).assertTrue();
// const pixelmap = await asset.getThumbnail(); console.info('MediaLibraryTest : getThumbnail 003_02 passed');
// const info = await pixelmap.getImageInfo(); done();
// console.info('MediaLibraryTest : 003_03 pixel image info ' + info); } else {
// console.info('MediaLibraryTest : 003_03 pixel width ' + info.size.width); expect(false).assertTrue();
// console.info('MediaLibraryTest : 003_03 pixel height ' + info.size.height); console.info('MediaLibraryTest : getThumbnail 003_02 failed');
// if (info.size.width == size.width && info.size.height == size.height) { done();
// expect(true).assertTrue(); }
// console.info('MediaLibraryTest : getThumbnail 003_03 passed'); });
// done();
// } else { } catch (error) {
// expect(false).assertTrue(); console.info('MediaLibraryTest : getThumbnail 003_02 failed ' + error.message);
// console.info('MediaLibraryTest : getThumbnail 003_03 failed'); expect(false).assertTrue();
// done(); done();
// } }
// } catch (error) { });
// console.info('MediaLibraryTest : getThumbnail 003_03 failed ' + error.message);
// expect(false).assertTrue(); /**
// done(); * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_03
// } * @tc.name : getThumbnail
// }); * @tc.desc : getThumbnail(audio) by no arg
* @tc.size : MEDIUM
// /** * @tc.type : Function
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_04 * @tc.level : Level 0
// * @tc.name : getThumbnail */
// * @tc.desc : getThumbnail(audio) by { width: 1, height: 1 } it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_03', 0, async function (done) {
// * @tc.size : MEDIUM try {
// * @tc.type : Function const fetchFileResult = await media.getFileAssets(audioFetchOp);
// * @tc.level : Level 0 const dataList = await fetchFileResult.getAllObject();
// */ const asset = dataList[0];
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_04', 0, async function (done) { let size = { width: 256, height: 256 };
// try { asset.getThumbnail(async (err, pixelmap) => {
// const fetchFileResult = await media.getFileAssets(audioFetchOp); const info = await pixelmap.getImageInfo();
// const dataList = await fetchFileResult.getAllObject(); console.info('MediaLibraryTest : 003_03 pixel image info ' + info);
// const asset = dataList[0]; console.info('MediaLibraryTest : 003_03 pixel width ' + info.size.width);
// let size = { width: 1, height: 1 }; console.info('MediaLibraryTest : 003_03 pixel height ' + info.size.height);
// const pixelmap = await asset.getThumbnail(size); if (info.size.width == size.width && info.size.height == size.height) {
// const info = await pixelmap.getImageInfo(); expect(true).assertTrue();
// console.info('MediaLibraryTest : 003_04 pixel image info ' + info); console.info('MediaLibraryTest : getThumbnail 003_03 passed');
// console.info('MediaLibraryTest : 003_04 pixel width ' + info.size.width); done();
// console.info('MediaLibraryTest : 003_04 pixel height ' + info.size.height); } else {
// if (info.size.width == size.width && info.size.height == size.height) { expect(false).assertTrue();
// expect(true).assertTrue(); console.info('MediaLibraryTest : getThumbnail 003_03 failed');
// console.info('MediaLibraryTest : getThumbnail 003_04 passed'); done();
// done(); }
// } else { });
// expect(false).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 003_04 failed'); } catch (error) {
// done(); console.info('MediaLibraryTest : getThumbnail 003_03 failed ' + error.message);
// } expect(false).assertTrue();
// } catch (error) { done();
// console.info('MediaLibraryTest : getThumbnail 003_04 failed ' + error.message); }
// expect(false).assertTrue(); });
// done();
// } /**
// }); * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_04
* @tc.name : getThumbnail
// /** * @tc.desc : getThumbnail(audio) by { width: 1, height: 1 }
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_05 * @tc.size : MEDIUM
// * @tc.name : getThumbnail * @tc.type : Function
// * @tc.desc : getThumbnail(audio) by { width: 0, height: 0 } * @tc.level : Level 0
// * @tc.size : MEDIUM */
// * @tc.type : Function it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_04', 0, async function (done) {
// * @tc.level : Level 0 try {
// */ const fetchFileResult = await media.getFileAssets(audioFetchOp);
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_05', 0, async function (done) { const dataList = await fetchFileResult.getAllObject();
// try { const asset = dataList[0];
// const fetchFileResult = await media.getFileAssets(audioFetchOp); let size = { width: 1, height: 1 };
// const dataList = await fetchFileResult.getAllObject(); asset.getThumbnail(size, async (err, pixelmap) => {
// const asset = dataList[0]; const info = await pixelmap.getImageInfo();
// let size = { width: 0, height: 0 }; console.info('MediaLibraryTest : 003_04 pixel image info ' + info);
// const pixelmap = await asset.getThumbnail(size); console.info('MediaLibraryTest : 003_04 pixel width ' + info.size.width);
// const info = await pixelmap.getImageInfo(); console.info('MediaLibraryTest : 003_04 pixel height ' + info.size.height);
// console.info('MediaLibraryTest : getThumbnail 003_06 failed'); if (info.size.width == size.width && info.size.height == size.height) {
// console.info('MediaLibraryTest : 003_05 pixel image info ' + info); expect(true).assertTrue();
// console.info('MediaLibraryTest : 003_05 pixel width ' + info.size.width); console.info('MediaLibraryTest : getThumbnail 003_04 passed');
// console.info('MediaLibraryTest : 003_05 pixel height ' + info.size.height); done();
// expect(true).assertTrue(); } else {
// done(); expect(false).assertTrue();
// } catch (error) { console.info('MediaLibraryTest : getThumbnail 003_04 failed');
// console.info('MediaLibraryTest : getThumbnail 003_05 passed'); done();
// expect(false).assertTrue(); }
// done(); });
// }
// }); } catch (error) {
console.info('MediaLibraryTest : getThumbnail 003_04 failed ' + error.message);
// /** expect(false).assertTrue();
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_06 done();
// * @tc.name : getThumbnail }
// * @tc.desc : getThumbnail(audio) by { width: -128, height: -128 } });
// * @tc.size : MEDIUM
// * @tc.type : Function /**
// * @tc.level : Level 0 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_05
// */ * @tc.name : getThumbnail
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_06', 0, async function (done) { * @tc.desc : getThumbnail(audio) by { width: 0, height: 0 }
// try { * @tc.size : MEDIUM
// const fetchFileResult = await media.getFileAssets(audioFetchOp); * @tc.type : Function
// const dataList = await fetchFileResult.getAllObject(); * @tc.level : Level 0
// const asset = dataList[0]; */
// let size = { width: -128, height: -128 }; it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_05', 0, async function (done) {
// const pixelmap = await asset.getThumbnail(size); try {
// const info = await pixelmap.getImageInfo(); const fetchFileResult = await media.getFileAssets(audioFetchOp);
// console.info('MediaLibraryTest : 003_06 pixel image info ' + info); const dataList = await fetchFileResult.getAllObject();
// console.info('MediaLibraryTest : 003_06 pixel width ' + info.size.width); const asset = dataList[0];
// console.info('MediaLibraryTest : 003_06 pixel height ' + info.size.height); let size = { width: 0, height: 0 };
// console.info('MediaLibraryTest : getThumbnail 003_06 failed'); asset.getThumbnail(size, async (err, pixelmap) => {
if(pixelmap ==undefined) {
// expect(true).assertTrue(); console.info('MediaLibraryTest : getThumbnail 003_05 passed');
// done(); expect(true).assertTrue();
// } catch (error) { done();
// console.info('MediaLibraryTest : getThumbnail 003_06 passed'); } else {
// expect(false).assertTrue(); const info = await pixelmap.getImageInfo();
// done(); console.info('MediaLibraryTest : getThumbnail 003_06 failed');
// } console.info('MediaLibraryTest : 003_05 pixel image info ' + info);
// }); console.info('MediaLibraryTest : 003_05 pixel width ' + info.size.width);
console.info('MediaLibraryTest : 003_05 pixel height ' + info.size.height);
// /** expect(false).assertTrue();
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_07 done();
// * @tc.name : getThumbnail }
// * @tc.desc : getThumbnail(audio) by { width: 1024, height: 1024 } });
// * @tc.size : MEDIUM
// * @tc.type : Function } catch (error) {
// * @tc.level : Level 0 console.info('MediaLibraryTest : getThumbnail 003_05 failed');
// */ expect(false).assertTrue();
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_07', 0, async function (done) { done();
// try { }
// const fetchFileResult = await media.getFileAssets(audioFetchOp); });
// const dataList = await fetchFileResult.getAllObject();
// const asset = dataList[0]; /**
// let size = { width: 1024, height: 1024 }; * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_06
// const pixelmap = await asset.getThumbnail(size); * @tc.name : getThumbnail
// const info = await pixelmap.getImageInfo(); * @tc.desc : getThumbnail(audio) by { width: -128, height: -128 }
// console.info('MediaLibraryTest : 003_06 pixel image info ' + info); * @tc.size : MEDIUM
// console.info('MediaLibraryTest : 003_06 pixel width ' + info.size.width); * @tc.type : Function
// console.info('MediaLibraryTest : 003_06 pixel height ' + info.size.height); * @tc.level : Level 0
// if (info.size.width == size.width && info.size.height == size.height) { */
// expect(true).assertTrue(); it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_06', 0, async function (done) {
// console.info('MediaLibraryTest : getThumbnail 003_07 passed'); try {
// done(); const fetchFileResult = await media.getFileAssets(audioFetchOp);
// } else { const dataList = await fetchFileResult.getAllObject();
// expect(false).assertTrue(); const asset = dataList[0];
// console.info('MediaLibraryTest : getThumbnail 003_07 failed'); let size = { width: -128, height: -128 };
// done(); asset.getThumbnail(size, async (err, pixelmap) => {
// } if(pixelmap ==undefined) {
// } catch (error) { console.info('MediaLibraryTest : getThumbnail 003_06 passed');
// console.info('MediaLibraryTest : getThumbnail 003_07 failed ' + error.message); expect(true).assertTrue();
// expect(false).assertTrue(); done();
// done(); } else {
// } const info = await pixelmap.getImageInfo();
// }); console.info('MediaLibraryTest : 003_06 pixel image info ' + info);
console.info('MediaLibraryTest : 003_06 pixel width ' + info.size.width);
console.info('MediaLibraryTest : 003_06 pixel height ' + info.size.height);
console.info('MediaLibraryTest : getThumbnail 003_06 failed');
expect(false).assertTrue();
done();
}
});
} catch (error) {
console.info('MediaLibraryTest : getThumbnail 003_06 failed');
expect(false).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_07
* @tc.name : getThumbnail
* @tc.desc : getThumbnail(audio) by { width: 1024, height: 1024 }
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_CALLBACK_003_07', 0, async function (done) {
try {
const fetchFileResult = await media.getFileAssets(audioFetchOp);
const dataList = await fetchFileResult.getAllObject();
const asset = dataList[0];
let size = { width: 1024, height: 1024 };
asset.getThumbnail(size, async (err, pixelmap) => {
const info = await pixelmap.getImageInfo();
console.info('MediaLibraryTest : 003_06 pixel image info ' + info);
console.info('MediaLibraryTest : 003_06 pixel width ' + info.size.width);
console.info('MediaLibraryTest : 003_06 pixel height ' + info.size.height);
if (info.size.width == size.width && info.size.height == size.height) {
expect(true).assertTrue();
console.info('MediaLibraryTest : getThumbnail 003_07 passed');
done();
} else {
expect(false).assertTrue();
console.info('MediaLibraryTest : getThumbnail 003_07 failed');
done();
}
});
} catch (error) {
console.info('MediaLibraryTest : getThumbnail 003_07 failed ' + error.message);
expect(false).assertTrue();
done();
}
});
// ------------------------------audio type end-------------------------- // ------------------------------audio type end--------------------------
}); });
...@@ -285,475 +285,475 @@ describe('FileAssetGetThumbnailPromise.test.js', function () { ...@@ -285,475 +285,475 @@ describe('FileAssetGetThumbnailPromise.test.js', function () {
}); });
// ------------------------------image type end-------------------------- // ------------------------------image type end--------------------------
// // ------------------------------video type start ----------------------- // ------------------------------video type start -----------------------
// /** /**
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_01 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_01
// * @tc.name : getThumbnail * @tc.name : getThumbnail
// * @tc.desc : getThumbnail(video) by { width: 128, height: 128 } * @tc.desc : getThumbnail(video) by { width: 128, height: 128 }
// * @tc.size : MEDIUM * @tc.size : MEDIUM
// * @tc.type : Function * @tc.type : Function
// * @tc.level : Level 0 * @tc.level : Level 0
// */ */
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_01', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_01', 0, async function (done) {
// try { try {
// const fetchFileResult = await media.getFileAssets(videoFetchOp); const fetchFileResult = await media.getFileAssets(videoFetchOp);
// const dataList = await fetchFileResult.getAllObject(); const dataList = await fetchFileResult.getAllObject();
// const asset = dataList[0]; const asset = dataList[0];
// let size = { width: 128, height: 128 }; let size = { width: 128, height: 128 };
// const pixelmap = await asset.getThumbnail(size); const pixelmap = await asset.getThumbnail(size);
// const info = await pixelmap.getImageInfo(); const info = await pixelmap.getImageInfo();
// console.info('MediaLibraryTest : 002_01 pixel image info ' + info); console.info('MediaLibraryTest : 002_01 pixel image info ' + info);
// console.info('MediaLibraryTest : 002_01 pixel width ' + info.size.width); console.info('MediaLibraryTest : 002_01 pixel width ' + info.size.width);
// console.info('MediaLibraryTest : 002_01 pixel height ' + info.size.height); console.info('MediaLibraryTest : 002_01 pixel height ' + info.size.height);
// if (info.size.width == size.width && info.size.height == size.height) { if (info.size.width == size.width && info.size.height == size.height) {
// expect(true).assertTrue(); expect(true).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 002_01 passed'); console.info('MediaLibraryTest : getThumbnail 002_01 passed');
// done(); done();
// } else { } else {
// expect(false).assertTrue(); expect(false).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 002_01 failed'); console.info('MediaLibraryTest : getThumbnail 002_01 failed');
// done(); done();
// } }
// } catch (error) { } catch (error) {
// console.info('MediaLibraryTest : getThumbnail 002_01 failed ' + error.message); console.info('MediaLibraryTest : getThumbnail 002_01 failed ' + error.message);
// expect(false).assertTrue(); expect(false).assertTrue();
// done(); done();
// } }
// }); });
// /** /**
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_02 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_02
// * @tc.name : getThumbnail * @tc.name : getThumbnail
// * @tc.desc : getThumbnail(video) by { width: 128, height: 256 } * @tc.desc : getThumbnail(video) by { width: 128, height: 256 }
// * @tc.size : MEDIUM * @tc.size : MEDIUM
// * @tc.type : Function * @tc.type : Function
// * @tc.level : Level 0 * @tc.level : Level 0
// */ */
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_02', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_02', 0, async function (done) {
// try { try {
// const fetchFileResult = await media.getFileAssets(videoFetchOp); const fetchFileResult = await media.getFileAssets(videoFetchOp);
// const dataList = await fetchFileResult.getAllObject(); const dataList = await fetchFileResult.getAllObject();
// const asset = dataList[0]; const asset = dataList[0];
// let size = { width: 128, height: 256 }; let size = { width: 128, height: 256 };
// const pixelmap = await asset.getThumbnail(size); const pixelmap = await asset.getThumbnail(size);
// const info = await pixelmap.getImageInfo(); const info = await pixelmap.getImageInfo();
// console.info('MediaLibraryTest : 002_02 pixel image info ' + info); console.info('MediaLibraryTest : 002_02 pixel image info ' + info);
// console.info('MediaLibraryTest : 002_02 pixel width ' + info.size.width); console.info('MediaLibraryTest : 002_02 pixel width ' + info.size.width);
// console.info('MediaLibraryTest : 002_02 pixel height ' + info.size.height); console.info('MediaLibraryTest : 002_02 pixel height ' + info.size.height);
// if (info.size.width == size.width && info.size.height == size.height) { if (info.size.width == size.width && info.size.height == size.height) {
// expect(true).assertTrue(); expect(true).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 002_02 passed'); console.info('MediaLibraryTest : getThumbnail 002_02 passed');
// done(); done();
// } else { } else {
// expect(false).assertTrue(); expect(false).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 002_02 failed'); console.info('MediaLibraryTest : getThumbnail 002_02 failed');
// done(); done();
// } }
// } catch (error) { } catch (error) {
// console.info('MediaLibraryTest : getThumbnail 002_02 failed ' + error.message); console.info('MediaLibraryTest : getThumbnail 002_02 failed ' + error.message);
// expect(false).assertTrue(); expect(false).assertTrue();
// done(); done();
// } }
// }); });
// /** /**
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_03 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_03
// * @tc.name : getThumbnail * @tc.name : getThumbnail
// * @tc.desc : getThumbnail(video) by no arg * @tc.desc : getThumbnail(video) by no arg
// * @tc.size : MEDIUM * @tc.size : MEDIUM
// * @tc.type : Function * @tc.type : Function
// * @tc.level : Level 0 * @tc.level : Level 0
// */ */
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_03', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_03', 0, async function (done) {
// try { try {
// const fetchFileResult = await media.getFileAssets(videoFetchOp); const fetchFileResult = await media.getFileAssets(videoFetchOp);
// const dataList = await fetchFileResult.getAllObject(); const dataList = await fetchFileResult.getAllObject();
// const asset = dataList[0]; const asset = dataList[0];
// let size = { width: 256, height: 256 }; let size = { width: 256, height: 256 };
// const pixelmap = await asset.getThumbnail(); const pixelmap = await asset.getThumbnail();
// console.info('MediaLibraryTest : getThumbnail 002_03 Successfull ' + pixelmap); console.info('MediaLibraryTest : getThumbnail 002_03 Successfull ' + pixelmap);
// const info = await pixelmap.getImageInfo(); const info = await pixelmap.getImageInfo();
// console.info('MediaLibraryTest : 002_03 pixel image info ' + info); console.info('MediaLibraryTest : 002_03 pixel image info ' + info);
// console.info('MediaLibraryTest : 002_03 pixel width ' + info.size.width); console.info('MediaLibraryTest : 002_03 pixel width ' + info.size.width);
// console.info('MediaLibraryTest : 002_03 pixel height ' + info.size.height); console.info('MediaLibraryTest : 002_03 pixel height ' + info.size.height);
// if (info.size.width == size.width && info.size.height == size.height) { if (info.size.width == size.width && info.size.height == size.height) {
// expect(true).assertTrue(); expect(true).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 002_03 passed'); console.info('MediaLibraryTest : getThumbnail 002_03 passed');
// done(); done();
// } else { } else {
// expect(false).assertTrue(); expect(false).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 002_03 failed'); console.info('MediaLibraryTest : getThumbnail 002_03 failed');
// done(); done();
// } }
// } catch (error) { } catch (error) {
// console.info('MediaLibraryTest : getThumbnail 002_03 failed ' + error.message); console.info('MediaLibraryTest : getThumbnail 002_03 failed ' + error.message);
// expect(false).assertTrue(); expect(false).assertTrue();
// done(); done();
// } }
// }); });
// /** /**
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_04 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_04
// * @tc.name : getThumbnail * @tc.name : getThumbnail
// * @tc.desc : getThumbnail(video) by { width: 1, height: 1 } * @tc.desc : getThumbnail(video) by { width: 1, height: 1 }
// * @tc.size : MEDIUM * @tc.size : MEDIUM
// * @tc.type : Function * @tc.type : Function
// * @tc.level : Level 0 * @tc.level : Level 0
// */ */
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_04', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_04', 0, async function (done) {
// try { try {
// const fetchFileResult = await media.getFileAssets(videoFetchOp); const fetchFileResult = await media.getFileAssets(videoFetchOp);
// const dataList = await fetchFileResult.getAllObject(); const dataList = await fetchFileResult.getAllObject();
// const asset = dataList[0]; const asset = dataList[0];
// let size = { width: 1, height: 1 }; let size = { width: 1, height: 1 };
// const pixelmap = await asset.getThumbnail(size); const pixelmap = await asset.getThumbnail(size);
// const info = await pixelmap.getImageInfo(); const info = await pixelmap.getImageInfo();
// console.info('MediaLibraryTest : 002_04 pixel image info ' + info); console.info('MediaLibraryTest : 002_04 pixel image info ' + info);
// console.info('MediaLibraryTest : 002_04 pixel width ' + info.size.width); console.info('MediaLibraryTest : 002_04 pixel width ' + info.size.width);
// console.info('MediaLibraryTest : 002_04 pixel height ' + info.size.height); console.info('MediaLibraryTest : 002_04 pixel height ' + info.size.height);
// if (info.size.width == size.width && info.size.height == size.height) { if (info.size.width == size.width && info.size.height == size.height) {
// expect(true).assertTrue(); expect(true).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 001_05 passed'); console.info('MediaLibraryTest : getThumbnail 001_05 passed');
// done(); done();
// } else { } else {
// expect(false).assertTrue(); expect(false).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 001_05 failed'); console.info('MediaLibraryTest : getThumbnail 001_05 failed');
// done(); done();
// } }
// } catch (error) { } catch (error) {
// console.info('MediaLibraryTest : getThumbnail 002_04 failed ' + error.message); console.info('MediaLibraryTest : getThumbnail 002_04 failed ' + error.message);
// expect(false).assertTrue(); expect(false).assertTrue();
// done(); done();
// } }
// }); });
// /** /**
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_05 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_05
// * @tc.name : getThumbnail * @tc.name : getThumbnail
// * @tc.desc : getThumbnail(video) by { width: 0, height: 0 } * @tc.desc : getThumbnail(video) by { width: 0, height: 0 }
// * @tc.size : MEDIUM * @tc.size : MEDIUM
// * @tc.type : Function * @tc.type : Function
// * @tc.level : Level 0 * @tc.level : Level 0
// */ */
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_05', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_05', 0, async function (done) {
// try { try {
// const fetchFileResult = await media.getFileAssets(videoFetchOp); const fetchFileResult = await media.getFileAssets(videoFetchOp);
// const dataList = await fetchFileResult.getAllObject(); const dataList = await fetchFileResult.getAllObject();
// const asset = dataList[0]; const asset = dataList[0];
// let size = { width: 0, height: 0 }; let size = { width: 0, height: 0 };
// const pixelmap = await asset.getThumbnail(size); const pixelmap = await asset.getThumbnail(size);
// const info = await pixelmap.getImageInfo(); const info = await pixelmap.getImageInfo();
// console.info('MediaLibraryTest : 002_05 pixel image info ' + info); console.info('MediaLibraryTest : 002_05 pixel image info ' + info);
// console.info('MediaLibraryTest : 002_05 pixel width ' + info.size.width); console.info('MediaLibraryTest : 002_05 pixel width ' + info.size.width);
// console.info('MediaLibraryTest : 002_05 pixel height ' + info.size.height); console.info('MediaLibraryTest : 002_05 pixel height ' + info.size.height);
// console.info('MediaLibraryTest : getThumbnail 002_05 failed'); console.info('MediaLibraryTest : getThumbnail 002_05 failed');
// expect(true).assertTrue(); expect(false).assertTrue();
// done(); done();
// } catch (error) { } catch (error) {
// console.info('MediaLibraryTest : getThumbnail 002_05 passed'); console.info('MediaLibraryTest : getThumbnail 002_05 passed');
// expect(false).assertTrue(); expect(true).assertTrue();
// done(); done();
// } }
// }); });
// /** /**
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_06 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_06
// * @tc.name : getThumbnail * @tc.name : getThumbnail
// * @tc.desc : getThumbnail(video) by { width: -128, height: -128 } * @tc.desc : getThumbnail(video) by { width: -128, height: -128 }
// * @tc.size : MEDIUM * @tc.size : MEDIUM
// * @tc.type : Function * @tc.type : Function
// * @tc.level : Level 0 * @tc.level : Level 0
// */ */
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_06', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_06', 0, async function (done) {
// try { try {
// const fetchFileResult = await media.getFileAssets(videoFetchOp); const fetchFileResult = await media.getFileAssets(videoFetchOp);
// const dataList = await fetchFileResult.getAllObject(); const dataList = await fetchFileResult.getAllObject();
// const asset = dataList[0]; const asset = dataList[0];
// let size = { width: -128, height: -128 }; let size = { width: -128, height: -128 };
// const pixelmap = await asset.getThumbnail(size); const pixelmap = await asset.getThumbnail(size);
// const info = await pixelmap.getImageInfo(); const info = await pixelmap.getImageInfo();
// console.info('MediaLibraryTest : 002_06 pixel image info ' + info); console.info('MediaLibraryTest : 002_06 pixel image info ' + info);
// console.info('MediaLibraryTest : 002_06 pixel width ' + info.size.width); console.info('MediaLibraryTest : 002_06 pixel width ' + info.size.width);
// console.info('MediaLibraryTest : 002_06 pixel height ' + info.size.height); console.info('MediaLibraryTest : 002_06 pixel height ' + info.size.height);
// console.info('MediaLibraryTest : getThumbnail 003_01 failed'); console.info('MediaLibraryTest : getThumbnail 003_01 failed');
// expect(true).assertTrue(); expect(false).assertTrue();
// done(); done();
// } catch (error) { } catch (error) {
// console.info('MediaLibraryTest : getThumbnail 002_06 passed'); console.info('MediaLibraryTest : getThumbnail 002_06 passed');
// expect(false).assertTrue(); expect(true).assertTrue();
// done(); done();
// } }
// }); });
// /** /**
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_07 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_07
// * @tc.name : getThumbnail * @tc.name : getThumbnail
// * @tc.desc : getThumbnail(audio) by { width: 1024, height: 1024 } * @tc.desc : getThumbnail(audio) by { width: 1024, height: 1024 }
// * @tc.size : MEDIUM * @tc.size : MEDIUM
// * @tc.type : Function * @tc.type : Function
// * @tc.level : Level 0 * @tc.level : Level 0
// */ */
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_07', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_002_07', 0, async function (done) {
// try { try {
// const fetchFileResult = await media.getFileAssets(videoFetchOp); const fetchFileResult = await media.getFileAssets(videoFetchOp);
// const dataList = await fetchFileResult.getAllObject(); const dataList = await fetchFileResult.getAllObject();
// const asset = dataList[0]; const asset = dataList[0];
// let size = { width: 1024, height: 1024 }; let size = { width: 1024, height: 1024 };
// const pixelmap = await asset.getThumbnail(size); const pixelmap = await asset.getThumbnail(size);
// const info = await pixelmap.getImageInfo(); const info = await pixelmap.getImageInfo();
// console.info('MediaLibraryTest : 003_06 pixel image info ' + info); console.info('MediaLibraryTest : 003_06 pixel image info ' + info);
// console.info('MediaLibraryTest : 003_06 pixel width ' + info.size.width); console.info('MediaLibraryTest : 003_06 pixel width ' + info.size.width);
// console.info('MediaLibraryTest : 003_06 pixel height ' + info.size.height); console.info('MediaLibraryTest : 003_06 pixel height ' + info.size.height);
// if (info.size.width == size.width && info.size.height == size.height) { if (info.size.width == size.width && info.size.height == size.height) {
// expect(true).assertTrue(); expect(true).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 002_07 passed'); console.info('MediaLibraryTest : getThumbnail 002_07 passed');
// done(); done();
// } else { } else {
// expect(false).assertTrue(); expect(false).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 002_07 failed'); console.info('MediaLibraryTest : getThumbnail 002_07 failed');
// done(); done();
// } }
// } catch (error) { } catch (error) {
// console.info('MediaLibraryTest : getThumbnail 002_07 failed ' + error.message); console.info('MediaLibraryTest : getThumbnail 002_07 failed ' + error.message);
// expect(false).assertTrue(); expect(false).assertTrue();
// done(); done();
// } }
// }); });
// // ------------------------------video type end-------------------------- // ------------------------------video type end--------------------------
// // ------------------------------audio type start ----------------------- // ------------------------------audio type start -----------------------
// /** /**
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_01 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_01
// * @tc.name : getThumbnail * @tc.name : getThumbnail
// * @tc.desc : getThumbnail(audio) by { width: 128, height: 128 } * @tc.desc : getThumbnail(audio) by { width: 128, height: 128 }
// * @tc.size : MEDIUM * @tc.size : MEDIUM
// * @tc.type : Function * @tc.type : Function
// * @tc.level : Level 0 * @tc.level : Level 0
// */ */
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_01', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_01', 0, async function (done) {
// try { try {
// const fetchFileResult = await media.getFileAssets(audioFetchOp); const fetchFileResult = await media.getFileAssets(audioFetchOp);
// const dataList = await fetchFileResult.getAllObject(); const dataList = await fetchFileResult.getAllObject();
// const asset = dataList[0]; const asset = dataList[0];
// let size = { width: 128, height: 128 }; let size = { width: 128, height: 128 };
// const pixelmap = await asset.getThumbnail(size); const pixelmap = await asset.getThumbnail(size);
// const info = await pixelmap.getImageInfo(); const info = await pixelmap.getImageInfo();
// console.info('MediaLibraryTest : 003_01 pixel image info ' + info); console.info('MediaLibraryTest : 003_01 pixel image info ' + info);
// console.info('MediaLibraryTest : 003_01 pixel width ' + info.size.width); console.info('MediaLibraryTest : 003_01 pixel width ' + info.size.width);
// console.info('MediaLibraryTest : 003_01 pixel height ' + info.size.height); console.info('MediaLibraryTest : 003_01 pixel height ' + info.size.height);
// if (info.size.width == size.width && info.size.height == size.height) { if (info.size.width == size.width && info.size.height == size.height) {
// expect(true).assertTrue(); expect(true).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 003_01 passed'); console.info('MediaLibraryTest : getThumbnail 003_01 passed');
// done(); done();
// } else { } else {
// expect(false).assertTrue(); expect(false).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 003_01 failed'); console.info('MediaLibraryTest : getThumbnail 003_01 failed');
// done(); done();
// } }
// } catch (error) { } catch (error) {
// console.info('MediaLibraryTest : getThumbnail 003_01 failed ' + error.message); console.info('MediaLibraryTest : getThumbnail 003_01 failed ' + error.message);
// expect(false).assertTrue(); expect(false).assertTrue();
// done(); done();
// } }
// }); });
// /** /**
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_02 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_02
// * @tc.name : getThumbnail * @tc.name : getThumbnail
// * @tc.desc : getThumbnail(audio) by { width: 128, height: 256 } * @tc.desc : getThumbnail(audio) by { width: 128, height: 256 }
// * @tc.size : MEDIUM * @tc.size : MEDIUM
// * @tc.type : Function * @tc.type : Function
// * @tc.level : Level 0 * @tc.level : Level 0
// */ */
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_02', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_02', 0, async function (done) {
// try { try {
// const fetchFileResult = await media.getFileAssets(audioFetchOp); const fetchFileResult = await media.getFileAssets(audioFetchOp);
// const dataList = await fetchFileResult.getAllObject(); const dataList = await fetchFileResult.getAllObject();
// const asset = dataList[0]; const asset = dataList[0];
// let size = { width: 128, height: 256 }; let size = { width: 128, height: 256 };
// const pixelmap = await asset.getThumbnail(size); const pixelmap = await asset.getThumbnail(size);
// const info = await pixelmap.getImageInfo(); const info = await pixelmap.getImageInfo();
// console.info('MediaLibraryTest : 003_02 pixel image info ' + info); console.info('MediaLibraryTest : 003_02 pixel image info ' + info);
// console.info('MediaLibraryTest : 003_02 pixel width ' + info.size.width); console.info('MediaLibraryTest : 003_02 pixel width ' + info.size.width);
// console.info('MediaLibraryTest : 003_02 pixel height ' + info.size.height); console.info('MediaLibraryTest : 003_02 pixel height ' + info.size.height);
// if (info.size.width == size.width && info.size.height == size.height) { if (info.size.width == size.width && info.size.height == size.height) {
// expect(true).assertTrue(); expect(true).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 003_02 passed'); console.info('MediaLibraryTest : getThumbnail 003_02 passed');
// done(); done();
// } else { } else {
// expect(false).assertTrue(); expect(false).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 003_02 failed'); console.info('MediaLibraryTest : getThumbnail 003_02 failed');
// done(); done();
// } }
// } catch (error) { } catch (error) {
// console.info('MediaLibraryTest : getThumbnail 003_02 failed ' + error.message); console.info('MediaLibraryTest : getThumbnail 003_02 failed ' + error.message);
// expect(false).assertTrue(); expect(false).assertTrue();
// done(); done();
// } }
// }); });
// /** /**
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_03 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_03
// * @tc.name : getThumbnail * @tc.name : getThumbnail
// * @tc.desc : getThumbnail(audio) by no arg * @tc.desc : getThumbnail(audio) by no arg
// * @tc.size : MEDIUM * @tc.size : MEDIUM
// * @tc.type : Function * @tc.type : Function
// * @tc.level : Level 0 * @tc.level : Level 0
// */ */
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_03', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_03', 0, async function (done) {
// try { try {
// const fetchFileResult = await media.getFileAssets(audioFetchOp); const fetchFileResult = await media.getFileAssets(audioFetchOp);
// const dataList = await fetchFileResult.getAllObject(); const dataList = await fetchFileResult.getAllObject();
// const asset = dataList[0]; const asset = dataList[0];
// let size = { width: 256, height: 256 }; let size = { width: 256, height: 256 };
// const pixelmap = await asset.getThumbnail(); const pixelmap = await asset.getThumbnail();
// const info = await pixelmap.getImageInfo(); const info = await pixelmap.getImageInfo();
// console.info('MediaLibraryTest : 003_03 pixel image info ' + info); console.info('MediaLibraryTest : 003_03 pixel image info ' + info);
// console.info('MediaLibraryTest : 003_03 pixel width ' + info.size.width); console.info('MediaLibraryTest : 003_03 pixel width ' + info.size.width);
// console.info('MediaLibraryTest : 003_03 pixel height ' + info.size.height); console.info('MediaLibraryTest : 003_03 pixel height ' + info.size.height);
// if (info.size.width == size.width && info.size.height == size.height) { if (info.size.width == size.width && info.size.height == size.height) {
// expect(true).assertTrue(); expect(true).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 003_03 passed'); console.info('MediaLibraryTest : getThumbnail 003_03 passed');
// done(); done();
// } else { } else {
// expect(false).assertTrue(); expect(false).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 003_03 failed'); console.info('MediaLibraryTest : getThumbnail 003_03 failed');
// done(); done();
// } }
// } catch (error) { } catch (error) {
// console.info('MediaLibraryTest : getThumbnail 003_03 failed ' + error.message); console.info('MediaLibraryTest : getThumbnail 003_03 failed ' + error.message);
// expect(false).assertTrue(); expect(false).assertTrue();
// done(); done();
// } }
// }); });
// /** /**
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_04 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_04
// * @tc.name : getThumbnail * @tc.name : getThumbnail
// * @tc.desc : getThumbnail(audio) by { width: 1, height: 1 } * @tc.desc : getThumbnail(audio) by { width: 1, height: 1 }
// * @tc.size : MEDIUM * @tc.size : MEDIUM
// * @tc.type : Function * @tc.type : Function
// * @tc.level : Level 0 * @tc.level : Level 0
// */ */
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_04', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_04', 0, async function (done) {
// try { try {
// const fetchFileResult = await media.getFileAssets(audioFetchOp); const fetchFileResult = await media.getFileAssets(audioFetchOp);
// const dataList = await fetchFileResult.getAllObject(); const dataList = await fetchFileResult.getAllObject();
// const asset = dataList[0]; const asset = dataList[0];
// let size = { width: 1, height: 1 }; let size = { width: 1, height: 1 };
// const pixelmap = await asset.getThumbnail(size); const pixelmap = await asset.getThumbnail(size);
// const info = await pixelmap.getImageInfo(); const info = await pixelmap.getImageInfo();
// console.info('MediaLibraryTest : 003_04 pixel image info ' + info); console.info('MediaLibraryTest : 003_04 pixel image info ' + info);
// console.info('MediaLibraryTest : 003_04 pixel width ' + info.size.width); console.info('MediaLibraryTest : 003_04 pixel width ' + info.size.width);
// console.info('MediaLibraryTest : 003_04 pixel height ' + info.size.height); console.info('MediaLibraryTest : 003_04 pixel height ' + info.size.height);
// if (info.size.width == size.width && info.size.height == size.height) { if (info.size.width == size.width && info.size.height == size.height) {
// expect(true).assertTrue(); expect(true).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 003_04 passed'); console.info('MediaLibraryTest : getThumbnail 003_04 passed');
// done(); done();
// } else { } else {
// expect(false).assertTrue(); expect(false).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 003_04 failed'); console.info('MediaLibraryTest : getThumbnail 003_04 failed');
// done(); done();
// } }
// } catch (error) { } catch (error) {
// console.info('MediaLibraryTest : getThumbnail 003_04 failed ' + error.message); console.info('MediaLibraryTest : getThumbnail 003_04 failed ' + error.message);
// expect(false).assertTrue(); expect(false).assertTrue();
// done(); done();
// } }
// }); });
// /** /**
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_05 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_05
// * @tc.name : getThumbnail * @tc.name : getThumbnail
// * @tc.desc : getThumbnail(audio) by { width: 0, height: 0 } * @tc.desc : getThumbnail(audio) by { width: 0, height: 0 }
// * @tc.size : MEDIUM * @tc.size : MEDIUM
// * @tc.type : Function * @tc.type : Function
// * @tc.level : Level 0 * @tc.level : Level 0
// */ */
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_05', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_05', 0, async function (done) {
// try { try {
// const fetchFileResult = await media.getFileAssets(audioFetchOp); const fetchFileResult = await media.getFileAssets(audioFetchOp);
// const dataList = await fetchFileResult.getAllObject(); const dataList = await fetchFileResult.getAllObject();
// const asset = dataList[0]; const asset = dataList[0];
// let size = { width: 0, height: 0 }; let size = { width: 0, height: 0 };
// const pixelmap = await asset.getThumbnail(size); const pixelmap = await asset.getThumbnail(size);
// const info = await pixelmap.getImageInfo(); const info = await pixelmap.getImageInfo();
// console.info('MediaLibraryTest : getThumbnail 003_06 failed'); console.info('MediaLibraryTest : getThumbnail 003_06 failed');
// console.info('MediaLibraryTest : 003_05 pixel image info ' + info); console.info('MediaLibraryTest : 003_05 pixel image info ' + info);
// console.info('MediaLibraryTest : 003_05 pixel width ' + info.size.width); console.info('MediaLibraryTest : 003_05 pixel width ' + info.size.width);
// console.info('MediaLibraryTest : 003_05 pixel height ' + info.size.height); console.info('MediaLibraryTest : 003_05 pixel height ' + info.size.height);
// expect(true).assertTrue(); expect(false).assertTrue();
// done(); done();
// } catch (error) { } catch (error) {
// console.info('MediaLibraryTest : getThumbnail 003_05 passed'); console.info('MediaLibraryTest : getThumbnail 003_05 passed');
// expect(false).assertTrue(); expect(true).assertTrue();
// done(); done();
// } }
// }); });
// /** /**
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_06 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_06
// * @tc.name : getThumbnail * @tc.name : getThumbnail
// * @tc.desc : getThumbnail(audio) by { width: -128, height: -128 } * @tc.desc : getThumbnail(audio) by { width: -128, height: -128 }
// * @tc.size : MEDIUM * @tc.size : MEDIUM
// * @tc.type : Function * @tc.type : Function
// * @tc.level : Level 0 * @tc.level : Level 0
// */ */
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_06', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_06', 0, async function (done) {
// try { try {
// const fetchFileResult = await media.getFileAssets(audioFetchOp); const fetchFileResult = await media.getFileAssets(audioFetchOp);
// const dataList = await fetchFileResult.getAllObject(); const dataList = await fetchFileResult.getAllObject();
// const asset = dataList[0]; const asset = dataList[0];
// let size = { width: -128, height: -128 }; let size = { width: -128, height: -128 };
// const pixelmap = await asset.getThumbnail(size); const pixelmap = await asset.getThumbnail(size);
// const info = await pixelmap.getImageInfo(); const info = await pixelmap.getImageInfo();
// console.info('MediaLibraryTest : 003_06 pixel image info ' + info); console.info('MediaLibraryTest : 003_06 pixel image info ' + info);
// console.info('MediaLibraryTest : 003_06 pixel width ' + info.size.width); console.info('MediaLibraryTest : 003_06 pixel width ' + info.size.width);
// console.info('MediaLibraryTest : 003_06 pixel height ' + info.size.height); console.info('MediaLibraryTest : 003_06 pixel height ' + info.size.height);
// console.info('MediaLibraryTest : getThumbnail 003_06 failed'); console.info('MediaLibraryTest : getThumbnail 003_06 failed');
// expect(true).assertTrue(); expect(false).assertTrue();
// done(); done();
// } catch (error) { } catch (error) {
// console.info('MediaLibraryTest : getThumbnail 003_06 passed'); console.info('MediaLibraryTest : getThumbnail 003_06 passed');
// expect(false).assertTrue(); expect(true).assertTrue();
// done(); done();
// } }
// }); });
// /** /**
// * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_07 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_07
// * @tc.name : getThumbnail * @tc.name : getThumbnail
// * @tc.desc : getThumbnail(audio) by { width: 1024, height: 1024 } * @tc.desc : getThumbnail(audio) by { width: 1024, height: 1024 }
// * @tc.size : MEDIUM * @tc.size : MEDIUM
// * @tc.type : Function * @tc.type : Function
// * @tc.level : Level 0 * @tc.level : Level 0
// */ */
// it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_07', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_003_07', 0, async function (done) {
// try { try {
// const fetchFileResult = await media.getFileAssets(audioFetchOp); const fetchFileResult = await media.getFileAssets(audioFetchOp);
// const dataList = await fetchFileResult.getAllObject(); const dataList = await fetchFileResult.getAllObject();
// const asset = dataList[0]; const asset = dataList[0];
// let size = { width: 1024, height: 1024 }; let size = { width: 1024, height: 1024 };
// const pixelmap = await asset.getThumbnail(size); const pixelmap = await asset.getThumbnail(size);
// const info = await pixelmap.getImageInfo(); const info = await pixelmap.getImageInfo();
// console.info('MediaLibraryTest : 003_06 pixel image info ' + info); console.info('MediaLibraryTest : 003_06 pixel image info ' + info);
// console.info('MediaLibraryTest : 003_06 pixel width ' + info.size.width); console.info('MediaLibraryTest : 003_06 pixel width ' + info.size.width);
// console.info('MediaLibraryTest : 003_06 pixel height ' + info.size.height); console.info('MediaLibraryTest : 003_06 pixel height ' + info.size.height);
// if (info.size.width == size.width && info.size.height == size.height) { if (info.size.width == size.width && info.size.height == size.height) {
// expect(true).assertTrue(); expect(true).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 003_07 passed'); console.info('MediaLibraryTest : getThumbnail 003_07 passed');
// done(); done();
// } else { } else {
// expect(false).assertTrue(); expect(false).assertTrue();
// console.info('MediaLibraryTest : getThumbnail 003_07 failed'); console.info('MediaLibraryTest : getThumbnail 003_07 failed');
// done(); done();
// } }
// } catch (error) { } catch (error) {
// console.info('MediaLibraryTest : getThumbnail 003_07 failed ' + error.message); console.info('MediaLibraryTest : getThumbnail 003_07 failed ' + error.message);
// expect(false).assertTrue(); expect(false).assertTrue();
// done(); done();
// } }
// }); });
// ------------------------------audio type end-------------------------- // ------------------------------audio type end--------------------------
}); });
...@@ -40,9 +40,9 @@ require('./getAllPeersTestCallback.test.js') ...@@ -40,9 +40,9 @@ require('./getAllPeersTestCallback.test.js')
require('./getAllPeersTestPromise.test.js') require('./getAllPeersTestPromise.test.js')
require('./mediaLibraryTestCallBack.test.js') require('./mediaLibraryTestCallBack.test.js')
require('./mediaLibraryTestPromise.test.js') require('./mediaLibraryTestPromise.test.js')
require('./mediaLibraryTestPromiseOnOff.test.js')
require('./albumTestCallBack.test.js') require('./albumTestCallBack.test.js')
require('./albumTestPromise.test.js') require('./albumTestPromise.test.js')
require('./mediaLibraryTestPromiseOnOff.test.js')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册