From dde8844b73be5a719bde0ad3091808e94e8f0619 Mon Sep 17 00:00:00 2001 From: qinliwen Date: Fri, 5 Aug 2022 14:08:36 +0800 Subject: [PATCH] =?UTF-8?q?<=E4=BF=AE=E6=94=B9medialibrary=20xts=EF=BC=8C?= =?UTF-8?q?=E9=80=82=E9=85=8DHOS>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qinliwen --- .../src/main/js/test/fetchFileResultCallBack.test.js | 10 +++++----- .../src/main/js/test/fetchFileResultPromise.test.js | 10 +++++----- .../src/main/js/test/fileAsset2.test.js | 6 +++--- .../src/main/js/test/fileAssetCallBack2.test.js | 6 +++--- .../src/main/js/test/fileAssetPromise2.test.js | 6 +++--- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fetchFileResultCallBack.test.js b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fetchFileResultCallBack.test.js index 9740c6c81..adb06aacf 100644 --- a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fetchFileResultCallBack.test.js +++ b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fetchFileResultCallBack.test.js @@ -466,11 +466,11 @@ describe('fetchFileResultCallback.test.js', async function() { if (firstObject.uri == undefined) { console.info('MediaLibraryTest :firstObject.uri === undefined'); } - - expect(firstObject.mimeType == 'image/*').assertTrue(); - if (firstObject.mimeType != 'image/*') { - console.info('MediaLibraryTest :firstObject.mimeType:' + firstObject.mimeType); - } + + expect(firstObject.mimeType.startsWith('image/')).assertTrue(); + if (!firstObject.mimeType.startsWith('image/')) { + console.info('Test MediaLibraryTest :firstObject.mimeType:' + firstObject.mimeType); + } expect(firstObject.mediaType == imageType).assertTrue(); if (firstObject.mediaType != imageType) { diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fetchFileResultPromise.test.js b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fetchFileResultPromise.test.js index 71289c6d0..f32df82a1 100644 --- a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fetchFileResultPromise.test.js +++ b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fetchFileResultPromise.test.js @@ -578,11 +578,11 @@ describe('fetchFileResultPromise.test.js', async function() { if (firstObject.uri == undefined) { console.info('MediaLibraryTest :firstObject.uri === undefined'); } - - expect(firstObject.mimeType == 'image/*').assertTrue(); - if (firstObject.mimeType != 'image/*') { - console.info('MediaLibraryTest :firstObject.mimeType:' + firstObject.mimeType); - } + + expect(firstObject.mimeType.startsWith('image/')).assertTrue(); + if (!firstObject.mimeType.startsWith('image/')) { + console.info('Test MediaLibraryTest :firstObject.mimeType:' + firstObject.mimeType); + } expect(firstObject.mediaType == imageType).assertTrue(); if (firstObject.mediaType != imageType) { diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAsset2.test.js b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAsset2.test.js index d43b10cb0..c3e0de030 100644 --- a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAsset2.test.js +++ b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAsset2.test.js @@ -83,7 +83,7 @@ describe('fileAsset2.test.js', async function () { try { const fetchFileResult = await media.getFileAssets(imagesfetchOp); const asset = await fetchFileResult.getFirstObject(); - const newName = 'newName'; + const newName = 'newName' + new Date().getTime() + '.jpg'; asset.displayName = newName; const id = asset.id; await asset.commitModify(); @@ -200,8 +200,8 @@ describe('fileAsset2.test.js', async function () { try { const fetchFileResult = await media.getFileAssets(imagesfetchOp); const asset = await fetchFileResult.getFirstObject(); - let neworientation = 1; - if (asset.orientation == 1) { + let neworientation = 90; + if (asset.orientation == 90) { neworientation = 0; } asset.orientation = neworientation; diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetCallBack2.test.js b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetCallBack2.test.js index 2fe3c0f4d..9f1f4db96 100644 --- a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetCallBack2.test.js +++ b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetCallBack2.test.js @@ -83,7 +83,7 @@ describe('fileAssetCallBack2.test.js', async function () { try { const fetchFileResult = await media.getFileAssets(imagesfetchOp); const asset = await fetchFileResult.getFirstObject(); - const newName = 'newName'; + const newName = 'newName' + new Date().getTime() + '.jpg'; asset.displayName = newName; const id = asset.id; asset.commitModify(async () => { @@ -202,8 +202,8 @@ describe('fileAssetCallBack2.test.js', async function () { try { const fetchFileResult = await media.getFileAssets(imagesfetchOp); const asset = await fetchFileResult.getFirstObject(); - let neworientation = 1; - if (asset.orientation == 1) { + let neworientation = 90; + if (asset.orientation == 90) { neworientation = 0; } asset.orientation = neworientation; diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetPromise2.test.js b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetPromise2.test.js index bbf4715f9..0671c14cd 100644 --- a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetPromise2.test.js +++ b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetPromise2.test.js @@ -83,7 +83,7 @@ describe('fileAssetPromise2.test.js', async function () { try { const fetchFileResult = await media.getFileAssets(imagesfetchOp); const asset = await fetchFileResult.getFirstObject(); - const newName = 'newName'; + const newName = 'newName' + new Date().getTime() + '.jpg'; asset.displayName = newName; const id = asset.id; await asset.commitModify(); @@ -200,8 +200,8 @@ describe('fileAssetPromise2.test.js', async function () { try { const fetchFileResult = await media.getFileAssets(imagesfetchOp); const asset = await fetchFileResult.getFirstObject(); - let neworientation = 1; - if (asset.orientation == 1) { + let neworientation = 90; + if (asset.orientation == 90) { neworientation = 0; } asset.orientation = neworientation; -- GitLab