diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/favoriteTestCallBack.test.js b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/favoriteTestCallBack.test.js index c2c2b380e95bc87fd4b4879315fa09b2df89600d..f8cf7005d7c251e6499133273a31df39fabbe374 100644 --- a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/favoriteTestCallBack.test.js +++ b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/favoriteTestCallBack.test.js @@ -23,8 +23,8 @@ const imageType = mediaLibrary.MediaType.IMAGE; const videoType = mediaLibrary.MediaType.VIDEO; const audioType = mediaLibrary.MediaType.AUDIO; const fileFetchOp = { - selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs: [fileType.toString()], + selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND relative_path = ?', + selectionArgs: [fileType.toString(), 'Documents/'], }; const imageFetchOp = { selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?', @@ -35,8 +35,8 @@ const videoFetchOp = { selectionArgs: [videoType.toString()], }; const audioFetchOp = { - selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs: [audioType.toString()], + selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND bucket_display_name = ?', + selectionArgs: [audioType.toString(), 'Camera'], }; describe('favoriteTestCallBack.test.js', function () { diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/favoriteTestPromise.test.js b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/favoriteTestPromise.test.js index d4b03a03a196f88d4003ce88b0e031bc4201b0a1..ed12b142c3ad4e56bb4d65da588601b035036300 100644 --- a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/favoriteTestPromise.test.js +++ b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/favoriteTestPromise.test.js @@ -23,8 +23,8 @@ const imageType = mediaLibrary.MediaType.IMAGE; const videoType = mediaLibrary.MediaType.VIDEO; const audioType = mediaLibrary.MediaType.AUDIO; const fileFetchOp = { - selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs: [fileType.toString()], + selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND relative_path = ?', + selectionArgs: [fileType.toString(), 'Documents/'], }; const imageFetchOp = { selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?', @@ -35,8 +35,8 @@ const videoFetchOp = { selectionArgs: [videoType.toString()], }; const audioFetchOp = { - selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs: [audioType.toString()], + selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND bucket_display_name = ?', + selectionArgs: [audioType.toString(), 'Camera'], }; describe('favoriteTestPromise.test.js', function () { 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 9740c6c81a02e23c9be565bb565796a84c880505..feb7fe90c1eae20e47ad6a1849fdb988a4508691 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) { @@ -571,4 +571,4 @@ describe('fetchFileResultCallback.test.js', async function() { done(); } }); -}); \ No newline at end of file +}); 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 71289c6d0d84353d50409dc02c5c7a7f0b8cf0af..f0c53b22d7ef4f00b1cd28a063be5fe4ad0cbafa 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) { @@ -681,4 +681,4 @@ describe('fetchFileResultPromise.test.js', async function() { done(); } }); -}); \ No newline at end of file +}); 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 d43b10cb0f4c1acd09202bd34aae94350be05930..5948f0722a642e67e2b19e01391b6b15777141c3 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 @@ -40,6 +40,9 @@ function checkAttrs(done, asset, tNum) { done(); } } +function sleep(time){ + for (let t = Date.now(); Date.now() - t <= time;); +} describe('fileAsset2.test.js', async function () { let fileKeyObj = mediaLibrary.FileKey; @@ -83,7 +86,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,14 +203,14 @@ 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; const id = asset.id; await asset.commitModify(); - + sleep(1000); const fetchFileResult2 = await media.getFileAssets(imagesfetchOp); const dataList = await fetchFileResult2.getAllObject(); let passed = false; 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 2fe3c0f4d57ef43cea52d476e255cd771a776610..4f76a3dac8d772c0fac954ea624c315e01da3c8e 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 @@ -40,6 +40,9 @@ function checkAttrs(done, asset, tNum) { done(); } } +function sleep(time){ + for (let t = Date.now(); Date.now() - t <= time;); +} describe('fileAssetCallBack2.test.js', async function () { let fileKeyObj = mediaLibrary.FileKey; @@ -83,7 +86,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,13 +205,14 @@ 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; const id = asset.id; asset.commitModify(async () => { + sleep(1000); const fetchFileResult2 = await media.getFileAssets(imagesfetchOp); const dataList = await fetchFileResult2.getAllObject(); let passed = false; 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 bbf4715f9a69f947b5c38480bcfe32fa49a39a8e..777f35377bdd303d42047041b2411b067cfdd252 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 @@ -40,6 +40,9 @@ function checkAttrs(done, asset, tNum) { done(); } } +function sleep(time){ + for (let t = Date.now(); Date.now() - t <= time;); +} describe('fileAssetPromise2.test.js', async function () { let fileKeyObj = mediaLibrary.FileKey; @@ -83,7 +86,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,14 +203,14 @@ 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; const id = asset.id; await asset.commitModify(); - + sleep(1000); const fetchFileResult2 = await media.getFileAssets(imagesfetchOp); const dataList = await fetchFileResult2.getAllObject(); let passed = false; diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetTestCallback.test.js b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetTestCallback.test.js index 0c9086739a25603df0da4473487cde31a06821de..ca42b102b6d6b576c0db8a366adf082c3d5cf7a6 100644 --- a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetTestCallback.test.js +++ b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetTestCallback.test.js @@ -42,8 +42,8 @@ describe('fileAssetTestCallback.test.js', async function() { try { let fileType = mediaLibrary.MediaType.FILE; let fileFetchOp = { - selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs : [ fileType.toString() ], + selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND relative_path = ?', + selectionArgs : [ fileType.toString(), 'Documents/'], }; let fetchFileResult = await media.getFileAssets(fileFetchOp); const dataList = await fetchFileResult.getAllObject(); @@ -109,8 +109,8 @@ describe('fileAssetTestCallback.test.js', async function() { try { let type = mediaLibrary.MediaType.FILE; let fetchOp = { - selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs : [ type.toString() ], + selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND relative_path = ?', + selectionArgs : [ type.toString(), 'Documents/'], }; let fetchFileResult = await media.getFileAssets(fetchOp); const dataList = await fetchFileResult.getAllObject(); @@ -173,8 +173,8 @@ describe('fileAssetTestCallback.test.js', async function() { try { let type = mediaLibrary.MediaType.FILE; let fetchOp = { - selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs : [ type.toString() ], + selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND relative_path = ?', + selectionArgs : [ type.toString(), 'Documents/'], }; let fetchFileResult = await media.getFileAssets(fetchOp); const dataList = await fetchFileResult.getAllObject(); @@ -438,8 +438,8 @@ describe('fileAssetTestCallback.test.js', async function() { try { let fileType = mediaLibrary.MediaType.AUDIO; let fileFetchOp = { - selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs : [ fileType.toString() ], + selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND bucket_display_name = ?', + selectionArgs : [ fileType.toString(), 'Camera'], }; let fetchFileResult = await media.getFileAssets(fileFetchOp); const dataList = await fetchFileResult.getAllObject(); @@ -499,8 +499,8 @@ describe('fileAssetTestCallback.test.js', async function() { try { let type = mediaLibrary.MediaType.AUDIO; let fetchOp = { - selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs : [ type.toString() ], + selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND bucket_display_name = ?', + selectionArgs : [ type.toString(), 'Camera'], }; let fetchFileResult = await media.getFileAssets(fetchOp); const dataList = await fetchFileResult.getAllObject(); @@ -566,8 +566,8 @@ describe('fileAssetTestCallback.test.js', async function() { try { let type = mediaLibrary.MediaType.AUDIO; let fetchOp = { - selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs : [ type.toString() ], + selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND bucket_display_name = ?', + selectionArgs : [ type.toString(), 'Camera'], }; let fetchFileResult = await media.getFileAssets(fetchOp); const dataList = await fetchFileResult.getAllObject(); @@ -845,8 +845,8 @@ describe('fileAssetTestCallback.test.js', async function() { try { let type = mediaLibrary.MediaType.FILE; let fetchOp = { - selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs : [ type.toString() ], + selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND relative_path = ?', + selectionArgs : [ type.toString(), 'Documents/'], }; let fetchFileResult = await media.getFileAssets(fetchOp); const dataList = await fetchFileResult.getAllObject(); @@ -941,8 +941,8 @@ describe('fileAssetTestCallback.test.js', async function() { try { let type = mediaLibrary.MediaType.AUDIO; let fetchOp = { - selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs : [ type.toString() ], + selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND bucket_display_name = ?', + selectionArgs : [ type.toString(), 'Camera'], }; let fetchFileResult = await media.getFileAssets(fetchOp); const dataList = await fetchFileResult.getAllObject(); diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetTestPromise.test.js b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetTestPromise.test.js index 1279da85a631b65dd7a63314ae3b107018fba3f3..090c81ebe340a1c158d07f42afe0556f744eb449 100644 --- a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetTestPromise.test.js +++ b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetTestPromise.test.js @@ -42,8 +42,8 @@ describe('fileAssetTestPromise.test.js', async function() { try { let fileType = mediaLibrary.MediaType.FILE; let fileFetchOp = { - selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs : [ fileType.toString() ], + selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND relative_path = ?', + selectionArgs : [ fileType.toString(), 'Documents/'], }; let fetchFileResult = await media.getFileAssets(fileFetchOp); const dataList = await fetchFileResult.getAllObject(); @@ -95,8 +95,8 @@ describe('fileAssetTestPromise.test.js', async function() { try { let type = mediaLibrary.MediaType.FILE; let fetchOp = { - selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs : [ type.toString() ], + selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND relative_path = ?', + selectionArgs : [ type.toString(), 'Documents/'], }; let fetchFileResult = await media.getFileAssets(fetchOp); const dataList = await fetchFileResult.getAllObject(); @@ -136,8 +136,8 @@ describe('fileAssetTestPromise.test.js', async function() { try { let type = mediaLibrary.MediaType.FILE; let fetchOp = { - selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs : [ type.toString() ], + selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND relative_path = ?', + selectionArgs : [ type.toString(), 'Documents/'], }; let fetchFileResult = await media.getFileAssets(fetchOp); const dataList = await fetchFileResult.getAllObject(); @@ -183,7 +183,7 @@ describe('fileAssetTestPromise.test.js', async function() { let fileType = mediaLibrary.MediaType.IMAGE; let fileFetchOp = { selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs : [ fileType.toString() ], + selectionArgs : [ fileType.toString()], }; let fetchFileResult = await media.getFileAssets(fileFetchOp); const dataList = await fetchFileResult.getAllObject(); @@ -320,8 +320,8 @@ describe('fileAssetTestPromise.test.js', async function() { try { let fileType = mediaLibrary.MediaType.AUDIO; let fileFetchOp = { - selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs : [ fileType.toString() ], + selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND bucket_display_name = ?', + selectionArgs : [ fileType.toString(), 'Camera'], }; let fetchFileResult = await media.getFileAssets(fileFetchOp); const dataList = await fetchFileResult.getAllObject(); @@ -371,8 +371,8 @@ describe('fileAssetTestPromise.test.js', async function() { try { let type = mediaLibrary.MediaType.AUDIO; let fetchOp = { - selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs : [ type.toString() ], + selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND bucket_display_name = ?', + selectionArgs : [ type.toString(), 'Camera'], }; let fetchFileResult = await media.getFileAssets(fetchOp); const dataList = await fetchFileResult.getAllObject(); @@ -412,8 +412,8 @@ describe('fileAssetTestPromise.test.js', async function() { try { let type = mediaLibrary.MediaType.AUDIO; let fetchOp = { - selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs : [ type.toString() ], + selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND bucket_display_name = ?', + selectionArgs : [ type.toString(), 'Camera'], }; let fetchFileResult = await media.getFileAssets(fetchOp); const dataList = await fetchFileResult.getAllObject(); @@ -459,7 +459,7 @@ describe('fileAssetTestPromise.test.js', async function() { let fileType = mediaLibrary.MediaType.VIDEO; let fileFetchOp = { selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs : [ fileType.toString() ], + selectionArgs : [ fileType.toString()], }; let fetchFileResult = await media.getFileAssets(fileFetchOp); const dataList = await fetchFileResult.getAllObject(); @@ -610,8 +610,8 @@ describe('fileAssetTestPromise.test.js', async function() { try { let type = mediaLibrary.MediaType.FILE; let fetchOp = { - selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs : [ type.toString() ], + selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND relative_path = ?', + selectionArgs : [ type.toString(), 'Documents/'], }; let fetchFileResult = await media.getFileAssets(fetchOp); const dataList = await fetchFileResult.getAllObject(); @@ -698,8 +698,8 @@ describe('fileAssetTestPromise.test.js', async function() { try { let type = mediaLibrary.MediaType.AUDIO; let fetchOp = { - selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs : [ type.toString() ], + selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND bucket_display_name = ?', + selectionArgs : [ type.toString(), 'Camera'], }; let fetchFileResult = await media.getFileAssets(fetchOp); const dataList = await fetchFileResult.getAllObject(); diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetUriTestCallBack.test.js b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetUriTestCallBack.test.js index fc564ad89f43ac9ea476033c3ae4bed7fc5320fe..58fc103431ee12dae5c7e1fe8e440d3334e3ca73 100644 --- a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetUriTestCallBack.test.js +++ b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetUriTestCallBack.test.js @@ -51,12 +51,12 @@ describe('fileAssetUriTestCallback.test.js', async function() { const uri = firstObject.uri; console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_URI_CALLBACK_005_35 uri:' + uri); - const serachUri = 'dataability:///media/image/' + id; - console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_URI_CALLBACK_005_35 serachUri:' - + serachUri); + const searchUri = uri.substr(0, uri.lastIndexOf('/') + 1) + id; + console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_URI_CALLBACK_005_35 searchUri:' + + searchUri); let serchfetchOp = { - uri:serachUri.toString(), + uri:searchUri.toString(), selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?', selectionArgs : [ type.toString()], }; @@ -64,11 +64,11 @@ describe('fileAssetUriTestCallback.test.js', async function() { const result = await media.getFileAssets(serchfetchOp); console.info( 'MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_URI_CALLBACK_005_35 getFileAssets by uri:' - + serachUri + ",result.getCount():" + result.getCount()); + + searchUri + ",result.getCount():" + result.getCount()); asset = await result.getFirstObject(); console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_URI_CALLBACK_005_35 asset.uri:' + asset.uri); - expect(asset.uri == serachUri).assertTrue(); + expect(asset.uri == searchUri).assertTrue(); fd = await asset.open('r'); expect(fd > 0).assertTrue(); console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_URI_CALLBACK_005_35 fd:' + fd); diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetUriTestPromiese.test.js b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetUriTestPromiese.test.js index 9864f2f9feedcf8d4eb502696101fb0c8f7ed4ac..9f91657afefa96fb625e3b0b8d6cf4d0faab137c 100644 --- a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetUriTestPromiese.test.js +++ b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetUriTestPromiese.test.js @@ -50,12 +50,12 @@ describe('fileAssetUriTestPromise.test.js', async function() { const id = firstObject.id; const uri = firstObject.uri; console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_URI_PROMISE_005_35 uri:' + uri); - const serachUri = 'dataability:///media/image/' + id; - console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_URI_PROMISE_005_35 serachUri:' - + serachUri); + const searchUri = uri.substr(0, uri.lastIndexOf('/') + 1) + id; + console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_URI_PROMISE_005_35 searchUri:' + + searchUri); let serchfetchOp = { - uri : serachUri.toString(), + uri : searchUri.toString(), selections : mediaLibrary.FileKey.MEDIA_TYPE + '= ?', selectionArgs : [ type.toString() ], }; @@ -63,11 +63,11 @@ describe('fileAssetUriTestPromise.test.js', async function() { const result = await media.getFileAssets(serchfetchOp); console.info( 'MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_URI_PROMISE_005_35 getFileAssets by uri:' - + serachUri + ",result.getCount():" + result.getCount()); + + searchUri + ",result.getCount():" + result.getCount()); asset = await result.getFirstObject(); console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_URI_PROMISE_005_35 asset.uri:' + asset.uri); - expect(asset.uri == serachUri).assertTrue(); + expect(asset.uri == searchUri).assertTrue(); fd = await asset.open('r'); expect(fd > 0).assertTrue(); console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_URI_PROMISE_005_35 fd:' + fd); diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileTestCallBack.test.js b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileTestCallBack.test.js index ccccc309d3aa870f0d7b09f69d04bdffcedd1a38..b5d0fdfe2ccb3402364e31d2f5466744c545bec0 100644 --- a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileTestCallBack.test.js +++ b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileTestCallBack.test.js @@ -33,12 +33,12 @@ let videosfetchOp = { selectionArgs: [videoType.toString()], }; let audiosfetchOp = { - selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs: [audioType.toString()], + selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND bucket_display_name = ?', + selectionArgs: [audioType.toString(), 'Camera'], }; let filesfetchOp = { - selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs: [fileType.toString()], + selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND relative_path = ?', + selectionArgs: [fileType.toString(), 'Documents/'], }; function checkAssetAttr(done, attr, testNum, asset, checkType) { diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileTestPromise.test.js b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileTestPromise.test.js index ff9541a6db0cdb06a212f74e0a5809c8414371f5..0fbc2d693ab48e72f8e87366c7f517179d808920 100644 --- a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileTestPromise.test.js +++ b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileTestPromise.test.js @@ -33,12 +33,12 @@ let videosfetchOp = { selectionArgs: [videoType.toString()], }; let audiosfetchOp = { - selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs: [audioType.toString()], + selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND bucket_display_name = ?', + selectionArgs: [audioType.toString(), 'Camera'], }; let filesfetchOp = { - selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs: [fileType.toString()], + selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND relative_path = ?', + selectionArgs: [fileType.toString(), 'Documents/'], }; function checkAssetAttr(done, attr, testNum, asset, checkType) { diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/mediaLibraryTestCallBack.test.js b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/mediaLibraryTestCallBack.test.js index baab218c3baf4315243b469b9e3614d3418836aa..158f90513dd2e9abf639440dee34ca604f2b8222 100644 --- a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/mediaLibraryTestCallBack.test.js +++ b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/mediaLibraryTestCallBack.test.js @@ -44,12 +44,12 @@ let videosfetchOp = { selectionArgs: [videoType.toString()], }; let audiosfetchOp = { - selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs: [audioType.toString()], + selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND bucket_display_name = ?', + selectionArgs: [audioType.toString(), 'Camera'], }; let filesfetchOp = { - selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs: [fileType.toString()], + selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND relative_path = ?', + selectionArgs: [fileType.toString(), 'Documents/'], }; let imageAndVideofetchOp = { diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/mediaLibraryTestPromise.test.js b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/mediaLibraryTestPromise.test.js index 3745ccc66b18f686fe10b87847be66462920d9c9..65bae0d5d7c4ce8560230fbd1c967052b57048ca 100644 --- a/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/mediaLibraryTestPromise.test.js +++ b/multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/mediaLibraryTestPromise.test.js @@ -44,12 +44,12 @@ let videosfetchOp = { selectionArgs: [videoType.toString()], }; let audiosfetchOp = { - selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs: [audioType.toString()], + selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND bucket_display_name = ?', + selectionArgs: [audioType.toString(), 'Camera'], }; let filesfetchOp = { - selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ?', - selectionArgs: [fileType.toString()], + selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? AND relative_path = ?', + selectionArgs: [fileType.toString(), 'Documents/'], }; let imageAndVideofetchOp = {