From cd442ea989701e1ece085c359bee46a0d28fbf1e Mon Sep 17 00:00:00 2001 From: wanglongfei Date: Wed, 20 Jul 2022 16:51:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9fileTestCallBack.test.ets?= =?UTF-8?q?=E3=80=81fileTestPromise.test.ets=E5=92=8CmediaLibraryTestPromi?= =?UTF-8?q?seOnOff.test.ets=E6=96=87=E4=BB=B6=E4=B8=AD=E7=9A=84imagesfetch?= =?UTF-8?q?Op=E3=80=81videosfetchOp=E3=80=81audiosfetchOp=E5=92=8Cfilesfet?= =?UTF-8?q?chO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanglongfei --- .../src/main/ets/test/fileTestCallBack.test.ets | 16 ++++++++-------- .../src/main/ets/test/fileTestPromise.test.ets | 17 +++++++++-------- .../test/mediaLibraryTestPromiseOnOff.test.ets | 16 ++++++++-------- 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/fileTestCallBack.test.ets b/multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/fileTestCallBack.test.ets index fcc60e64e..e653191ff 100644 --- a/multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/fileTestCallBack.test.ets +++ b/multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/fileTestCallBack.test.ets @@ -25,20 +25,20 @@ let videoType = mediaLibrary.MediaType.VIDEO; let audioType = mediaLibrary.MediaType.AUDIO; let imagesfetchOp = { - selections: fileKeyObj.MEDIA_TYPE + '= ?', - selectionArgs: [imageType.toString()], + selections: fileKeyObj.RELATIVE_PATH + '= ? AND ' + fileKeyObj.MEDIA_TYPE + '= ?', + selectionArgs: ['Pictures/Dynamic01/', imageType.toString()], }; let videosfetchOp = { - selections: fileKeyObj.MEDIA_TYPE + '= ?', - selectionArgs: [videoType.toString()], + selections: fileKeyObj.RELATIVE_PATH + '= ? AND ' + fileKeyObj.MEDIA_TYPE + '= ?', + selectionArgs: ['Videos/Dynamic01/', videoType.toString()], }; let audiosfetchOp = { - selections: fileKeyObj.MEDIA_TYPE + '= ?', - selectionArgs: [audioType.toString()], + selections: fileKeyObj.RELATIVE_PATH + '= ? AND ' + fileKeyObj.MEDIA_TYPE + '= ?', + selectionArgs: ['Audios/Dynamic01/', audioType.toString()], }; let filesfetchOp = { - selections: fileKeyObj.MEDIA_TYPE + '= ?', - selectionArgs: [fileType.toString()], + selections: fileKeyObj.RELATIVE_PATH + '= ? AND ' + fileKeyObj.MEDIA_TYPE + '= ?', + selectionArgs: ['Documents/Dynamic01/', fileType.toString()], }; function checkAssetAttr(done, attr, testNum, asset, checkType) { diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/fileTestPromise.test.ets b/multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/fileTestPromise.test.ets index c36103062..f02f230a6 100644 --- a/multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/fileTestPromise.test.ets +++ b/multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/fileTestPromise.test.ets @@ -18,6 +18,7 @@ import featureAbility from '@ohos.ability.featureAbility'; import fileio from '@ohos.fileio'; import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; + let fileKeyObj = mediaLibrary.FileKey; let fileType = mediaLibrary.MediaType.FILE; let imageType = mediaLibrary.MediaType.IMAGE; @@ -25,20 +26,20 @@ let videoType = mediaLibrary.MediaType.VIDEO; let audioType = mediaLibrary.MediaType.AUDIO; let imagesfetchOp = { - selections: fileKeyObj.MEDIA_TYPE + '= ?', - selectionArgs: [imageType.toString()], + selections: fileKeyObj.RELATIVE_PATH + '= ? AND ' + fileKeyObj.MEDIA_TYPE + '= ?', + selectionArgs: ['Pictures/Dynamic01/', imageType.toString()], }; let videosfetchOp = { - selections: fileKeyObj.MEDIA_TYPE + '= ?', - selectionArgs: [videoType.toString()], + selections: fileKeyObj.RELATIVE_PATH + '= ? AND ' + fileKeyObj.MEDIA_TYPE + '= ?', + selectionArgs: ['Videos/Dynamic01/', videoType.toString()], }; let audiosfetchOp = { - selections: fileKeyObj.MEDIA_TYPE + '= ?', - selectionArgs: [audioType.toString()], + selections: fileKeyObj.RELATIVE_PATH + '= ? AND ' + fileKeyObj.MEDIA_TYPE + '= ?', + selectionArgs: ['Audios/Dynamic01/', audioType.toString()], }; let filesfetchOp = { - selections: fileKeyObj.MEDIA_TYPE + '= ?', - selectionArgs: [fileType.toString()], + selections: fileKeyObj.RELATIVE_PATH + '= ? AND ' + fileKeyObj.MEDIA_TYPE + '= ?', + selectionArgs: ['Documents/Dynamic01/', fileType.toString()], }; function checkAssetAttr(done, attr, testNum, asset, checkType) { diff --git a/multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/mediaLibraryTestPromiseOnOff.test.ets b/multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/mediaLibraryTestPromiseOnOff.test.ets index cf6a0a0df..3ead107e4 100644 --- a/multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/mediaLibraryTestPromiseOnOff.test.ets +++ b/multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/mediaLibraryTestPromiseOnOff.test.ets @@ -32,20 +32,20 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ let fileType = mediaLibrary.MediaType.FILE; let imagesfetchOp = { - selections: fileKeyObj.MEDIA_TYPE + '= ?', - selectionArgs: [imageType.toString()], + selections: fileKeyObj.RELATIVE_PATH + '= ? AND ' + fileKeyObj.MEDIA_TYPE + '= ?', + selectionArgs: ['Pictures/Dynamic01/', imageType.toString()], }; let videosfetchOp = { - selections: fileKeyObj.MEDIA_TYPE + '= ?', - selectionArgs: [videoType.toString()], + selections: fileKeyObj.RELATIVE_PATH + '= ? AND ' + fileKeyObj.MEDIA_TYPE + '= ?', + selectionArgs: ['Videos/Dynamic01/', videoType.toString()], }; let audiosfetchOp = { - selections: fileKeyObj.MEDIA_TYPE + '= ?', - selectionArgs: [audioType.toString()], + selections: fileKeyObj.RELATIVE_PATH + '= ? AND ' + fileKeyObj.MEDIA_TYPE + '= ?', + selectionArgs: ['Audios/Dynamic01/', audioType.toString()], }; let filesfetchOp = { - selections: fileKeyObj.MEDIA_TYPE + '= ?', - selectionArgs: [fileType.toString()], + selections: fileKeyObj.RELATIVE_PATH + '= ? AND ' + fileKeyObj.MEDIA_TYPE + '= ?', + selectionArgs: ['Documents/Dynamic01/', fileType.toString()], }; /** -- GitLab