From 2427ff501c9e67b738640809c8ca4800ab585cb9 Mon Sep 17 00:00:00 2001 From: qlw Date: Sat, 26 Nov 2022 12:35:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B3=BB=E7=BB=9Fapi=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E4=B8=8B=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: qlw --- multimedia/BUILD.gn | 7 +- .../AudioTonePlayer/BUILD.gn | 33 - .../AudioTonePlayer/Test.json | 24 - .../signature/openharmony_sx.p7b | Bin 3458 -> 0 bytes .../AudioTonePlayer/src/main/config.json | 90 -- .../src/main/js/default/app.js | 23 - .../src/main/js/default/i18n/en-US.json | 6 - .../src/main/js/default/i18n/zh-CN.json | 6 - .../src/main/js/default/pages/index/index.css | 46 - .../src/main/js/default/pages/index/index.hml | 5 - .../src/main/js/default/pages/index/index.js | 41 - .../src/main/js/test/AudioTonePlayer.test.js | 1131 ----------------- .../src/main/js/test/List.test.js | 18 - .../main/resources/base/element/string.json | 12 - .../src/main/resources/base/media/icon.png | Bin 6790 -> 0 bytes multimedia/userfilemgr/common.js | 210 --- .../userfilemgr_album/AppScope/app.json | 21 - .../resources/base/element/string.json | 12 - .../resources/base/media/app_icon.png | Bin 6790 -> 0 bytes .../userfilemgr/userfilemgr_album/BUILD.gn | 40 - .../userfilemgr/userfilemgr_album/Test.json | 57 - .../src/main/ets/Application/AbilityStage.ts | 9 - .../src/main/ets/MainAbility/MainAbility.ts | 36 - .../entry/src/main/ets/pages/index/index.ets | 67 - .../src/main/ets/pages/second/second.ets | 43 - .../entry/src/main/ets/test/List.test.ets | 25 - .../test/albumCommitModifyCallback.test.ets | 97 -- .../test/albumCommitModifyPromise.test.ets | 96 -- .../test/albumGetFileAssetsCallback.test.ets | 126 -- .../test/albumGetFileAssetsPromise.test.ets | 120 -- .../entry/src/main/module.json | 85 -- .../main/resources/base/element/string.json | 12 - .../src/main/resources/base/media/icon.png | Bin 6790 -> 0 bytes .../resources/base/profile/main_pages.json | 6 - .../signature/openharmony_sx.p7b | Bin 3443 -> 0 bytes .../userfilemgr_base/AppScope/app.json | 21 - .../resources/base/element/string.json | 12 - .../resources/base/media/app_icon.png | Bin 6790 -> 0 bytes .../userfilemgr/userfilemgr_base/BUILD.gn | 40 - .../userfilemgr/userfilemgr_base/Test.json | 69 - .../src/main/ets/Application/AbilityStage.ts | 9 - .../src/main/ets/MainAbility/MainAbility.ts | 36 - .../entry/src/main/ets/pages/index/index.ets | 68 - .../src/main/ets/pages/second/second.ets | 43 - .../entry/src/main/ets/test/List.test.ets | 33 - .../src/main/ets/test/deleteCallback.test.ets | 126 -- .../src/main/ets/test/deletePromise.test.ets | 123 -- .../main/ets/test/getAlbumsCallback.test.ets | 160 --- .../main/ets/test/getAlbumsPromise.test.ets | 142 --- .../ets/test/getFileAssetsCallback.test.ets | 683 ---------- .../ets/test/getFileAssetsPromise.test.ets | 463 ------- .../src/main/ets/test/getUserFileMgr.test.ets | 58 - .../ets/test/onOffReleasePromise.test.ets | 317 ----- .../entry/src/main/module.json | 85 -- .../main/resources/base/element/string.json | 12 - .../src/main/resources/base/media/icon.png | Bin 6790 -> 0 bytes .../resources/base/profile/main_pages.json | 6 - .../signature/openharmony_sx.p7b | Bin 3443 -> 0 bytes .../userfilemgr_fileAsset/AppScope/app.json | 21 - .../resources/base/element/string.json | 12 - .../resources/base/media/app_icon.png | Bin 6790 -> 0 bytes .../userfilemgr_fileAsset/BUILD.gn | 40 - .../userfilemgr_fileAsset/Test.json | 71 -- .../src/main/ets/Application/AbilityStage.ts | 9 - .../src/main/ets/MainAbility/MainAbility.ts | 36 - .../entry/src/main/ets/pages/index/index.ets | 68 - .../src/main/ets/pages/second/second.ets | 43 - .../entry/src/main/ets/test/List.test.ets | 35 - .../fileAssetCommitModifyCallback.test.ets | 152 --- .../fileAssetCommitModifyPromise.test.ets | 143 --- .../test/fileAssetFavoriteCallback.test.ets | 271 ---- .../test/fileAssetFavoritePromise.test.ets | 246 ---- .../main/ets/test/fileAssetFileKey.test.ets | 548 -------- .../fileAssetGetThumbnailCallback.test.ets | 525 -------- .../fileAssetGetThumbnailPromise.test.ets | 499 -------- .../ets/test/fileAssetOpenCallback.test.ets | 450 ------- .../ets/test/fileAssetOpenPromise.test.ets | 426 ------- .../entry/src/main/module.json | 85 -- .../main/resources/base/element/string.json | 12 - .../src/main/resources/base/media/icon.png | Bin 6790 -> 0 bytes .../resources/base/profile/main_pages.json | 6 - .../signature/openharmony_sx.p7b | Bin 3443 -> 0 bytes .../AppScope/app.json | 21 - .../resources/base/element/string.json | 12 - .../resources/base/media/app_icon.png | Bin 6790 -> 0 bytes .../userfilemgr_noPermission/BUILD.gn | 40 - .../userfilemgr_noPermission/Test.json | 50 - .../src/main/ets/Application/AbilityStage.ts | 9 - .../src/main/ets/MainAbility/MainAbility.ts | 36 - .../entry/src/main/ets/pages/index/index.ets | 67 - .../src/main/ets/pages/second/second.ets | 43 - .../entry/src/main/ets/test/List.test.ets | 21 - .../userFileMgrNoPermissionCallback.test.ets | 140 -- .../userFileMgrNoPermissionPromise.test.ets | 119 -- .../entry/src/main/module.json | 85 -- .../main/resources/base/element/string.json | 12 - .../src/main/resources/base/media/icon.png | Bin 6790 -> 0 bytes .../resources/base/profile/main_pages.json | 6 - .../signature/openharmony_sx.p7b | Bin 3443 -> 0 bytes 99 files changed, 1 insertion(+), 9368 deletions(-) delete mode 100644 multimedia/audio/audio_js_standard/AudioTonePlayer/BUILD.gn delete mode 100644 multimedia/audio/audio_js_standard/AudioTonePlayer/Test.json delete mode 100644 multimedia/audio/audio_js_standard/AudioTonePlayer/signature/openharmony_sx.p7b delete mode 100644 multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/config.json delete mode 100644 multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/app.js delete mode 100644 multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/i18n/en-US.json delete mode 100644 multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/i18n/zh-CN.json delete mode 100644 multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/pages/index/index.css delete mode 100644 multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/pages/index/index.hml delete mode 100644 multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/pages/index/index.js delete mode 100644 multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/test/AudioTonePlayer.test.js delete mode 100644 multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/test/List.test.js delete mode 100644 multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/resources/base/element/string.json delete mode 100644 multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/resources/base/media/icon.png delete mode 100755 multimedia/userfilemgr/common.js delete mode 100755 multimedia/userfilemgr/userfilemgr_album/AppScope/app.json delete mode 100755 multimedia/userfilemgr/userfilemgr_album/AppScope/resources/base/element/string.json delete mode 100755 multimedia/userfilemgr/userfilemgr_album/AppScope/resources/base/media/app_icon.png delete mode 100755 multimedia/userfilemgr/userfilemgr_album/BUILD.gn delete mode 100755 multimedia/userfilemgr/userfilemgr_album/Test.json delete mode 100755 multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/pages/index/index.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/pages/second/second.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/test/List.test.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/test/albumCommitModifyCallback.test.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/test/albumCommitModifyPromise.test.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/test/albumGetFileAssetsCallback.test.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/test/albumGetFileAssetsPromise.test.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_album/entry/src/main/module.json delete mode 100755 multimedia/userfilemgr/userfilemgr_album/entry/src/main/resources/base/element/string.json delete mode 100755 multimedia/userfilemgr/userfilemgr_album/entry/src/main/resources/base/media/icon.png delete mode 100755 multimedia/userfilemgr/userfilemgr_album/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 multimedia/userfilemgr/userfilemgr_album/signature/openharmony_sx.p7b delete mode 100755 multimedia/userfilemgr/userfilemgr_base/AppScope/app.json delete mode 100755 multimedia/userfilemgr/userfilemgr_base/AppScope/resources/base/element/string.json delete mode 100755 multimedia/userfilemgr/userfilemgr_base/AppScope/resources/base/media/app_icon.png delete mode 100755 multimedia/userfilemgr/userfilemgr_base/BUILD.gn delete mode 100755 multimedia/userfilemgr/userfilemgr_base/Test.json delete mode 100755 multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/pages/index/index.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/pages/second/second.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/List.test.ets delete mode 100644 multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/deleteCallback.test.ets delete mode 100644 multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/deletePromise.test.ets delete mode 100644 multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/getAlbumsCallback.test.ets delete mode 100644 multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/getAlbumsPromise.test.ets delete mode 100644 multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/getFileAssetsCallback.test.ets delete mode 100644 multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/getFileAssetsPromise.test.ets delete mode 100644 multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/getUserFileMgr.test.ets delete mode 100644 multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/onOffReleasePromise.test.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_base/entry/src/main/module.json delete mode 100755 multimedia/userfilemgr/userfilemgr_base/entry/src/main/resources/base/element/string.json delete mode 100755 multimedia/userfilemgr/userfilemgr_base/entry/src/main/resources/base/media/icon.png delete mode 100755 multimedia/userfilemgr/userfilemgr_base/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 multimedia/userfilemgr/userfilemgr_base/signature/openharmony_sx.p7b delete mode 100755 multimedia/userfilemgr/userfilemgr_fileAsset/AppScope/app.json delete mode 100755 multimedia/userfilemgr/userfilemgr_fileAsset/AppScope/resources/base/element/string.json delete mode 100755 multimedia/userfilemgr/userfilemgr_fileAsset/AppScope/resources/base/media/app_icon.png delete mode 100755 multimedia/userfilemgr/userfilemgr_fileAsset/BUILD.gn delete mode 100755 multimedia/userfilemgr/userfilemgr_fileAsset/Test.json delete mode 100755 multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/pages/index/index.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/pages/second/second.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/List.test.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetCommitModifyCallback.test.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetCommitModifyPromise.test.ets delete mode 100644 multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetFavoriteCallback.test.ets delete mode 100644 multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetFavoritePromise.test.ets delete mode 100644 multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetFileKey.test.ets delete mode 100644 multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetGetThumbnailCallback.test.ets delete mode 100644 multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetGetThumbnailPromise.test.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetOpenCallback.test.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetOpenPromise.test.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/module.json delete mode 100755 multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/resources/base/element/string.json delete mode 100755 multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/resources/base/media/icon.png delete mode 100755 multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 multimedia/userfilemgr/userfilemgr_fileAsset/signature/openharmony_sx.p7b delete mode 100755 multimedia/userfilemgr/userfilemgr_noPermission/AppScope/app.json delete mode 100755 multimedia/userfilemgr/userfilemgr_noPermission/AppScope/resources/base/element/string.json delete mode 100755 multimedia/userfilemgr/userfilemgr_noPermission/AppScope/resources/base/media/app_icon.png delete mode 100755 multimedia/userfilemgr/userfilemgr_noPermission/BUILD.gn delete mode 100755 multimedia/userfilemgr/userfilemgr_noPermission/Test.json delete mode 100755 multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/ets/Application/AbilityStage.ts delete mode 100755 multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/ets/MainAbility/MainAbility.ts delete mode 100755 multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/ets/pages/index/index.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/ets/pages/second/second.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/ets/test/List.test.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/ets/test/userFileMgrNoPermissionCallback.test.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/ets/test/userFileMgrNoPermissionPromise.test.ets delete mode 100755 multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/module.json delete mode 100755 multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/resources/base/element/string.json delete mode 100755 multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/resources/base/media/icon.png delete mode 100755 multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/resources/base/profile/main_pages.json delete mode 100755 multimedia/userfilemgr/userfilemgr_noPermission/signature/openharmony_sx.p7b diff --git a/multimedia/BUILD.gn b/multimedia/BUILD.gn index 8866f544d..ffe5c3ec3 100644 --- a/multimedia/BUILD.gn +++ b/multimedia/BUILD.gn @@ -21,7 +21,6 @@ group("multimedia") { "audio/audio_js_standard/AudioCapturerChangeInfo:audio_capturerchangeInfo_js_hap", "audio/audio_js_standard/AudioEventManagement:audio_eventmanagement_js_hap", "audio/audio_js_standard/AudioRendererChangeInfo:audio_rendererchangeInfo_js_hap", - "audio/audio_js_standard/AudioTonePlayer:audio_tone_player_js_hap", "audio/audio_js_standard/audioInterrupt:audio_interrupt_js_hap", "audio/audio_js_standard/audioInterruptRender:audioRenderInterrupt", "audio/audio_js_standard/audioManager:audio_manager_js_hap", @@ -59,11 +58,7 @@ group("multimedia") { "medialibrary/mediaLibrary_fileResult:mediaLibrary_fileResult_hap", "medialibrary/mediaLibrary_getThumbnail:mediaLibrary_getThumbnail_hap", "medialibrary/mediaLibrary_mediafetchoptions:mediaLibrary_mediafetchoptions_hap", - "medialibrary/mediaLibrary_trash:mediaLibrary_trash_js_hap", - "userfilemgr/userfilemgr_album:userfilemgr_album_js_hap", - "userfilemgr/userfilemgr_base:userfilemgr_base_js_hap", - "userfilemgr/userfilemgr_fileAsset:userfilemgr_fileAsset_js_hap", - "userfilemgr/userfilemgr_noPermission:userfilemgr_noPermission_js_hap", + "medialibrary/mediaLibrary_trash:mediaLibrary_trash_js_hap" ] } else { deps = [ diff --git a/multimedia/audio/audio_js_standard/AudioTonePlayer/BUILD.gn b/multimedia/audio/audio_js_standard/AudioTonePlayer/BUILD.gn deleted file mode 100644 index 128bfcf9a..000000000 --- a/multimedia/audio/audio_js_standard/AudioTonePlayer/BUILD.gn +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (C) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("audio_tone_player_js_hap") { - hap_profile = "./src/main/config.json" - deps = [ - ":audio_tone_player_js_assets", - ":audio_tone_player_resources", - ] - certificate_profile = "./signature/openharmony_sx.p7b" - hap_name = "ActsAudioTonePlayerJsTest" - subsystem_name = "multimedia" - part_name = "multimedia_audio_framework" -} -ohos_js_assets("audio_tone_player_js_assets") { - source_dir = "./src/main/js/default" -} -ohos_resources("audio_tone_player_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" -} diff --git a/multimedia/audio/audio_js_standard/AudioTonePlayer/Test.json b/multimedia/audio/audio_js_standard/AudioTonePlayer/Test.json deleted file mode 100644 index c0bb6222c..000000000 --- a/multimedia/audio/audio_js_standard/AudioTonePlayer/Test.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "description": "Configuration for audio toneplayer Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "1500000", - "package": "ohos.acts.multimedia.audio.toneplayer", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAudioTonePlayerJsTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "hilog -Q pidoff" - ] - } - ] -} \ No newline at end of file diff --git a/multimedia/audio/audio_js_standard/AudioTonePlayer/signature/openharmony_sx.p7b b/multimedia/audio/audio_js_standard/AudioTonePlayer/signature/openharmony_sx.p7b deleted file mode 100644 index 0e9c4376f4c0ea2f256882a2170cd4e81ac135d7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3458 zcmcgvYj6|S6}BF>V{C!JfPn%w;$aHN+?6F;a+=4kw0hx{ys~6lj;L8ltA{P^%F@a! zi$GjaobWJ|FaEp@e!GD1j!Bgoc53*LJ{W;72Dj z?2p|!=bn4-x95E4yK_NOvN$bcR*RwK2ZE&LEVx>o>RsxlbP?G>EQh2>2q~fBPrZ7J_LIz19N^%Y&9F}^_#Tb6S zfe1QU8=x4{7a@2r7uZMy1D*iWBrRPirD#UxBE58kN2XLORK-fUQZ=W~Pk0$J!nuo8 zYDGyA=Uy~N>WWdGASnw_UYeioAsfjc9VR2PKIoP(Ng0Sph^CsjeTIN>lMyE14Y&!0 zM=j$Y1l1eO`5M$}GwO^Q*oO9bofKv?YOsVx1G`8c%o-8cXG95$W^O_YV~Ee!;IFT< zl;gM-X6-Ph$Ksj7_y_9IELGbkf5vH?{|lwMi*7@tJGKeos`Rl)?pg7FA9!h#Dh_IHNv{|!8%8^ zHSCfrd^kW^gWqk&>QEM|gPS-EHe=jk!{Sw(*Q~9NV|7^kp05s}F+9p@@IH)slr?E> zb*LRfjQzO$SecW0V9&VT23Pn0XViwGYPP0IX>?SZ7?)hBH0rEDM-_5Ily2<%m%2#jeE1ebOOkw9_dTu^Oh!(K*(!$#In5rgGbWUw+Ymv&MK zIH&_EE#)#rEEdK>;SEaGU?~r39f-oh*b^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udioTonePlayer/src/main/config.json b/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/config.json deleted file mode 100644 index 2664f35fa..000000000 --- a/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/config.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "app": { - "apiVersion": { - "compatible": 6, - "releaseType": "Beta1", - "target": 7 - }, - "vendor": "acts", - "bundleName": "ohos.acts.multimedia.audio.toneplayer", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": { - "default": { - "debug": true - } - }, - "module": { - "abilities": [ - { - "iconId": 16777218, - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "descriptionId": 16777217, - "visible": true, - "labelId": 16777216, - "icon": "$media:icon", - "name": "ohos.acts.multimedia.audio.toneplayer.MainAbility", - "description": "$string:mainability_description", - "label": "$string:entry_MainAbility", - "type": "page", - "homeAbility": true, - "launchType": "standard" - } - ], - "deviceType": [ - "tablet", - "default", - "phone", - "tablet", - "tv", - "wearable" - ], - "mainAbility": "ohos.acts.multimedia.audio.toneplayer.MainAbility", - "distro": { - "moduleType": "entry", - "installationFree": false, - "deliveryWithInstall": true, - "moduleName": "entry" - }, - "package": "ohos.acts.multimedia.audio.toneplayer", - "name": ".MyApplication", - "js": [ - { - "pages": [ - "pages/index/index" - ], - "name": "default", - "window": { - "designWidth": 720, - "autoDesignWidth": true - } - } - ], - "reqPermissions": [ - { - "name": "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", - "reason": "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" - }, - { - "name": "ohos.permission.MICROPHONE", - "reason": "use ohos.permission.MICROPHONE" - }, - { - "name": "ohos.permission.MANAGE_AUDIO_CONFIG", - "reason": "use ohos.permission.MANAGE_AUDIO_CONFIG" - } - ] - } - } \ No newline at end of file diff --git a/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/app.js b/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/app.js deleted file mode 100644 index 830070d19..000000000 --- a/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/app.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - onCreate() { - console.info('AceApplication onCreate'); - }, - onDestroy() { - console.info('AceApplication onDestroy'); - } -}; diff --git a/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/i18n/en-US.json b/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/i18n/en-US.json deleted file mode 100644 index e63c70d97..000000000 --- a/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/i18n/en-US.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "Hello", - "world": "World" - } -} \ No newline at end of file diff --git a/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/i18n/zh-CN.json b/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/i18n/zh-CN.json deleted file mode 100644 index de6ee5748..000000000 --- a/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/i18n/zh-CN.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "strings": { - "hello": "您好", - "world": "世界" - } -} \ No newline at end of file diff --git a/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/pages/index/index.css b/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/pages/index/index.css deleted file mode 100644 index 5bd756702..000000000 --- a/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/pages/index/index.css +++ /dev/null @@ -1,46 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; - width: 100%; - height: 100%; -} - -.title { - font-size: 40px; - color: #000000; - opacity: 0.9; -} - -@media screen and (device-type: tablet) and (orientation: landscape) { - .title { - font-size: 100px; - } -} - -@media screen and (device-type: wearable) { - .title { - font-size: 28px; - color: #FFFFFF; - } -} - -@media screen and (device-type: tv) { - .container { - background-image: url("/common/images/Wallpaper.png"); - background-size: cover; - background-repeat: no-repeat; - background-position: center; - } - - .title { - font-size: 100px; - color: #FFFFFF; - } -} - -@media screen and (device-type: phone) and (orientation: landscape) { - .title { - font-size: 60px; - } -} diff --git a/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/pages/index/index.hml b/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/pages/index/index.hml deleted file mode 100644 index f64b040a5..000000000 --- a/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/pages/index/index.hml +++ /dev/null @@ -1,5 +0,0 @@ -
- - {{ $t('strings.hello') }} {{ title }} - -
diff --git a/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/pages/index/index.js b/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/pages/index/index.js deleted file mode 100644 index 67f8b8567..000000000 --- a/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/default/pages/index/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import {Core, ExpectExtend} from 'deccjsunit/index' - -export default { - data: { - title: "" - }, - onInit() { - this.title = this.$t('strings.world'); - }, - onShow() { - console.info('onShow finish') - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - core.init() - const configService = core.getDefaultService('config') - this.timeout = 60000 - configService.setConfig(this) - require('../../../test/List.test') - core.execute() - }, - onReady() { - }, -} \ No newline at end of file diff --git a/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/test/AudioTonePlayer.test.js b/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/test/AudioTonePlayer.test.js deleted file mode 100644 index 9a2612b86..000000000 --- a/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/test/AudioTonePlayer.test.js +++ /dev/null @@ -1,1131 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http:// www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import audio from '@ohos.multimedia.audio'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; - -describe('audioTonePlayer',function() { - let tonePlayerCallback = null; - let name; - beforeAll(function(){ - console.log('beforeAll test suit is executed'); - }) - beforeEach(function(){ - console.log('beforeEach test suit is executed'); - }) - beforeEach(function(){ - console.log('beforeEach test suit is executed'); - }) - - afterEach(function(){ - console.log('afterEach test suit is executed'); - }) - afterAll(function(){ - console.log('afterAll test suit is executed'); - }) - - async function recCallBack(info, type, name, done) { - console.info('AudioFrameworkRecLog: recCallBack : TonePlayer Function '+ JSON.stringify(name) + ', type: ' + type); - audio.createTonePlayer(info, async (err, data) => { - console.info('AudioFrameworkRecLog: TonePlayer : CREATE SUCCESS'); - if (err) { - console.error(`callback call createTonePlayer return error: ${err.message}`); - expect(true).assertFalse(); - console.info('createTonePlayer fail'); - done(); - return; - } else { - tonePlayerCallback = data; - console.error("callback call createTonePlayer return tonePlayer:" + JSON.stringify(tonePlayerCallback)); - } - tonePlayerCallback.load(type, async (err) => { - console.info('AudioFrameworkRecLog: TonePlayer : LOAD SUCCESS type: ' + type); - if (err) { - console.error(`callback call load failed error: ${err.message}`); - expect(true).assertFalse(); - console.error('callback load fail'); - done(); - return; - } else { - console.info(`callback call load success `); - } - tonePlayerCallback.start((err) => { - console.info('AudioFrameworkRecLog: TonePlayer : START SUCCESS'); - if (err) { - console.error(`callback call start failed error. ${err.message}`); - expect(true).assertFalse(); - console.error('start fail'); - done(); - return; - } else { - console.info(`callback call start success `); - } - console.error("callback stop -------------start"); - tonePlayerCallback.stop((err) => { - console.info('AudioFrameworkRecLog: TonePlayer : STOP SUCCESS'); - if (err) { - console.error(`callback call stop error. ${err.message}`); - expect(true).assertFalse(); - console.error('callback stop fail'); - done(); - return; - } else { - console.info(`callback call stop success `); - } - console.info("callback release -------------start"); - tonePlayerCallback.release((err) => { - console.info('AudioFrameworkRecLog: TonePlayer : RELEASE SUCCESS'); - if (err) { - console.error(`callback call release failed error. ${err.message}`); - expect(true).assertFalse(); - console.error('callback release fail'); - done(); - return; - } else { - console.info(`callback call release success `); - expect(true).assertTrue(); - console.info('RELEASE SUCCESS'); - done(); - } - }); //release - }); //stop - }); //start - }); //load - }); - } - - async function recPromise(audioRendererInfo, type, name) { - console.info('AudioFrameworkRecLog recPromise: promise : TonePlayer Function '+ JSON.stringify(name) + ', type: ' + type); - let resultFlag = true; - let tPlayer = null; - await audio.createTonePlayer(audioRendererInfo).then((result) => { - console.info('AudioFrameworkRecLog promise call createTonePlayer-----result: ' + JSON.stringify(result)); - tPlayer = result; - }).catch((err) => { - console.error('promise call createTonePlayer fail tPlayer: '+ tPlayer); - console.error(`promise call createTonePlayer ---fail error. ${err.message}`); - resultFlag = false; - }); - if (resultFlag == false) { - console.error('AudioFrameworkRecLog: createTonePlayer resultFlag : ' + resultFlag); - return resultFlag; - } - await tPlayer.load(type).then(() => { - console.info('AudioFrameworkRecLog: TonePlayer : LOAD SUCCESS'); - console.info('AudioFrameworkRecLog: ---------LOAD---------'); - }).catch((err) => { - resultFlag = false; - console.error(`promise call load ---fail error. ${err.message}`); - }); - if (resultFlag == false) { - console.error('AudioFrameworkRecLog: load resultFlag : ' + resultFlag); - return resultFlag; - } - await tPlayer.start().then(() => { - console.info('AudioFrameworkRecLog: TonePlayer : START SUCCESS'); - console.info('AudioFrameworkRecLog: ---------START---------'); - }).catch((err) => { - resultFlag = false; - console.error(`promise call start ---fail error. ${err.message}`); - }); - if (resultFlag == false) { - console.error('AudioFrameworkRecLog: start resultFlag : ' + resultFlag); - return resultFlag; - } - await tPlayer.stop().then(() => { - console.info('AudioFrameworkRecLog: TonePlayer : STOP SUCCESS'); - console.info('AudioFrameworkRecLog: ---------STOP---------'); - }).catch((err) => { - resultFlag = false; - console.error(`promise call stop ---fail error. ${err.message}`); - }); - if (resultFlag == false) { - console.error('AudioFrameworkRecLog: stop resultFlag : ' + resultFlag); - return resultFlag; - } - await tPlayer.release().then(() => { - console.info('AudioFrameworkRecLog: TonePlayer : RELEASE SUCCESS'); - console.info('AudioFrameworkRecLog: ---------RELEASE---------'); - }).catch((err) => { - resultFlag = false; - console.error(`promise call release ---fail error. ${err.message}`); - }); - if (resultFlag == false) { - console.error('AudioFrameworkRecLog: release resultFlag : ' + resultFlag); - return resultFlag; - } - console.info('promise resultFlag : ' + resultFlag); - return resultFlag; - } - - async function recPromiseStartFail(audioRendererInfo, type, name) { - console.info('recPromiseFail: promise : TonePlayer Function '+ JSON.stringify(name) + ', type: ' + type); - let resultFlag = true; - let tPlayer = null; - console.info('AudioFrameworkRecLog: recPromiseFail : TonePlayer Function ' + JSON.stringify(name)); - await audio.createTonePlayer(audioRendererInfo).then((result) => { - console.info("recPromiseFail call createTonePlayer-----result:" + JSON.stringify(result)); - tPlayer = result; - }).catch((err) => { - console.error("recPromiseFail call createTonePlayer fail err: "+ JSON.stringify(err)+ ' tPlayer: '+ tPlayer); - console.error("recPromiseFail call createTonePlayer ---fail"); - resultFlag = false; - }); - if (resultFlag == false) { - console.error('recPromiseFail: createTonePlayer resultFlag : ' + resultFlag); - return resultFlag; - } - await tPlayer.start().then(() => { - console.info('recPromiseFail start TonePlayer : START SUCCESS'); - console.info('recPromiseFail ---------START---------'); - }).catch(() => { - resultFlag = false; - console.error("recPromiseFail call start fail"); - }); - if (resultFlag == false) { - console.error('recPromiseFail resultFlag : ' + resultFlag); - return resultFlag; - } - await tPlayer.release().then(() => { - console.info('recPromiseFail TonePlayer : RELEASE SUCCESS'); - console.info('recPromiseFail ---------RELEASE---------'); - }).catch((err) => { - resultFlag = false; - console.error("recPromiseFail call release fail " + JSON.stringify(err)); - }); - if (resultFlag == false) { - console.error('recPromiseFail resultFlag : ' + resultFlag); - return resultFlag; - } - console.info('recPromiseFail resultFlag : ' + resultFlag); - return resultFlag; - } - - async function recPromiseLoadStopSuccess(audioRendererInfo, type, name) { - console.info('recPromiseFail: promise : TonePlayer Function '+ JSON.stringify(name) + ', type: ' + type); - let resultFlag = true; - let tPlayer = null; - console.info('AudioFrameworkRecLog: recPromiseFail : TonePlayer Function ' + JSON.stringify(name)); - await audio.createTonePlayer(audioRendererInfo).then((result) => { - console.info("recPromiseFail call createTonePlayer-----result:" + JSON.stringify(result)); - tPlayer = result; - }).catch((err) => { - console.error("recPromiseFail call createTonePlayer fail err: "+ JSON.stringify(err)+ ' tPlayer: '+ tPlayer); - console.error("recPromiseFail call createTonePlayer ---fail"); - resultFlag = false; - }); - if (resultFlag == false) { - console.error('recPromiseFail: createTonePlayer resultFlag : ' + resultFlag); - return resultFlag; - } - await tPlayer.load(type).then(() => { - console.info('AudioFrameworkRecLog: TonePlayer : LOAD SUCCESS'); - console.info('AudioFrameworkRecLog: ---------LOAD---------'); - }).catch((err) => { - resultFlag = false; - console.error(`promise call load ---fail error. ${err.message}`); - }); - if (resultFlag == false) { - console.error('AudioFrameworkRecLog: load resultFlag : ' + resultFlag); - return resultFlag; - } - await tPlayer.stop().then(() => { - console.info('AudioFrameworkRecLog: TonePlayer : STOP SUCCESS'); - console.info('AudioFrameworkRecLog: ---------STOP---------'); - }).catch((err) => { - resultFlag = false; - console.error(`promise call stop ---fail error. ${err.message}`); - }); - if (resultFlag == false) { - console.error('AudioFrameworkRecLog: stop resultFlag : ' + resultFlag); - return resultFlag; - } - await tPlayer.release().then(() => { - console.info('recPromiseFail TonePlayer : RELEASE SUCCESS'); - console.info('recPromiseFail ---------RELEASE---------'); - }).catch((err) => { - resultFlag = false; - console.error("recPromiseFail call release fail " + JSON.stringify(err)); - }); - if (resultFlag == false) { - console.error('recPromiseFail resultFlag : ' + resultFlag); - return resultFlag; - } - console.info('recPromiseFail resultFlag : ' + resultFlag); - return resultFlag; - } - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_CALLBACK_ALL_0100 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : Callback test case of AudioTonePlayer - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 0 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_CALLBACK_ALL_0100', 0, async function(done) { - let time1 = (new Date()).getTime(); - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - recCallBack(audioRendererInfo, audio.ToneType.TONE_TYPE_DIAL_0, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_CALLBACK_ALL_0100', done); - let time2 = (new Date).getTime(); - console.info('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_CALLBACK_ALL_0100 finish time: ' + (time2 - time1)); - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_CALLBACK_ALL_0200 - *@tc.name : AudioTonePlayer-create - *@tc.desc : Creation of AudioTonePlayer - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 1 - */ - it('SUB_MULTIMEDIA_AUDIO_TTONEPLAYER_CALLBACK_ALL_0200', 1, async function(done) { - let time1 = (new Date()).getTime(); - audio.createTonePlayer(null, async (err, data) => { - console.info('SUB_MULTIMEDIA_AUDIO_TTONEPLAYER_CALLBACK_ALL_0200 param is null'); - if (err) { - console.error('callback call createTonePlayer return error:'+ JSON.stringify(err)); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - expect(false).assertFalse(); - done(); - } else { - tonePlayerCallback = data; - expect(true).assertFalse(); - done(); - console.error("callback call createTonePlayer return tonePlayer:" + JSON.stringify(tonePlayerCallback)); - } - console.error("callback create end----------- tonePlayerCallback:" + JSON.stringify(tonePlayerCallback)); - }); - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0100 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : The successful test case of the promise of the dial tone of AudioTonePlayer key 1 - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 1 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0100', 1, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_DIAL_1, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0100'); - console.info('ArecPromise 01 resultFlag : ' + resultFlag); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 01 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0200 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : The successful test case of the promise of the dial tone of AudioTonePlayer key 2 - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0200', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_DIAL_2, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0200'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 02 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0300 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : The successful test case of the promise of the dial tone of AudioTonePlayer key 3 - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0300', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_DIAL_3, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0300'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 03 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0400 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : The successful test case of the promise of the dial tone of AudioTonePlayer key 4 - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0400', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_DIAL_4, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0400'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 04 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0500 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : The successful test case of the promise of the dial tone of AudioTonePlayer key 5 - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0500', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_DIAL_5, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0500'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 05 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0600 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : The successful test case of the promise of the dial tone of AudioTonePlayer key 6 - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0600', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_DIAL_6, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0600'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 06 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0700 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : The successful test case of the promise of the dial tone of AudioTonePlayer key 7 - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0700', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_DIAL_7, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0700'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 07 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0800 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : The successful test case of the promise of the dial tone of AudioTonePlayer key 8 - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0800', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_DIAL_8, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0800'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 08 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0900 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : The successful test case of the promise of the dial tone of AudioTonePlayer key 9 - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0900', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_DIAL_9, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_0900'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 09 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1000 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : The successful test case of the promise of the dial tone of AudioTonePlayer key * - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1000', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_DIAL_S, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1000'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 10 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1100 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : The successful test case of the promise of the dial tone of AudioTonePlayer key # - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1100', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_DIAL_P, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1100'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 11 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1200 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : The successful test case of the promise of the dial tone of AudioTonePlayer key A - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1200', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_DIAL_A, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1200'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 12 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1300 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : The successful test case of the promise of the dial tone of AudioTonePlayer key B - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1300', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_DIAL_B, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1300'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 13 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1400 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : The successful test case of the promise of the dial tone of AudioTonePlayer key C - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1400', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_DIAL_C, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1400'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 14 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1500 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : The successful test case of the promise of the dial tone of AudioTonePlayer key D - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1500', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_DIAL_D, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1500'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 15 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1600 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : AudioTonePlayer Dial Monitoring Tone Promise Success Test Case - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1600', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_COMMON_SUPERVISORY_DIAL, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1600'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 16 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1700 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : AudioTonePlayer Busy Tone Promise Successful Test Case - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1700', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_COMMON_SUPERVISORY_BUSY, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1700'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 17 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1800 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : AudioTonePlayer Congestion Promise Success Test Case - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1800', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_COMMON_SUPERVISORY_CONGESTION, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1800'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 18 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1900 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : AudioTonePlayer Wireless Circuit Path Confirmation Monitoring Tone Promise Success Test Case - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1900', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_COMMON_SUPERVISORY_RADIO_ACK, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_1900'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 19 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2000 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : AudioTonePlayer radio unavailable promise success test case - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2000', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_COMMON_SUPERVISORY_RADIO_NOT_AVAILABLE, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2000'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 20 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2100 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : AudioTonePlayer Call Waiting Promise Success Test Case - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2100', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_COMMON_SUPERVISORY_CALL_WAITING, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2100'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 21 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2200 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : AudioTonePlayer ring tone promise success test case - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2200', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_COMMON_SUPERVISORY_RINGTONE, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2200'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 22 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2300 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : Promise success test case of AudioTonePlayer special beep - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2300', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_COMMON_PROPRIETARY_BEEP, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2300'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 23 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2400 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : AudioTonePlayer positively approves the successful test case of a promise in a proprietary tone - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2400', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_COMMON_PROPRIETARY_ACK, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2400'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 24 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2500 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : AudioTonePlayer prompts the successful promise test case of the special tone - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2500', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_COMMON_PROPRIETARY_PROMPT, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2500'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 25 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2600 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : Success Test Case of Promise of AudioTonePlayer Dedicated Double Beep - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2600', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, audio.ToneType.TONE_TYPE_COMMON_PROPRIETARY_DOUBLE_BEEP, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2600'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 26 resultFlag : ' + resultFlag); - expect(resultFlag).assertTrue(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2700 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : Promise test case of AudioTonePlayer error parameter - 1 - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2700', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, -1, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2700'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 27 resultFlag : ' + resultFlag); - expect(resultFlag).assertFalse(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2800 - *@tc.name : AudioTonePlayer-create-load-start-stop-release - *@tc.desc : Promise test case with null AudioTonePlayer error parameter - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2800', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromise(audioRendererInfo, null, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2800'); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 28 resultFlag : ' + resultFlag); - expect(resultFlag).assertFalse(); - done(); - }, 1000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2900 - *@tc.name : AudioTonePlayer-create-stop-release fail - *@tc.desc : Test Case for Promise Failure of Dial Tone of AudioTonePlayer Key 1 - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2900', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromiseStartFail(audioRendererInfo, audio.ToneType.TONE_TYPE_DIAL_1, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_2900'); - console.info('ArecPromise 01 resultFlag : ' + resultFlag); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 29 resultFlag : ' + resultFlag); - expect(resultFlag).assertFalse(); - done(); - }, 2000) - }) - - /** - *@tc.number : SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_3000 - *@tc.name : AudioTonePlayer-create-load-stop-release fail - *@tc.desc : The successful test case of the promise of the dial tone of AudioTonePlayer key 1 - *@tc.size : MEDIUM - *@tc.type : Function - *@tc.level : Level 2 - */ - it('SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_3000', 2, async function(done) { - let time1 = (new Date()).getTime(); - let resultFlag = false; - let audioRendererInfo = { - "contentType": audio.ContentType.CONTENT_TYPE_SONIFICATION, - "streamUsage": audio.StreamUsage.STREAM_USAGE_MEDIA, - "rendererFlags": 0 - } - - resultFlag = await recPromiseLoadStopSuccess(audioRendererInfo, audio.ToneType.TONE_TYPE_DIAL_1, 'SUB_MULTIMEDIA_AUDIO_TONEPLAYER_PROMISE_ALL_3000'); - console.info('ArecPromise 01 resultFlag : ' + resultFlag); - let time2 = (new Date).getTime(); - console.info('time: ' + (time2 - time1)); - setTimeout(function() { - console.info('AudioFrameworkRenderLog: callback all 30 resultFlag : ' + resultFlag); - expect(resultFlag).assertFalse(); - done(); - }, 2000) - }) - -}) \ No newline at end of file diff --git a/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/test/List.test.js b/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/test/List.test.js deleted file mode 100644 index 9ade1eab8..000000000 --- a/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/js/test/List.test.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -require('./AudioTonePlayer.test.js') - - diff --git a/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/resources/base/element/string.json b/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/resources/base/element/string.json deleted file mode 100644 index 0bae6bd40..000000000 --- a/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "entry_MainAbility" - }, - { - "name": "mainability_description", - "value": "JS_Empty Ability" - } - ] -} \ No newline at end of file diff --git a/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/resources/base/media/icon.png b/multimedia/audio/audio_js_standard/AudioTonePlayer/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#Ly zaNOmT(^9tIb&eb4%CzIT zAm3CUtWSr1t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xIhyZ9BW$`>6JvO;%VFpqVr8|7t3~AmxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}y setTimeout(res, times)); -} - -const allFetchOp = function () { - let predicates = new dataSharePredicates.DataSharePredicates(); - return { - fetchColumns: [], - predicates: predicates - }; -} - -const audioFetchOps = function (testNum, path) { - let predicates = new dataSharePredicates.DataSharePredicates(); - predicates.equalTo("relative_path", path); - let ops = { - fetchColumns: [], - predicates: predicates - }; - console.info(`${testNum} queryOps: relative_path = ${path}`); - return ops -} - -const imageVideoFetchOps = function (testNum, path) { - let predicates = new dataSharePredicates.DataSharePredicates(); - predicates.equalTo("relative_path", path); - let ops = { - fetchColumns: [], - predicates: predicates - }; - console.info(`${testNum} queryOps: relative_path = ${path}`); - return ops -} - -const audioNameFetchOps = function (testNum, path, displayName) { - let predicates = new dataSharePredicates.DataSharePredicates(); - predicates.equalTo("relative_path", path) - .equalTo(AUDIOKEY.DISPLAY_NAME, displayName); - let ops = { - fetchColumns: [], - predicates: predicates - }; - console.info(`${testNum} queryOps: relative_path = ${path} AND display_name = ${displayName}`); - return ops -} - -const imageVideoNameFetchOps = function (testNum, path, displayName) { - let predicates = new dataSharePredicates.DataSharePredicates(); - predicates.equalTo("relative_path", path) - .equalTo(IMAGEVIDEOKEY.DISPLAY_NAME, displayName); - let ops = { - fetchColumns: [], - predicates: predicates - }; - console.info(`${testNum} queryOps: relative_path = ${path} AND display_name = ${displayName}`); - return ops -} - -const albumFetchOps = function (testNum, path, albumName) { - let predicates = new dataSharePredicates.DataSharePredicates(); - predicates.equalTo("relative_path", path) - .equalTo(ALBUMKEY.ALBUM_NAME, albumName); - let ops = { - predicates: predicates - }; - console.info(`${testNum} queryOps: relative_path = ${path} AND bucket_display_name = ${albumName}`); - return ops -} - -const checkPresetsAssets = async function (userfilemgr, hapName) { - console.info('checkPresetsAssets start') - let fetchAlbumResult = await userfilemgr.getPhotoAlbums(allFetchOp()); - let albumsCount = fetchAlbumResult.getCount(); - let fetchPhotoResult = await userfilemgr.getPhotoAssets(allFetchOp()); - let fetchAudioResult = await userfilemgr.getAudioAssets(allFetchOp()); - let assetsCount = fetchPhotoResult.getCount() + fetchAudioResult.getCount(); - console.info(`${hapName}:: assetsCount: ${assetsCount} albumsCount: ${albumsCount}, - presetsassetsCount: ${presetsCount[hapName].assetsCount} - presetsalbumsCount: ${presetsCount[hapName].albumsCount}`); - console.info('checkPresetsAssets end') -} - -const checkAssetsCount = async function (done, testNum, fetchAssetResult, expectCount) { - if (!fetchAssetResult) { - console.info(`${testNum}:: fetchAssetResult is undefined`); - expect(false).assertTrue(); - done(); - return false - } - let count = await fetchAssetResult.getCount(); - if (count != expectCount) { - console.info(`${testNum}:: count:expectCount - ${count} : ${expectCount}`); - expect(count).assertEqual(expectCount); - done(); - } - return count == expectCount; -} - -const getPermission = async function (name = 'ohos.acts.multimedia.userfilemgr') { - console.info('getPermission start', name) - let appInfo = await bundle.getApplicationInfo('ohos.acts.multimedia.userfilemgr', 0, 100); - let tokenID = appInfo.accessTokenId; - let atManager = abilityAccessCtrl.createAtManager(); - try { - await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.MEDIA_LOCATION", 1); - } catch (error) { - console.info('getPermission MEDIA_LOCATION failed') - } - try { - await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.READ_IMAGEVIDEO", 1); - } catch (error) { - console.info('getPermission READ_IMAGEVIDEO failed') - } - try { - await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.READ_AUDIO", 1); - } catch (error) { - console.info('getPermission READ_AUDIO failed') - } - try { - await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.READ_DOCUMENT", 1); - } catch (error) { - console.info('getPermission READ_DOCUMENT failed') - } - try { - await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.WRITE_IMAGEVIDEO", 1); - } catch (error) { - console.info('getPermission WRITE_IMAGEVIDEO failed') - } - try { - await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.WRITE_AUDIO", 1); - } catch (error) { - console.info('getPermission WRITE_AUDIO failed') - } - try { - await atManager.grantUserGrantedPermission(tokenID, "ohos.permission.WRITE_DOCUMENT", 1); - } catch (error) { - console.info('getPermission WRITE_DOCUMENT failed') - } - let isGranted1 = await atManager.verifyAccessToken(tokenID, "ohos.permission.MEDIA_LOCATION"); - let isGrantedReadImageVideo = await atManager.verifyAccessToken(tokenID, "ohos.permission.READ_IMAGEVIDEO"); - let isGrantedReadAudio = await atManager.verifyAccessToken(tokenID, "ohos.permission.READ_AUDIO"); - let isGrantedReadDocument = await atManager.verifyAccessToken(tokenID, "ohos.permission.READ_DOCUMENT"); - let isGrantedWriteImageVideo = await atManager.verifyAccessToken(tokenID, "ohos.permission.WRITE_IMAGEVIDEO"); - let isGrantedWriteAudio = await atManager.verifyAccessToken(tokenID, "ohos.permission.WRITE_AUDIO"); - let isGrantedWriteDocument = await atManager.verifyAccessToken(tokenID, "ohos.permission.WRITE_DOCUMENT"); - if (isGranted1 !=0 || - !(isGrantedReadImageVideo == 0 && isGrantedReadAudio == 0 && isGrantedReadDocument == 0) || - !(isGrantedWriteImageVideo == 0 && isGrantedWriteAudio == 0 && isGrantedWriteDocument == 0)) { - console.info('getPermission failed') - } - console.info('getPermission end') -} - -const isNum = function (value) { - return typeof value === 'number' && !isNaN(value); -} -export { - getPermission, - IMAGE_TYPE, - VIDEO_TYPE, - AUDIO_TYPE, - THROW_ERROR_CODE, - sleep, - allFetchOp, - audioFetchOps, - imageVideoFetchOps, - audioNameFetchOps, - imageVideoNameFetchOps, - albumFetchOps, - checkPresetsAssets, - checkAssetsCount, - isNum, -}; \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_album/AppScope/app.json b/multimedia/userfilemgr/userfilemgr_album/AppScope/app.json deleted file mode 100755 index 103cf8e63..000000000 --- a/multimedia/userfilemgr/userfilemgr_album/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app":{ - "bundleName":"ohos.acts.multimedia.userfilemgr", - "vendor":"huawei", - "versionCode":1000000, - "versionName":"1.0.0", - "debug":false, - "icon":"$media:icon", - "label":"$string:entry_MainAbility", - "description":"$string:mainability_description", - "distributedNotificationEnabled":true, - "keepAlive":true, - "singleUser":true, - "minAPIVersion":8, - "targetAPIVersion":8, - "car":{ - "apiCompatibleVersion":8, - "singleUser":false - } - } -} diff --git a/multimedia/userfilemgr/userfilemgr_album/AppScope/resources/base/element/string.json b/multimedia/userfilemgr/userfilemgr_album/AppScope/resources/base/element/string.json deleted file mode 100755 index 9b9d5b5e1..000000000 --- a/multimedia/userfilemgr/userfilemgr_album/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "MediaLibraryJSTestMain" - }, - { - "name": "mainability_description", - "value": "MediaLibraryJSTestMain Ability" - } - ] -} \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_album/AppScope/resources/base/media/app_icon.png b/multimedia/userfilemgr/userfilemgr_album/AppScope/resources/base/media/app_icon.png deleted file mode 100755 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fco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0;2v$~AL z{scF-cL{wsdrmPvf#a9OHyYLcwQD4Kcm)`LLwMh4WT~p29f7M!iafJSU`IV}QY5Wa z(n44-9oA}?J{a+ah*@31WTs#&J#o1`H98#6IQf;Wv0N_!);f&9g7o-k(lW5rWnDUR zQBFIRG+X=6NnsI@mxnwm;tf5;_Uxg?jZ8m-m0}&6+DA!qam(p$mN5R})yA_7m$q@| zFEd|dpS595rxQr-n#GjI5i-AhnUE>Cr;jpCqSrD~EwK_DqI^7%3#p5)%T_od!t3SOmH9MyXeeGO2(UQL;ax|x?Ncixmeo1=$ z{-);Au{*tfzOG?KQ~K|ak8-HQ?`Pekhe2WM(8s{xv-p>Zmu_6{G!-oE$7$mY`MOJorI=+mMx?H;`pr!;fVYz?5~yXBACruWB`Ph zZM}90_<^OBxIhyZ9BW$`>6JvO;%VFpqVr8|7t3~AmxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}y/storage/media/100/local/temp" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "mkdir -pv /storage/media/100/local/files/Pictures/{Static,DynamicCb,DynamicPro}", - - "for d in Static DynamicCb DynamicPro; do for i in $$(seq 1); do cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/$$d/0$$i.jpg; done;done;", - - "chmod -R 777 /storage/media/100/local/files/*", - "chmod -R 777 /data/service/el2/100/hmdfs/account/files/*", - "hilog -Q pidoff", - "hilog -p off", - "hilog -b I", - "hilog -b D -D 0xD002B70", - "scanner", - "sleep 10" - ], - "teardown-command":[ - "hilog -b X -D 0xD002B70" - ] - }, - { - "test-file-name": [ - "ActsUserFileMgrAlbumJsTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/Application/AbilityStage.ts b/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index 9df3a8d75..000000000 --- a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,9 +0,0 @@ -import AbilityStage from "@ohos.app.ability.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} diff --git a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/MainAbility/MainAbility.ts b/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 8a2d100df..000000000 --- a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,36 +0,0 @@ -import Ability from '@ohos.app.ability.UIAbility' - -export default class MainAbility extends Ability { - onCreate(want,launchParam){ - // Ability is creating, initialize resources for this ability - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - //Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/pages/index/index.ets b/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/pages/index/index.ets deleted file mode 100755 index ac301f987..000000000 --- a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/pages/index/index.ets +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import file from '@system.file'; - -import { Core, ExpectExtend, InstrumentLog, ReportExtend } from "deccjsunit/index" -import testsuite from "../../test/List.test.ets" - -@Entry -@Component -struct Index { - - aboutToAppear(){ - console.info("start run testcase!!!!") - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - const reportExtend = new ReportExtend(file) - - core.addService('report', reportExtend) - core.init() - core.subscribeEvent('task', reportExtend) - const configService = core.getDefaultService('config') - console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters)) - globalThis.abilityWant.parameters.timeout = 70000; - configService.setConfig(globalThis.abilityWant.parameters) - console.info('testsuite()---->') - testsuite(globalThis.abilityContext) - core.execute() - console.info('core.execute()---->') - } - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World') - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(25) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/pages/second/second.ets b/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/pages/second/second.ets deleted file mode 100755 index 1f2a06b64..000000000 --- a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/pages/second/second.ets +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import router from '@system.router'; - -@Entry -@Component -struct Second { - private content: string = "Second Page" - - build() { - Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text(`${this.content}`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('back to index') - .fontSize(20) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - router.back() - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/test/List.test.ets b/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/test/List.test.ets deleted file mode 100755 index 3eb3b9f14..000000000 --- a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import albumCommitModifyCallback from './albumCommitModifyCallback.test.ets' -import albumCommitModifyPromise from './albumCommitModifyPromise.test.ets' -import albumGetFileAssetsCallback from './albumGetFileAssetsCallback.test.ets' -import albumGetFileAssetsPromise from './albumGetFileAssetsPromise.test.ets' -export default function testsuite(abilityContext) { - albumCommitModifyCallback(abilityContext) - albumCommitModifyPromise(abilityContext) - albumGetFileAssetsCallback(abilityContext) - albumGetFileAssetsPromise(abilityContext) -} diff --git a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/test/albumCommitModifyCallback.test.ets b/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/test/albumCommitModifyCallback.test.ets deleted file mode 100755 index 4e8fe7492..000000000 --- a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/test/albumCommitModifyCallback.test.ets +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; -import dataSharePredicates from '@ohos.data.dataSharePredicates'; - -import { - sleep, - albumFetchOps, - checkPresetsAssets, - checkAssetsCount, - getPermission, -} from '../../../../../../common'; - - -export default function albumCommitModifyCallback(abilityContext) { - describe('albumCommitModifyCallback', function () { - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - await getPermission(); - await checkPresetsAssets(userfilemgr, 'ActsUserFileMgrAlbumJsTest'); - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - const albumCommitModify = async function (done, testNum, fetchOp, expectAlbumCount = 1) { - try { - const fetchAlbumResult = await userfilemgr.getPhotoAlbums(fetchOp); - const albumCountPass = await checkAssetsCount(done, testNum, fetchAlbumResult, expectAlbumCount); - if (!albumCountPass) return; - const album = await fetchAlbumResult.getFirstObject(); - const oldName = album.albumName; - const albumUri = album.albumUri; - const newName = 'newAlbumNameCallback'; - fetchAlbumResult.close(); - album.albumName = newName; - album.commitModify(async () => { - let predicates = new dataSharePredicates.DataSharePredicates(); - predicates.equalTo(userFileManager.AlbumKey.URI.toString(), albumUri); - let ops = { - predicates: predicates - }; - const newResult = await userfilemgr.getPhotoAlbums(ops); - const albumCountPass = await checkAssetsCount(done, testNum, newResult, expectAlbumCount); - if (!albumCountPass) return; - const newAlbum = await newResult.getFirstObject(); - expect(newAlbum.albumName).assertEqual(newName); - newAlbum.albumName = oldName; - await newAlbum.commitModify(); - done(); - }); - } catch (error) { - console.info(`${testNum}, failed error: ${error}`) - expect(false).assertTrue(); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_ALBUM_COMMITMODIFY_CALLBACK_01 - * @tc.name : commitModify - * @tc.desc : image album modify albumname - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_ALBUM_COMMITMODIFY_CALLBACK_01', 2, async function (done) { - const testNum = 'SUB_USERFILE_MGR_ALBUM_COMMITMODIFY_CALLBACK_01'; - let currentFetchOp = albumFetchOps(testNum, 'Pictures/', 'DynamicCb'); - await albumCommitModify(done, testNum, currentFetchOp); - }); - }); -} - - diff --git a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/test/albumCommitModifyPromise.test.ets b/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/test/albumCommitModifyPromise.test.ets deleted file mode 100755 index a71a82e05..000000000 --- a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/test/albumCommitModifyPromise.test.ets +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; -import dataSharePredicates from '@ohos.data.dataSharePredicates'; - -import { - sleep, - albumFetchOps, - checkPresetsAssets, - checkAssetsCount, - getPermission, -} from '../../../../../../common'; - - -export default function albumCommitModifyPromise(abilityContext) { - describe('albumCommitModifyPromise', function () { - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - await getPermission(); - await checkPresetsAssets(userfilemgr, 'ActsUserFileMgrAlbumJsTest'); - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - const albumCommitModify = async function (done, testNum, fetchOp, expectAlbumCount = 1) { - try { - const fetchAlbumResult = await userfilemgr.getPhotoAlbums(fetchOp); - const albumCountPass = await checkAssetsCount(done, testNum, fetchAlbumResult, expectAlbumCount); - if (!albumCountPass) return; - const album = await fetchAlbumResult.getFirstObject(); - const oldName = album.albumName; - const albumUri = album.albumUri; - const newName = 'newAlbumNamePromise'; - fetchAlbumResult.close(); - album.albumName = newName; - await album.commitModify(); - let predicates = new dataSharePredicates.DataSharePredicates(); - predicates.equalTo(userFileManager.AlbumKey.URI.toString(), albumUri); - let ops = { - predicates: predicates - }; - const newResult = await userfilemgr.getPhotoAlbums(ops); - const checkAlbumCountPass = await checkAssetsCount(done, testNum, newResult, expectAlbumCount); - if (!checkAlbumCountPass) return; - const newAlbum = await newResult.getFirstObject(); - expect(newAlbum.albumName).assertEqual(newName); - newAlbum.albumName = oldName; - await newAlbum.commitModify(); - done(); - } catch (error) { - console.info(`${testNum}, failed error: ${error}`) - expect(false).assertTrue(); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_ALBUM_COMMITMODIFY_PROMISE_01 - * @tc.name : commitModify - * @tc.desc : album modify albumname - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_ALBUM_COMMITMODIFY_PROMISE_01', 2, async function (done) { - const testNum = 'SUB_USERFILE_MGR_ALBUM_COMMITMODIFY_PROMISE_01'; - let currentFetchOp = albumFetchOps(testNum, 'Pictures/', 'DynamicPro'); - await albumCommitModify(done, testNum, currentFetchOp); - }); - }); -} - - diff --git a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/test/albumGetFileAssetsCallback.test.ets b/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/test/albumGetFileAssetsCallback.test.ets deleted file mode 100755 index 570bc3d7f..000000000 --- a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/test/albumGetFileAssetsCallback.test.ets +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; - -import { - sleep, - THROW_ERROR_CODE, - allFetchOp, - albumFetchOps, - checkPresetsAssets, - checkAssetsCount, -} from '../../../../../../common'; - -export default function albumGetFileAssetsCallback(abilityContext) { - describe('albumGetFileAssetsCallback', function () { - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - await checkPresetsAssets(userfilemgr, 'ActsUserFileMgrAlbumJsTest'); - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - const getPhotoAssetsTest = async function (done, testNum, fetchOp, expectAlbumCount = 1, expectAssetsCount = 1) { - try { - const fetchAlbumResult = await userfilemgr.getPhotoAlbums(fetchOp); - const albumCountPass = await checkAssetsCount(done, testNum, fetchAlbumResult, expectAlbumCount); - if (!albumCountPass) return; - const album = await fetchAlbumResult.getFirstObject(); - fetchAlbumResult.close(); - album.getPhotoAssets(allFetchOp(), (error, fetchAssetResult) => { - if (error != undefined) { - console.info(`${testNum} getPhotoAssets error: ${error}`); - expect(false).assertTrue(); - done(); - return; - } - console.info(`${testNum}, getCount: ${fetchAssetResult.getCount()} - expectAssetsCount: ${expectAssetsCount}`); - expect(fetchAssetResult.getCount()).assertEqual(expectAssetsCount); - fetchAssetResult.close(); - done(); - }); - } catch (error) { - console.info(`${testNum}, error: ${error}`); - expect(false).assertTrue(); - done(); - } - } - - const getPhotoAssetsErrCodeTest = async function (done, testNum, fetchOp, expectAlbumCount = 1, expectAssetsCount = 1) { - try { - const fetchAlbumResult = await userfilemgr.getPhotoAlbums(fetchOp); - const albumCountPass = await checkAssetsCount(done, testNum, fetchAlbumResult, expectAlbumCount); - if (!albumCountPass) return; - const album = await fetchAlbumResult.getFirstObject(); - fetchAlbumResult.close(); - let invalidOps : userFileManager.FetchOptions; - album.getPhotoAssets(invalidOps, (error, fetchAssetResult) => { - if (error != undefined) { - console.info(`${testNum} getPhotoAssetsErrCodeTest error: ${error}`); - expect(false).assertTrue(); - done(); - return; - } - expect(false).assertTrue(); - fetchAssetResult.close(); - done(); - }); - } catch (error) { - console.info(`${testNum}, errCode :${JSON.stringify(error)}`); - expect(error.code).assertEqual(THROW_ERROR_CODE.toString()); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_ALBUM_GETPHOTOASSETS_CALLBACK_01 - * @tc.name : getPhotoAssets - * @tc.desc : Album getPhotoAssets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('SUB_USERFILE_MGR_ALBUM_GETPHOTOASSETS_CALLBACK_01', 1, async function (done) { - const testNum = 'SUB_USERFILE_MGR_ALBUM_GETPHOTOASSETS_CALLBACK_01'; - let currentFetchOp = albumFetchOps(testNum, 'Pictures/', 'Static'); - await getPhotoAssetsTest(done, testNum, currentFetchOp); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_ALBUM_GETPHOTOASSETS_ERRCODE_CALLBACK_01 - * @tc.name : getPhotoAssets - * @tc.desc : invalid AlbumFetchOptions - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 3 - */ - it('SUB_USERFILE_MGR_ALBUM_GETPHOTOASSETS_ERRCODE_CALLBACK_01', 3, async function (done) { - const testNum = 'SUB_USERFILE_MGR_ALBUM_GETPHOTOASSETS_ERRCODE_CALLBACK_01'; - let currentFetchOp = albumFetchOps(testNum, 'Pictures/', 'Static'); - await getPhotoAssetsErrCodeTest(done, testNum, currentFetchOp); - }); - }); -} \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/test/albumGetFileAssetsPromise.test.ets b/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/test/albumGetFileAssetsPromise.test.ets deleted file mode 100755 index 33f6d71d9..000000000 --- a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/ets/test/albumGetFileAssetsPromise.test.ets +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; - -import { - sleep, - THROW_ERROR_CODE, - allFetchOp, - albumFetchOps, - checkPresetsAssets, - checkAssetsCount, -} from '../../../../../../common'; - -export default function albumGetFileAssetsPromise(abilityContext) { - describe('albumGetFileAssetsPromise', function () { - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - await checkPresetsAssets(userfilemgr, 'ActsUserFileMgrAlbumJsTest'); - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - const getPhotoAssetsTest = async function (done, testNum, fetchOp, expectAlbumCount = 1, expectAssetsCount = 1) { - try { - const fetchAlbumResult = await userfilemgr.getPhotoAlbums(fetchOp); - const albumCountPass = await checkAssetsCount(done, testNum, fetchAlbumResult, expectAlbumCount); - if (!albumCountPass) return; - const album = await fetchAlbumResult.getFirstObject(); - fetchAlbumResult.close(); - let op: userFileManager.FetchOptions = allFetchOp(); - let fetchAssetResult = await album.getPhotoAssets(op); - if (fetchAssetResult == undefined) { - expect(false).assertTrue(); - done(); - return; - } - console.info(`${testNum}, getCount: ${fetchAssetResult.getCount()} - expectAssetsCount: ${expectAssetsCount}`) - expect(fetchAssetResult.getCount()).assertEqual(expectAssetsCount); - fetchAssetResult.close(); - done(); - } catch (error) { - console.info(`${testNum}, error: ${error}`); - expect(false).assertTrue(); - done(); - } - } - - const getPhotoAssetsErrCodeTest = async function (done, testNum, fetchOp, expectAlbumCount = 1, expectAssetsCount = 1) { - try { - const fetchAlbumResult = await userfilemgr.getPhotoAlbums(fetchOp); - const albumCountPass = await checkAssetsCount(done, testNum, fetchAlbumResult, expectAlbumCount); - if (!albumCountPass) return; - const album = await fetchAlbumResult.getFirstObject(); - fetchAlbumResult.close(); - let invalidOps : userFileManager.FetchOptions; - let fetchAssetResult = await album.getPhotoAssets(invalidOps); - expect(false).assertTrue(); - fetchAssetResult.close(); - done(); - } catch (error) { - console.info(`${testNum}, errCode :${JSON.stringify(error)}`); - expect(error.code).assertEqual(THROW_ERROR_CODE.toString()); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_ALBUM_GETPHOTOASSETS_PROMISE_01 - * @tc.name : getPhotoAssets - * @tc.desc : Album getPhotoAssets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('SUB_USERFILE_MGR_ALBUM_GETPHOTOASSETS_PROMISE_01', 1, async function (done) { - const testNum = 'SUB_USERFILE_MGR_ALBUM_GETPHOTOASSETS_PROMISE_01'; - let currentFetchOp = albumFetchOps(testNum, 'Pictures/', 'Static'); - await getPhotoAssetsTest(done, testNum, currentFetchOp); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_ALBUM_GETPHOTOASSETS_ERRCODE_PROMISE_01 - * @tc.name : getPhotoAssets - * @tc.desc : invalid AlbumFetchOptions - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 3 - */ - it('SUB_USERFILE_MGR_ALBUM_GETPHOTOASSETS_ERRCODE_PROMISE_01', 3, async function (done) { - const testNum = 'SUB_USERFILE_MGR_ALBUM_GETPHOTOASSETS_ERRCODE_PROMISE_01'; - let currentFetchOp = albumFetchOps(testNum, 'Pictures/', 'Static'); - await getPhotoAssetsErrCodeTest(done, testNum, currentFetchOp); - }); - }); -} \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/module.json b/multimedia/userfilemgr/userfilemgr_album/entry/src/main/module.json deleted file mode 100755 index 0bb8c230e..000000000 --- a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/module.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:mainability_description", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default", - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "ohos.acts.multimedia.userfilemgr.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:mainability_description", - "icon": "$media:icon", - "label": "$string:entry_MainAbility", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities":[ - "entity.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.GET_BUNDLE_INFO", - "reason": "use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name" : "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", - "reason" : "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" - }, - { - "name" : "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", - "reason" : "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS" - }, - { - "name": "ohos.permission.MEDIA_LOCATION", - "reason":"use ohos.permission.MEDIA_LOCATION" - }, - { - "name": "ohos.permission.READ_IMAGEVIDEO", - "reason":"use ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.READ_AUDIO", - "reason":"use ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.READ_DOCUMENT", - "reason":"use ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.WRITE_IMAGEVIDEO", - "reason":"use ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.WRITE_AUDIO", - "reason":"use ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.WRITE_DOCUMENT", - "reason":"use ohos.permission.WRITE_MEDIA" - } - ] - } -} diff --git a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/resources/base/element/string.json b/multimedia/userfilemgr/userfilemgr_album/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 32237ee20..000000000 --- a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "MediaLibraryJSTestMain" - }, - { - "name": "mainability_description", - "value": "MediaLibraryJSTestMain Ability" - } - ] - } \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_album/entry/src/main/resources/base/media/icon.png b/multimedia/userfilemgr/userfilemgr_album/entry/src/main/resources/base/media/icon.png deleted file mode 100755 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=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%N&t$}k?w+``2A=aotj0;2v$~AL z{scF-cL{wsdrmPvf#a9OHyYLcwQD4Kcm)`LLwMh4WT~p29f7M!iafJSU`IV}QY5Wa z(n44-9oA}?J{a+ah*@31WTs#&J#o1`H98#6IQf;Wv0N_!);f&9g7o-k(lW5rWnDUR zQBFIRG+X=6NnsI@mxnwm;tf5;_Uxg?jZ8m-m0}&6+DA!qam(p$mN5R})yA_7m$q@| zFEd|dpS595rxQr-n#GjI5i-AhnUE>Cr;jpCqSrD~EwK_DqI^7%3#p5)%T_od!t3SOmH9MyXeeGO2(UQL;ax|x?Ncixmeo1=$ z{-);Au{*tfzOG?KQ~K|ak8-HQ?`Pekhe2WM(8s{xv-p>Zmu_6{G!-oE$7$mY`MOJorI=+mMx?H;`pr!;fVYz?5~yXBACruWB`Ph zZM}90_<^OBxIhyZ9BW$`>6JvO;%VFpqVr8|7t3~AmxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}y/storage/media/100/local/temp", - "./resource/medialibrary/01.mp3 ->/storage/media/100/local/temp", - "./resource/medialibrary/01.mp4 ->/storage/media/100/local/temp" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "mkdir -pv /storage/media/100/local/files/Pictures/{Static,onAsset,offAsset,onAlbum,offAlbum,myAlbum,deleteCb,deletePro}", - "mkdir -pv /storage/media/100/local/files/Videos/{Static,onAsset,offAsset,onAlbum,offAlbum,myAlbum,deleteCb,deletePro}", - "mkdir -pv /storage/media/100/local/files/Audios/{Static,onAsset,offAsset,onAlbum,offAlbum,myAlbum,deleteCb,deletePro}", - - "for d in Static; do for i in $$(seq 4); do cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/$$d/0$$i.jpg; done;done;", - "for d in Static; do for i in $$(seq 4); do cp /storage/media/100/local/temp/01.mp3 /storage/media/100/local/files/Audios/$$d/0$$i.mp3; done;done;", - "for d in Static; do for i in $$(seq 4); do cp /storage/media/100/local/temp/01.mp4 /storage/media/100/local/files/Videos/$$d/0$$i.mp4; done;done;", - "for d in deleteCb deletePro; do for i in $$(seq 2); do cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/$$d/0$$i.jpg; done;done;", - "for d in deleteCb deletePro; do for i in $$(seq 2); do cp /storage/media/100/local/temp/01.mp3 /storage/media/100/local/files/Audios/$$d/0$$i.mp3; done;done;", - "for d in deleteCb deletePro; do for i in $$(seq 2); do cp /storage/media/100/local/temp/01.mp4 /storage/media/100/local/files/Videos/$$d/0$$i.mp4; done;done;", - "for d in onAsset offAsset onAlbum offAlbum myAlbum; do for i in $$(seq 1); do cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/$$d/0$$i.jpg; done;done;", - "for d in onAsset offAsset onAlbum offAlbum myAlbum; do for i in $$(seq 1); do cp /storage/media/100/local/temp/01.mp3 /storage/media/100/local/files/Audios/$$d/0$$i.mp3; done;done;", - "for d in onAsset offAsset onAlbum offAlbum myAlbum; do for i in $$(seq 1); do cp /storage/media/100/local/temp/01.mp4 /storage/media/100/local/files/Videos/$$d/0$$i.mp4; done;done;", - - "chmod -R 777 /storage/media/100/local/files/*", - "chmod -R 777 /data/service/el2/100/hmdfs/account/files/*", - "hilog -Q pidoff", - "hilog -p off", - "hilog -b I", - "hilog -b D -D 0xD002B70", - "scanner", - "sleep 10" - ], - "teardown-command":[ - "hilog -b X -D 0xD002B70" - ] - }, - { - "test-file-name": [ - "ActsUserFileMgrBaseJsTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/Application/AbilityStage.ts b/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index cbcc939ff..000000000 --- a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,9 +0,0 @@ -import AbilityStage from "@ohos.app.ability.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} diff --git a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/MainAbility/MainAbility.ts b/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 266fcd859..000000000 --- a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,36 +0,0 @@ -import Ability from '@ohos.app.ability.UIAbility' - -export default class MainAbility extends Ability { - onCreate(want,launchParam){ - // Ability is creating, initialize resources for this ability - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - //Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/pages/index/index.ets b/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/pages/index/index.ets deleted file mode 100755 index 624cad290..000000000 --- a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/pages/index/index.ets +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import file from '@system.file'; - -import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index" -import testsuite from "../../test/List.test.ets" - -@Entry -@Component -struct Index { - - aboutToAppear(){ - - console.info("start run testcase!!!!") - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - const reportExtend = new ReportExtend(file) - - core.addService('report', reportExtend) - core.init() - core.subscribeEvent('task', reportExtend) - const configService = core.getDefaultService('config') - console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters)) - globalThis.abilityWant.parameters.timeout = 70000; - configService.setConfig(globalThis.abilityWant.parameters) - console.info('testsuite()---->') - testsuite(globalThis.abilityContext) - core.execute() - console.info('core.execute()---->') - } - - build() { - Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World') - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(25) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/pages/second/second.ets b/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/pages/second/second.ets deleted file mode 100755 index 1c1c727ff..000000000 --- a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/pages/second/second.ets +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import router from '@system.router'; - -@Entry -@Component -struct Second { - private content: string = "Second Page" - - build() { - Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text(`${this.content}`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('back to index') - .fontSize(20) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - router.back() - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/List.test.ets b/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/List.test.ets deleted file mode 100755 index 0fc8409e4..000000000 --- a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import deleteCallbackTest from './deleteCallback.test.ets' -import deletePromiseTest from './deletePromise.test.ets' -import getAlbumsCallbackTest from './getAlbumsCallback.test.ets' -import getAlbumsPromiseTest from './getAlbumsPromise.test.ets' -import getFileAssetsCallbackTest from './getFileAssetsCallback.test.ets' -import getFileAssetsPromiseTest from './getFileAssetsPromise.test.ets' -import getUserFileMgrTest from './getUserFileMgr.test.ets' -import onOffReleasePromiseTest from './onOffReleasePromise.test.ets' -export default function testsuite(abilityContext) { - deleteCallbackTest(abilityContext) - deletePromiseTest(abilityContext) - getAlbumsCallbackTest(abilityContext) - getAlbumsPromiseTest(abilityContext) - getFileAssetsCallbackTest(abilityContext) - getFileAssetsPromiseTest(abilityContext) - getUserFileMgrTest(abilityContext) - onOffReleasePromiseTest(abilityContext) -} diff --git a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/deleteCallback.test.ets b/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/deleteCallback.test.ets deleted file mode 100644 index 3c523b554..000000000 --- a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/deleteCallback.test.ets +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; - -import { - sleep, - audioFetchOps, - imageVideoFetchOps, - checkPresetsAssets, - checkAssetsCount, - getPermission, -} from '../../../../../../common'; - - -export default function deleteCallbackTest(abilityContext) { - describe('deleteCallbackTest', function () { - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - await getPermission(); - await checkPresetsAssets(userfilemgr, 'ActsUserFileMgrAlbumJsTest'); - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - const deleteTest = async function (done, testNum, fetchOp, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let expectCount = 2; - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectCount); - if (!checkAssetCountPass) return; - const asset = await fetchAssetResult.getFirstObject(); - fetchAssetResult.close(); - userfilemgr.delete(asset.uri, async() => { - let newFetchResult; - if (isAudio) { - newFetchResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - newFetchResult = await userfilemgr.getPhotoAssets(fetchOp); - } - expect(newFetchResult.getCount()).assertEqual(1); - newFetchResult.close(); - done(); - }); - } catch (error) { - console.info(`${testNum}, failed: ${error}`); - expect(false).assertTrue(); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_DELETE_CALLBACK_01 - * @tc.name : delete - * @tc.desc : delete image - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_DELETE_CALLBACK_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_DELETE_CALLBACK_01'; - let currentFetchOp = imageVideoFetchOps(testNum, 'Pictures/deleteCb/'); - let isAudio = false; - await deleteTest(done, testNum, currentFetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_DELETE_CALLBACK_02 - * @tc.name : delete - * @tc.desc : delete video - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_DELETE_CALLBACK_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_DELETE_CALLBACK_02'; - let currentFetchOp = imageVideoFetchOps(testNum, 'Videos/deleteCb/'); - let isAudio = false; - await deleteTest(done, testNum, currentFetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_DELETE_CALLBACK_03 - * @tc.name : delete - * @tc.desc : delete audio - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_DELETE_CALLBACK_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_DELETE_CALLBACK_03'; - let currentFetchOp = audioFetchOps(testNum, 'Audios/deleteCb/'); - let isAudio = true; - await deleteTest(done, testNum, currentFetchOp, isAudio); - }); - }); -} - - diff --git a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/deletePromise.test.ets b/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/deletePromise.test.ets deleted file mode 100644 index 71f3dcd6d..000000000 --- a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/deletePromise.test.ets +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; - -import { - sleep, - audioFetchOps, - imageVideoFetchOps, - checkPresetsAssets, - checkAssetsCount, -} from '../../../../../../common'; - - -export default function deletePromiseTest(abilityContext) { - describe('deletePromiseTest', function () { - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - await checkPresetsAssets(userfilemgr, 'ActsUserFileMgrAlbumJsTest'); - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - const deleteTest = async function (done, testNum, fetchOp, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let expectCount = 2; - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectCount); - if (!checkAssetCountPass) return; - let asset = await fetchAssetResult.getFirstObject(); - fetchAssetResult.close(); - await userfilemgr.delete(asset.uri); - let newFetchResult; - if (isAudio) { - newFetchResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - newFetchResult = await userfilemgr.getPhotoAssets(fetchOp); - } - expect(newFetchResult.getCount()).assertEqual(1); - newFetchResult.close(); - done(); - } catch (error) { - console.info(`${testNum}, failed: ${error}`); - expect(false).assertTrue(); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_DELETE_PROMISE_01 - * @tc.name : delete - * @tc.desc : delete image - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_DELETE_PROMISE_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_DELETE_PROMISE_01'; - let currentFetchOp = imageVideoFetchOps(testNum, 'Pictures/deletePro/'); - let isAudio = false; - await deleteTest(done, testNum, currentFetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_DELETE_PROMISE_02 - * @tc.name : delete - * @tc.desc : delete video - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_DELETE_PROMISE_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_DELETE_PROMISE_02'; - let currentFetchOp = imageVideoFetchOps(testNum, 'Videos/deletePro/'); - let isAudio = false; - await deleteTest(done, testNum, currentFetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_DELETE_PROMISE_03 - * @tc.name : delete - * @tc.desc : delete audio - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_DELETE_PROMISE_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_DELETE_PROMISE_03'; - let currentFetchOp = audioFetchOps(testNum, 'Audios/deletePro/'); - let isAudio = true; - await deleteTest(done, testNum, currentFetchOp, isAudio); - }); - }); -} - - diff --git a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/getAlbumsCallback.test.ets b/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/getAlbumsCallback.test.ets deleted file mode 100644 index 7b9d66e7e..000000000 --- a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/getAlbumsCallback.test.ets +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; - -import { - sleep, - THROW_ERROR_CODE, - albumFetchOps, - checkPresetsAssets, - checkAssetsCount, - isNum, -} from '../../../../../../common'; - - -export default function getAlbumsCallbackTest(abilityContext) { - describe('getAlbumsCallbackTest', function () { - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - await checkPresetsAssets(userfilemgr, 'ActsUserFileMgrAlbumJsTest'); - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - function printAlbumMessage(testNum, album) { - console.info(`${testNum} - album.albumName: ${album.albumName} - album.albumUri: ${album.albumUri} - album.dateModified: ${album.dateModified} - album.count: ${album.count} - album.relativePath: ${album.relativePath} - album.coverUri: ${album.coverUri}`); - } - - const props = { - albumName: 'myAlbum', - albumUri: 'datashare:///userfilemgr/album/', - count: 1 - } - const checkProps = async function (done, testNum, album, relativePaths) { - printAlbumMessage(testNum, album); - if (album.coverUri == undefined) { - console.info(`${testNum}, album.coverUri is undefined`); - expect(false).assertTrue(); - done(); - return; - } - expect(album.albumName).assertEqual(props.albumName); - expect(album.count).assertEqual(props.count); - expect(isNum(album.dateModified)).assertTrue(); - if (Array.isArray(relativePaths)) { - let i = relativePaths.indexOf(album.relativePath); - if (i > -1) { - relativePaths.splice(i, 1) - } else { - expect(false).assertTrue(); - done(); - } - } else { - expect(album.relativePath).assertEqual(relativePaths); - } - } - const checkAlbumInfo = async function (done, testNum, fetchOp, relativePaths) { - try { - userfilemgr.getPhotoAlbums(fetchOp, async (err, fetchAlbumResult) => { - if(err) { - console.info(`${testNum} getPhotoAlbums err: ${err}`) - expect(false).assertTrue(); - done(); - return; - } - let expectAlbumCount = 1; - const albumCountPass = await checkAssetsCount(done, testNum, fetchAlbumResult, expectAlbumCount); - if (!albumCountPass) return; - const album = await fetchAlbumResult.getFirstObject(); - checkProps(done, testNum, album, relativePaths); - fetchAlbumResult.close(); - done(); - }); - } catch (error) { - console.info(`${testNum}, failed: ${error}`); - expect(false).assertTrue(); - done(); - } - } - - const getPhotoAlbumsErrCodeTest = async function (done, testNum) { - try { - let invalidOps : userFileManager.FetchOptions; - userfilemgr.getPhotoAlbums(invalidOps, async (err, fetchAlbumResult) => { - if(err) { - console.info(`${testNum} getPhotoAlbums err: ${err}`) - expect(false).assertTrue(); - done(); - return; - } - expect(false).assertTrue(); - fetchAlbumResult.close(); - done(); - }); - } catch (error) { - console.info(`${testNum}, errCode :${JSON.stringify(error)}`); - expect(error.code).assertEqual(THROW_ERROR_CODE.toString()); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOALBUMS_CALLBACK_01 - * @tc.name : getPhotoAlbums - * @tc.desc : getPhotoAlbums by relativePath && albumName, print all album info - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('SUB_USERFILE_MGR_GETPHOTOALBUMS_CALLBACK_01', 1, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOALBUMS_CALLBACK_01'; - let currentFetchOp = albumFetchOps(testNum, 'Pictures/', 'myAlbum'); - let relativePaths = 'Pictures/'; - await checkAlbumInfo(done, testNum, currentFetchOp, relativePaths); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOALBUMS_ERRCODE_CALLBACK_01 - * @tc.name : getPhotoAlbums - * @tc.desc : getPhotoAlbums by invalid - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 3 - */ - it('SUB_USERFILE_MGR_GETPHOTOALBUMS_ERRCODE_CALLBACK_01', 3, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOALBUMS_ERRCODE_CALLBACK_01'; - await getPhotoAlbumsErrCodeTest(done, testNum); - }); - }); -} - - diff --git a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/getAlbumsPromise.test.ets b/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/getAlbumsPromise.test.ets deleted file mode 100644 index 2e6733aa1..000000000 --- a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/getAlbumsPromise.test.ets +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; - -import { - sleep, - THROW_ERROR_CODE, - albumFetchOps, - checkPresetsAssets, - checkAssetsCount, -} from '../../../../../../common'; - -export default function getAlbumsPromiseTest(abilityContext) { - describe('getAlbumsPromiseTest', function () { - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - await checkPresetsAssets(userfilemgr, 'ActsUserFileMgrAlbumJsTest'); - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - function printAlbumMessage(testNum, album) { - console.info(`${testNum} - album.albumName: ${album.albumName} - album.albumUri: ${album.albumUri} - album.dateModified: ${album.dateModified} - album.count: ${album.count} - album.relativePath: ${album.relativePath} - album.coverUri: ${album.coverUri}`); - } - - const props = { - albumName: 'myAlbum', - albumUri: 'datashare:///userfilemgr/album/', - count: 1 - } - const checkProps = async function (done, testNum, album, relativePaths) { - printAlbumMessage(testNum, album); - if (album.coverUri == undefined) { - console.info(`${testNum}, album.coverUri is undefined`); - expect(false).assertTrue(); - done(); - return; - } - expect(album.albumName).assertEqual(props.albumName); - expect(album.count).assertEqual(props.count); - if (Array.isArray(relativePaths)) { - let i = relativePaths.indexOf(album.relativePath); - if (i > -1) { - relativePaths.splice(i, 1) - } else { - expect(false).assertTrue(); - done(); - } - } else { - expect(album.relativePath).assertEqual(relativePaths); - } - } - const checkAlbumInfo = async function (done, testNum, fetchOp, relativePaths, expectAlbumCount = 1) { - try { - const fetchAlbumResult = await userfilemgr.getPhotoAlbums(fetchOp); - const albumCountPass = await checkAssetsCount(done, testNum, fetchAlbumResult, expectAlbumCount); - if (!albumCountPass) return; - const album = await fetchAlbumResult.getFirstObject(); - checkProps(done, testNum, album, relativePaths); - fetchAlbumResult.close(); - done(); - } catch (error) { - console.info(`${testNum}, failed: ${error}`); - expect(false).assertTrue(); - done(); - } - } - - const getPhotoAlbumsErrCodeTest = async function (done, testNum) { - try { - let invalidOps : userFileManager.FetchOptions; - let fetchAlbumResult = await userfilemgr.getPhotoAlbums(invalidOps); - expect(false).assertTrue(); - fetchAlbumResult.close(); - done(); - } catch (error) { - console.info(`${testNum}, errCode :${JSON.stringify(error)}`); - expect(error.code).assertEqual(THROW_ERROR_CODE.toString()); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOALBUMS_PROMISE_01 - * @tc.name : getPhotoAlbums - * @tc.desc : getPhotoAlbums by relativePath && albumName, print all album info - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('SUB_USERFILE_MGR_GETPHOTOALBUMS_PROMISE_01', 1, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOALBUMS_PROMISE_01'; - let currentFetchOp = albumFetchOps(testNum, 'Pictures/', 'myAlbum'); - let relativePaths = 'Pictures/'; - await checkAlbumInfo(done, testNum, currentFetchOp, relativePaths); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOALBUMS_ERRCODE_PROMISE_01 - * @tc.name : getPhotoAlbums - * @tc.desc : getPhotoAlbums by invalid - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 3 - */ - it('SUB_USERFILE_MGR_GETPHOTOALBUMS_ERRCODE_PROMISE_01', 3, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOALBUMS_ERRCODE_PROMISE_01'; - await getPhotoAlbumsErrCodeTest(done, testNum); - }); - }); -} - - diff --git a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/getFileAssetsCallback.test.ets b/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/getFileAssetsCallback.test.ets deleted file mode 100644 index bceebef1d..000000000 --- a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/getFileAssetsCallback.test.ets +++ /dev/null @@ -1,683 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; -import { - sleep, - IMAGE_TYPE, - VIDEO_TYPE, - AUDIO_TYPE, - THROW_ERROR_CODE, - audioFetchOps, - imageVideoFetchOps, - checkPresetsAssets, - checkAssetsCount, -} from '../../../../../../common'; - - -export default function getFileAssetsCallbackTest(abilityContext) { - describe('getFileAssetsCallbackTest', function () { - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - await checkPresetsAssets(userfilemgr, 'ActsUserFileMgrBaseJsTest'); - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep(500) - }); - afterAll(function () { - console.info('afterAll case'); - }); - - const props = { - image: { - displayName: '01.jpg', - fileType: IMAGE_TYPE.toString(), - }, - video: { - displayName: '01.mp4', - fileType: VIDEO_TYPE.toString(), - }, - audio: { - displayName: '01.mp3', - fileType: AUDIO_TYPE.toString(), - }, - } - - async function getFirstObjectTest(done, testNum, fetchOp, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let expectCount = 4; - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectCount); - if (!checkAssetCountPass) return; - fetchAssetResult.getFirstObject(async (err, asset) => { - if (err) { - console.info(`${testNum} err : ${err}`) - expect().assertFail(); - fetchAssetResult.close(); - done(); - return; - } - expect(asset != undefined).assertTrue(); - fetchAssetResult.close(); - }); - done(); - } catch (error) { - console.info(`${testNum}:: error :${error}`); - expect(false).assertTrue(); - done(); - } - } - - async function getNextObjectTest(done, testNum, fetchOp, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let expectCount = 4; - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectCount); - if (!checkAssetCountPass) return; - await fetchAssetResult.getFirstObject(); - fetchAssetResult.getNextObject(async (err, asset) => { - if (err) { - console.info(`${testNum} err : ${err}`) - expect().assertFail(); - fetchAssetResult.close(); - done(); - return; - } - expect(asset != undefined).assertTrue(); - fetchAssetResult.close(); - }); - done(); - } catch (error) { - console.info(`${testNum}:: error :${error}`); - expect(false).assertTrue(); - done(); - } - } - - async function getLastObjectTest(done, testNum, fetchOp, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let expectCount = 4; - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectCount); - if (!checkAssetCountPass) return; - fetchAssetResult.getLastObject(async (err, asset) => { - if (err) { - console.info(`${testNum} err : ${err}`) - expect().assertFail(); - fetchAssetResult.close(); - done(); - return; - } - expect(asset != undefined).assertTrue(); - fetchAssetResult.close(); - }); - done(); - } catch (error) { - console.info(`${testNum}:: error :${error}`); - expect(false).assertTrue(); - done(); - } - } - - async function getPositionObjectTest(done, testNum, fetchOp, pos, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let expectCount = 4; - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectCount); - if (!checkAssetCountPass) return; - fetchAssetResult.getPositionObject(pos, async (err, asset) => { - if (err) { - console.info(`${testNum} err : ${err}`) - expect().assertFail(); - fetchAssetResult.close(); - done(); - return; - } - expect(asset != undefined).assertTrue(); - fetchAssetResult.close(); - }); - done(); - } catch (error) { - console.info(`${testNum}:: error :${error}`); - expect(false).assertTrue(); - done(); - } - } - - async function isAfterLastTest(done, testNum, fetchOp, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let expectCount = 4; - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectCount); - if (!checkAssetCountPass) return; - let asset = await fetchAssetResult.getFirstObject(); - for (var i = 1; i < expectCount; i++) { - asset = await fetchAssetResult.getNextObject(); - if (i == expectCount - 1) { - let result = fetchAssetResult.isAfterLast(); - expect(result).assertTrue(); - fetchAssetResult.close(); - done(); - } - } - done(); - } catch (error) { - console.info(`${testNum} error ${error}`); - expect(false).assertTrue(); - done(); - } - } - - async function fetchResultCloseTest(done, testNum, fetchOp, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let expectCount = 4; - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectCount); - if (!checkAssetCountPass) return; - fetchAssetResult.close(); - let count = 0; - try { - fetchAssetResult.getCount(); - } catch { count++ } - try { - await fetchAssetResult.getFirstObject(); - } catch { count++ } - try { - await fetchAssetResult.getNextObject(); - } catch { count++ } - try { - await fetchAssetResult.getLastObject(); - } catch { count++ } - try { - await fetchAssetResult.getPositionObject(0); - } catch { count++ } - await sleep(1000) - expect(count).assertEqual(5); - done(); - } catch (error) { - console.info(`${testNum} error ${error}`); - expect(false).assertTrue(); - done(); - } - } - - async function checkFileAssetAttr(done, testNum, fetchOp, type, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let expectCount = 4; - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectCount); - if (!checkAssetCountPass) return; - fetchAssetResult.getFirstObject((err, asset) => { - if (err) { - console.info(`${testNum} err : ${err}`) - expect().assertFail(); - fetchAssetResult.close(); - done(); - return; - } - expect(asset.displayName).assertEqual(props[type].displayName); - expect(asset.fileType.toString()).assertEqual(props[type].fileType); - expect(asset.uri != undefined).assertTrue(); - fetchAssetResult.close(); - done(); - }); - } catch (error) { - console.info(`${testNum}:: error :${error}`); - expect(false).assertTrue(); - done(); - } - } - - async function getFileAssetsErrCodeTest(done, testNum, isAudio) { - try { - let invalidOps : userFileManager.FetchOptions; - if (isAudio) { - await userfilemgr.getAudioAssets(invalidOps, (err, fetchAssetResult) => { - if (err != undefined) { - console.info(`${testNum}:: getAudioAssets error :${err}`); - expect(false).assertTrue(); - done(); - return; - } - expect(false).assertTrue(); - done(); - }) - } else { - await userfilemgr.getPhotoAssets(invalidOps, (err, fetchAssetResult) => { - if (err != undefined) { - console.info(`${testNum}:: getAudioAssets error :${err}`); - expect(false).assertTrue(); - done(); - return; - } - expect(false).assertTrue(); - done(); - }) - } - } catch (error) { - console.info(`${testNum}:: errCode :${JSON.stringify(error)}`); - expect(error.code).assertEqual(THROW_ERROR_CODE.toString()); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_GETFIRSTOBJECT_CALLBACK_01 - * @tc.name : getFirstObject - * @tc.desc : getFirstObject query image assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETFIRSTOBJECT_CALLBACK_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETFIRSTOBJECT_CALLBACK_01'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Pictures/Static/'); - let isAudio = false; - await getFirstObjectTest(done, testNum, currentFetchOps, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETFIRSTOBJECT_CALLBACK_02 - * @tc.name : getFirstObject - * @tc.desc : getFirstObject query video assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETFIRSTOBJECT_CALLBACK_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETFIRSTOBJECT_CALLBACK_02'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Videos/Static/'); - let isAudio = false; - await getFirstObjectTest(done, testNum, currentFetchOps, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETFIRSTOBJECT_CALLBACK_03 - * @tc.name : getFirstObject - * @tc.desc : getFirstObject query audio assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETFIRSTOBJECT_CALLBACK_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETFIRSTOBJECT_CALLBACK_03'; - let currentFetchOps = audioFetchOps(testNum, 'Audios/Static/'); - let isAudio = true; - await getFirstObjectTest(done, testNum, currentFetchOps, isAudio); - }); - - //------------------------------------------------------------------------------ - - /** - * @tc.number : SUB_USERFILE_MGR_GETNEXTOBJECT_CALLBACK_01 - * @tc.name : getNextObject - * @tc.desc : getNextObject query image assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETNEXTOBJECT_CALLBACK_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETNEXTOBJECT_CALLBACK_01'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Pictures/Static/'); - let isAudio = false; - await getNextObjectTest(done, testNum, currentFetchOps, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETNEXTOBJECT_CALLBACK_02 - * @tc.name : getNextObject - * @tc.desc : getNextObject query video assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETNEXTOBJECT_CALLBACK_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETNEXTOBJECT_CALLBACK_02'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Videos/Static/'); - let isAudio = false; - await getNextObjectTest(done, testNum, currentFetchOps, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETNEXTOBJECT_CALLBACK_03 - * @tc.name : getNextObject - * @tc.desc : getNextObject query audio assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETNEXTOBJECT_CALLBACK_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETNEXTOBJECT_CALLBACK_03'; - let currentFetchOps = audioFetchOps(testNum, 'Audios/Static/'); - let isAudio = true; - await getNextObjectTest(done, testNum, currentFetchOps, isAudio); - }); - - //------------------------------------------------------------------------------ - - /** - * @tc.number : SUB_USERFILE_MGR_GETLASTOBJECT_CALLBACK_01 - * @tc.name : getLastObject - * @tc.desc : getLastObject query image assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETLASTOBJECT_CALLBACK_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETLASTOBJECT_CALLBACK_01'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Pictures/Static/'); - let isAudio = false; - await getLastObjectTest(done, testNum, currentFetchOps, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETLASTOBJECT_CALLBACK_02 - * @tc.name : getLastObject - * @tc.desc : getLastObject query video assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETLASTOBJECT_CALLBACK_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETLASTOBJECT_CALLBACK_02'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Videos/Static/'); - let isAudio = false; - await getLastObjectTest(done, testNum, currentFetchOps, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETLASTOBJECT_CALLBACK_03 - * @tc.name : getLastObject - * @tc.desc : getLastObject query audio assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETLASTOBJECT_CALLBACK_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETLASTOBJECT_CALLBACK_03'; - let currentFetchOps = audioFetchOps(testNum, 'Audios/Static/'); - let isAudio = true; - await getLastObjectTest(done, testNum, currentFetchOps, isAudio); - }); - - //------------------------------------------------------------------------------ - - /** - * @tc.number : SUB_USERFILE_MGR_GETPOSITIONOBJECT_CALLBACK_01 - * @tc.name : getPositionObject - * @tc.desc : getPositionObject query image assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPOSITIONOBJECT_CALLBACK_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPOSITIONOBJECT_CALLBACK_01'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Pictures/Static/'); - let pos = 0; - let isAudio = false; - await getPositionObjectTest(done, testNum, currentFetchOps, pos, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPOSITIONOBJECT_CALLBACK_02 - * @tc.name : getPositionObject - * @tc.desc : getPositionObject query video assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPOSITIONOBJECT_CALLBACK_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPOSITIONOBJECT_CALLBACK_02'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Videos/Static/'); - let pos = 0; - let isAudio = false; - await getPositionObjectTest(done, testNum, currentFetchOps, pos, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPOSITIONOBJECT_CALLBACK_03 - * @tc.name : getPositionObject - * @tc.desc : getPositionObject query audio assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPOSITIONOBJECT_CALLBACK_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPOSITIONOBJECT_CALLBACK_03'; - let currentFetchOps = audioFetchOps(testNum, 'Audios/Static/'); - let pos = 0; - let isAudio = true; - await getPositionObjectTest(done, testNum, currentFetchOps, pos, isAudio); - }); - - //----------------------------------------------------------------------------------- - - /** - * @tc.number : SUB_USERFILE_MGR_ISAFTERLAST_CALLBACK_01 - * @tc.name : isAfterLast - * @tc.desc : isAfterLast query image assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_ISAFTERLAST_CALLBACK_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_ISAFTERLAST_CALLBACK_01'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Pictures/Static/'); - let isAudio = false; - await isAfterLastTest(done, testNum, currentFetchOps, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_ISAFTERLAST_CALLBACK_02 - * @tc.name : isAfterLast - * @tc.desc : isAfterLast query video assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_ISAFTERLAST_CALLBACK_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_ISAFTERLAST_CALLBACK_02'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Videos/Static/'); - let isAudio = false; - await isAfterLastTest(done, testNum, currentFetchOps, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_ISAFTERLAST_CALLBACK_03 - * @tc.name : isAfterLast - * @tc.desc : isAfterLast query audio assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_ISAFTERLAST_CALLBACK_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_ISAFTERLAST_CALLBACK_03'; - let currentFetchOps = audioFetchOps(testNum, 'Audios/Static/'); - let isAudio = true; - await isAfterLastTest(done, testNum, currentFetchOps, isAudio); - }); - - - //------------------------------------------------------------------------------ - - /** - * @tc.number : SUB_USERFILE_MGR_FETCHRESULT_CLOSE_CALLBACK_01 - * @tc.name : close - * @tc.desc : when fetchResult close,fetchResult getAsset is undefined? - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FETCHRESULT_CLOSE_CALLBACK_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FETCHRESULT_CLOSE_CALLBACK_01'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Pictures/Static/'); - let isAudio = false; - await fetchResultCloseTest(done, testNum, currentFetchOps, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FETCHRESULT_CLOSE_CALLBACK_02 - * @tc.name : close - * @tc.desc : when fetchResult close,fetchResult getAsset is undefined? - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FETCHRESULT_CLOSE_CALLBACK_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FETCHRESULT_CLOSE_CALLBACK_02'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Videos/Static/'); - let isAudio = false; - await fetchResultCloseTest(done, testNum, currentFetchOps, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FETCHRESULT_CLOSE_CALLBACK_03 - * @tc.name : close - * @tc.desc : when fetchResult close,fetchResult getAsset is undefined? - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FETCHRESULT_CLOSE_CALLBACK_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FETCHRESULT_CLOSE_CALLBACK_03'; - let currentFetchOps = audioFetchOps(testNum, 'Audios/Static/'); - let isAudio = true; - await fetchResultCloseTest(done, testNum, currentFetchOps, isAudio); - }); - - - //------------------------------------------------------------------------------ - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETS_CALLBACK_01 - * @tc.name : getPhotoAssets - * @tc.desc : query image assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETS_CALLBACK_01', 1, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETS_CALLBACK_01'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Pictures/Static/'); - let type = 'image'; - let isAudio = false; - await checkFileAssetAttr(done, testNum, currentFetchOps, type, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETS_CALLBACK_02 - * @tc.name : getPhotoAssets - * @tc.desc : query video assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETS_CALLBACK_02', 1, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETS_CALLBACK_02'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Videos/Static/'); - let type = 'video'; - let isAudio = false; - await checkFileAssetAttr(done, testNum, currentFetchOps, type, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETS_CALLBACK_03 - * @tc.name : getAudioAssets - * @tc.desc : query audio assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETS_CALLBACK_03', 1, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETS_CALLBACK_03'; - let currentFetchOps = audioFetchOps(testNum, 'Audios/Static/'); - let type = 'audio'; - let isAudio = true; - await checkFileAssetAttr(done, testNum, currentFetchOps, type, isAudio); - }); - - //------------------------------------------------------------------------------ - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETS_ERRCODE_CALLBACK_01 - * @tc.name : getPhotoAssets - * @tc.desc : invalid FetchOptions - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 3 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETS_ERRCODE_CALLBACK_01', 3, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETS_ERRCODE_CALLBACK_01'; - let isAudio = false; - await getFileAssetsErrCodeTest(done, testNum, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETAUDIOASSETS_ERRCODE_CALLBACK_01 - * @tc.name : getPhotoAssets - * @tc.desc : invalid FetchOptions - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 3 - */ - it('SUB_USERFILE_MGR_GETAUDIOASSETS_ERRCODE_CALLBACK_01', 3, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETAUDIOASSETS_ERRCODE_CALLBACK_01'; - let isAudio = true; - await getFileAssetsErrCodeTest(done, testNum, isAudio); - }); - }); -} - diff --git a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/getFileAssetsPromise.test.ets b/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/getFileAssetsPromise.test.ets deleted file mode 100644 index b4c608ee6..000000000 --- a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/getFileAssetsPromise.test.ets +++ /dev/null @@ -1,463 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; -import { - sleep, - IMAGE_TYPE, - VIDEO_TYPE, - AUDIO_TYPE, - THROW_ERROR_CODE, - checkPresetsAssets, - checkAssetsCount, - audioFetchOps, - imageVideoFetchOps, -} from '../../../../../../common'; - - -export default function getFileAssetsPromiseTest(abilityContext) { - describe('getFileAssetsPromiseTest', function () { - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - await checkPresetsAssets(userfilemgr, 'ActsUserFileMgrBaseJsTest'); - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep(500) - }); - afterAll(function () { - console.info('afterAll case'); - }); - - const props = { - image: { - displayName: '01.jpg', - fileType: IMAGE_TYPE.toString(), - }, - video: { - displayName: '01.mp4', - fileType: VIDEO_TYPE.toString(), - }, - audio: { - displayName: '01.mp3', - fileType: AUDIO_TYPE.toString(), - }, - } - - async function getFirstObjectTest(done, testNum, fetchOp, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let expectCount = 4; - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectCount); - if (!checkAssetCountPass) return; - let asset = await fetchAssetResult.getFirstObject(); - expect(asset != undefined).assertTrue(); - fetchAssetResult.close(); - done(); - } catch (error) { - console.info(`${testNum}:: error :${error}`); - expect(false).assertTrue(); - done(); - } - } - - async function getNextObjectTest(done, testNum, fetchOp, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let expectCount = 4; - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectCount); - if (!checkAssetCountPass) return; - await fetchAssetResult.getFirstObject(); - let asset = await fetchAssetResult.getNextObject(); - expect(asset != undefined).assertTrue(); - fetchAssetResult.close(); - done(); - } catch (error) { - console.info(`${testNum}:: error :${error}`); - expect(false).assertTrue(); - done(); - } - } - - async function getLastObjectTest(done, testNum, fetchOp, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let expectCount = 4; - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectCount); - if (!checkAssetCountPass) return; - let asset = await fetchAssetResult.getLastObject(); - expect(asset != undefined).assertTrue(); - fetchAssetResult.close(); - done(); - } catch (error) { - console.info(`${testNum}:: error :${error}`); - expect(false).assertTrue(); - done(); - } - } - - async function getPositionObjectTest(done, testNum, fetchOp, pos, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let expectCount = 4; - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectCount); - if (!checkAssetCountPass) return; - let asset = await fetchAssetResult.getPositionObject(pos); - expect(asset != undefined).assertTrue(); - fetchAssetResult.close(); - done(); - } catch (error) { - console.info(`${testNum}:: error :${error}`); - expect(false).assertTrue(); - done(); - } - } - - async function checkFileAssetAttr(done, testNum, fetchOp, type, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let expectCount = 4; - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectCount); - if (!checkAssetCountPass) return; - let asset = await fetchAssetResult.getFirstObject(); - expect(asset.displayName).assertEqual(props[type].displayName); - expect(asset.fileType.toString()).assertEqual(props[type].fileType); - expect(asset.uri != undefined).assertTrue(); - fetchAssetResult.close(); - done(); - } catch (error) { - console.info(`${testNum}:: error :${error}`); - expect(false).assertTrue(); - done(); - } - } - - async function getFileAssetsErrCodeTest(done, testNum, isAudio) { - try { - let invalidOps : userFileManager.FetchOptions; - if (isAudio) { - await userfilemgr.getAudioAssets(invalidOps); - } else { - await userfilemgr.getPhotoAssets(invalidOps); - } - expect(false).assertTrue(); - } catch (error) { - console.info(`${testNum}:: errCode :${JSON.stringify(error)}`); - expect(error.code).assertEqual(THROW_ERROR_CODE.toString()); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_GETFIRSTOBJECT_PROMISE_01 - * @tc.name : getFirstObject - * @tc.desc : getFirstObject query image assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETFIRSTOBJECT_PROMISE_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETFIRSTOBJECT_PROMISE_01'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Pictures/Static/'); - let isAudio = false; - await getFirstObjectTest(done, testNum, currentFetchOps, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETFIRSTOBJECT_PROMISE_02 - * @tc.name : getFirstObject - * @tc.desc : getFirstObject query video assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETFIRSTOBJECT_PROMISE_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETFIRSTOBJECT_PROMISE_02'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Videos/Static/'); - let isAudio = false; - await getFirstObjectTest(done, testNum, currentFetchOps, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETFIRSTOBJECT_PROMISE_03 - * @tc.name : getFirstObject - * @tc.desc : getFirstObject query audio assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETFIRSTOBJECT_PROMISE_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETFIRSTOBJECT_PROMISE_03'; - let currentFetchOps = audioFetchOps(testNum, 'Audios/Static/'); - let isAudio = true; - await getFirstObjectTest(done, testNum, currentFetchOps, isAudio); - }); - - //------------------------------------------------------------------------------ - - /** - * @tc.number : SUB_USERFILE_MGR_GETNEXTOBJECT_PROMISE_01 - * @tc.name : getNextObject - * @tc.desc : getNextObject query image assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETNEXTOBJECT_PROMISE_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETNEXTOBJECT_PROMISE_01'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Pictures/Static/'); - let isAudio = false; - await getNextObjectTest(done, testNum, currentFetchOps, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETNEXTOBJECT_PROMISE_02 - * @tc.name : getNextObject - * @tc.desc : getNextObject query video assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETNEXTOBJECT_PROMISE_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETNEXTOBJECT_PROMISE_02'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Videos/Static/'); - let isAudio = false; - await getNextObjectTest(done, testNum, currentFetchOps, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETNEXTOBJECT_PROMISE_03 - * @tc.name : getNextObject - * @tc.desc : getNextObject query audio assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETNEXTOBJECT_PROMISE_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETNEXTOBJECT_PROMISE_03'; - let currentFetchOps = audioFetchOps(testNum, 'Audios/Static/'); - let isAudio = true; - await getNextObjectTest(done, testNum, currentFetchOps, isAudio); - }); - - //------------------------------------------------------------------------------ - - /** - * @tc.number : SUB_USERFILE_MGR_GETLASTOBJECT_PROMISE_01 - * @tc.name : getLastObject - * @tc.desc : getLastObject query image assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETLASTOBJECT_PROMISE_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETLASTOBJECT_PROMISE_01'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Pictures/Static/'); - let isAudio = false; - await getLastObjectTest(done, testNum, currentFetchOps, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETLASTOBJECT_PROMISE_02 - * @tc.name : getLastObject - * @tc.desc : getLastObject query video assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETLASTOBJECT_PROMISE_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETLASTOBJECT_PROMISE_02'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Videos/Static/'); - let isAudio = false; - await getLastObjectTest(done, testNum, currentFetchOps, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETLASTOBJECT_PROMISE_03 - * @tc.name : getLastObject - * @tc.desc : getLastObject query audio assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETLASTOBJECT_PROMISE_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETLASTOBJECT_PROMISE_03'; - let currentFetchOps = audioFetchOps(testNum, 'Audios/Static/'); - let isAudio = true; - await getLastObjectTest(done, testNum, currentFetchOps, isAudio); - }); - - //------------------------------------------------------------------------------ - - /** - * @tc.number : SUB_USERFILE_MGR_GETPOSITIONOBJECT_PROMISE_01 - * @tc.name : getPositionObject - * @tc.desc : getPositionObject query image assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPOSITIONOBJECT_PROMISE_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPOSITIONOBJECT_PROMISE_01'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Pictures/Static/'); - let pos = 0; - let isAudio = false; - await getPositionObjectTest(done, testNum, currentFetchOps, pos, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPOSITIONOBJECT_PROMISE_02 - * @tc.name : getPositionObject - * @tc.desc : getPositionObject query video assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPOSITIONOBJECT_PROMISE_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPOSITIONOBJECT_PROMISE_02'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Videos/Static/'); - let pos = 0; - let isAudio = false; - await getPositionObjectTest(done, testNum, currentFetchOps, pos, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPOSITIONOBJECT_PROMISE_03 - * @tc.name : getPositionObject - * @tc.desc : getPositionObject query audio assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPOSITIONOBJECT_PROMISE_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPOSITIONOBJECT_PROMISE_03'; - let currentFetchOps = audioFetchOps(testNum, 'Audios/Static/'); - let pos = 0; - let isAudio = true; - await getPositionObjectTest(done, testNum, currentFetchOps, pos, isAudio); - }); - - //--------------------------------------------------------------------------------- - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETS_PROMISE_01 - * @tc.name : getPhotoAssets - * @tc.desc : query image assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETS_PROMISE_01', 1, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETS_PROMISE_01'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Pictures/Static/'); - let type = 'image'; - let isAudio = false; - await checkFileAssetAttr(done, testNum, currentFetchOps, type, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETS_PROMISE_02 - * @tc.name : getPhotoAssets - * @tc.desc : query video assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETS_PROMISE_02', 1, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETS_PROMISE_02'; - let currentFetchOps = imageVideoFetchOps(testNum, 'Videos/Static/'); - let type = 'video'; - let isAudio = false; - await checkFileAssetAttr(done, testNum, currentFetchOps, type, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETAUDIOASSETS_PROMISE_01 - * @tc.name : getAudioAssets - * @tc.desc : query audio assets - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('SUB_USERFILE_MGR_GETAUDIOASSETS_PROMISE_01', 1, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETAUDIOASSETS_PROMISE_01'; - let currentFetchOps = audioFetchOps(testNum, 'Audios/Static/'); - let type = 'audio'; - let isAudio = true; - await checkFileAssetAttr(done, testNum, currentFetchOps, type, isAudio); - }); - - //------------------------------------------------------------------------------ - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETS_ERRCODE_PROMISE_01 - * @tc.name : getPhotoAssets - * @tc.desc : invalid FetchOptions - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 3 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETS_ERRCODE_PROMISE_01', 3, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETS_ERRCODE_PROMISE_01'; - let isAudio = false; - await getFileAssetsErrCodeTest(done, testNum, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETS_ERRCODE_PROMISE_02 - * @tc.name : getPhotoAssets - * @tc.desc : invalid FetchOptions - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 3 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETS_ERRCODE_PROMISE_02', 3, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETS_ERRCODE_PROMISE_02'; - let isAudio = true; - await getFileAssetsErrCodeTest(done, testNum, isAudio); - }); - }); -} - diff --git a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/getUserFileMgr.test.ets b/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/getUserFileMgr.test.ets deleted file mode 100644 index c1bdde255..000000000 --- a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/getUserFileMgr.test.ets +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; -import { sleep } from '../../../../../../common'; - -export default function getUserFileMgrTest(abilityContext) { - describe('getUserFileMgrTest', function () { - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETUSERFILEMGR_00 - * @tc.name : getUserFileMgr - * @tc.desc : Obtains a userFileMgr instance - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 0 - */ - it('SUB_USERFILE_MGR_GETUSERFILEMGR_00', 0, async function (done) { - try { - expect(userfilemgr != undefined).assertTrue(); - done(); - } catch (error) { - console.info(`SUB_USERFILE_MGR_GETUSERFILEMGR_00 failed, error: ${error}`); - expect(false).assertTrue(); - done(); - } - }); - }); -} - - diff --git a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/onOffReleasePromise.test.ets b/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/onOffReleasePromise.test.ets deleted file mode 100644 index 7f39f083e..000000000 --- a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/ets/test/onOffReleasePromise.test.ets +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; - -import { - sleep, - audioNameFetchOps, - imageVideoNameFetchOps, - checkPresetsAssets, - checkAssetsCount, - albumFetchOps, -} from '../../../../../../common'; - - -export default function onOffReleasePromiseTest(abilityContext) { - describe('onOffReleasePromiseTest', function () { - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - await checkPresetsAssets(userfilemgr, 'ActsUserFileMgrAlbumJsTest'); - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - const onTest = async (done, testNum, fetchOp, type, newName, isAudio) => { - try { - let count = 0; - userfilemgr.on(type, () => { count++; }); - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1); - if (!checkAssetCountPass) return; - const asset = await fetchAssetResult.getFirstObject(); - fetchAssetResult.close(); - asset.displayName = newName; - await asset.commitModify(); - await sleep(1000) - expect(count > 0).assertTrue(); - done(); - } catch (error) { - console.info(`${testNum}:: error :${error}`); - expect(false).assertTrue(); - done(); - } - } - const offTest = async (done, testNum, fetchOp, type, newName, isAudio) => { - try { - let count = 0; - userfilemgr.on(type, () => { count++; }); - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1); - if (!checkAssetCountPass) return; - const asset = await fetchAssetResult.getFirstObject(); - fetchAssetResult.close(); - asset.displayName = newName; - userfilemgr.off(type); - await asset.commitModify(); - await sleep(1000) - expect(count).assertEqual(0); - done(); - } catch (error) { - console.info(`${testNum}:: error :${error}`); - expect(false).assertTrue(); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_ON_01 - * @tc.name : ON - * @tc.desc : ON imageChange - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_ON_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_ON_01'; - let currentFetchOps = imageVideoNameFetchOps(testNum, 'Pictures/onAsset/', '01.jpg'); - let type = 'imageChange'; - let newName = 'imageChange.jpg'; - let isAudio = false; - await onTest(done, testNum, currentFetchOps, type, newName, isAudio) - }); - - /** - * @tc.number : SUB_USERFILE_MGR_ON_02 - * @tc.name : ON - * @tc.desc : ON videoChange - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_ON_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_ON_02'; - let currentFetchOps = imageVideoNameFetchOps(testNum, 'Videos/onAsset/', '01.mp4'); - let type = 'videoChange'; - let newName = 'videoChange.mp4'; - let isAudio = false; - await onTest(done, testNum, currentFetchOps, type, newName, isAudio) - }); - - /** - * @tc.number : SUB_USERFILE_MGR_ON_03 - * @tc.name : ON - * @tc.desc : ON audioChange - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_ON_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_ON_03'; - let currentFetchOps = audioNameFetchOps(testNum, 'Audios/onAsset/', '01.mp3'); - let type = 'audioChange'; - let newName = 'audioChange.mp3'; - let isAudio = true; - await onTest(done, testNum, currentFetchOps, type, newName, isAudio) - }); - - /** - * @tc.number : SUB_USERFILE_MGR_ON_04 - * @tc.name : ON - * @tc.desc : ON albumChange - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_ON_04', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_ON_04'; - try { - let currentFetchOps = albumFetchOps(testNum, 'Pictures/', 'onAlbum'); - let type: userFileManager.ChangeEvent = 'albumChange'; - let count = 0; - userfilemgr.on(type, () => { count++; }); - const fetchAlbumResult = await userfilemgr.getPhotoAlbums(currentFetchOps); - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAlbumResult, 1); - if (!checkAssetCountPass) return; - const album = await fetchAlbumResult.getFirstObject(); - const oldName = album.albumName; - fetchAlbumResult.close(); - album.albumName = type.toString(); - await album.commitModify(); - await sleep(1000); - expect(count > 0).assertTrue(); - album.albumName = oldName; - await album.commitModify(); - done(); - } catch (error) { - console.info(`${testNum}:: error :${error}`); - expect(false).assertTrue(); - done(); - } - }); - - /** - * @tc.number : SUB_USERFILE_MGR_OFF_01 - * @tc.name : off - * @tc.desc : off imageChange - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_OFF_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_OFF_01'; - let currentFetchOps = imageVideoNameFetchOps(testNum, 'Pictures/offAsset/', '01.jpg'); - let type = 'imageChange'; - let newName = 'imageChange.jpg'; - let isAudio = false; - await offTest(done, testNum,currentFetchOps, type, newName, isAudio) - }); - - /** - * @tc.number : SUB_USERFILE_MGR_OFF_02 - * @tc.name : off - * @tc.desc : off videoChange - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_OFF_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_OFF_02'; - let currentFetchOps = imageVideoNameFetchOps(testNum, 'Videos/offAsset/', '01.mp4'); - let type = 'videoChange'; - let newName = 'videoChange.mp4'; - let isAudio = false; - await offTest(done, testNum,currentFetchOps, type, newName, isAudio) - }); - - /** - * @tc.number : SUB_USERFILE_MGR_OFF_03 - * @tc.name : off - * @tc.desc : off audioChange - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_OFF_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_OFF_03'; - let currentFetchOps = audioNameFetchOps(testNum, 'Audios/offAsset/', '01.mp3'); - let type = 'audioChange'; - let newName = 'audioChange.mp3'; - let isAudio = true; - await offTest(done, testNum,currentFetchOps, type, newName, isAudio) - }); - - /** - * @tc.number : SUB_USERFILE_MGR_OFF_04 - * @tc.name : off - * @tc.desc : off albumChange - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_OFF_04', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_OFF_04'; - try { - let currentFetchOps = albumFetchOps(testNum, 'Pictures/', 'offAlbum'); - let type: userFileManager.ChangeEvent = 'albumChange'; - let count = 0; - userfilemgr.on(type, () => { count++; }); - const fetchAlbumResult = await userfilemgr.getPhotoAlbums(currentFetchOps); - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAlbumResult, 1); - if (!checkAssetCountPass) return; - const album = await fetchAlbumResult.getFirstObject(); - const oldName = album.albumName - fetchAlbumResult.close(); - album.albumName = type.toString(); - userfilemgr.off(type); - await album.commitModify(); - await sleep(1000); - expect(count).assertEqual(0); - album.albumName = oldName; - await album.commitModify(); - done(); - } catch (error) { - console.info(`${testNum}:: error :${error}`); - expect(false).assertTrue(); - done(); - } - }); - - /** - * @tc.number : SUB_USERFILE_MGR_RELEASE_CALLBACK_01 - * @tc.name : release - * @tc.desc : Release MediaLibrary instance - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_RELEASE_CALLBACK_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_RELEASE_CALLBACK_01'; - try { - userfilemgr.release(() => { - expect(true).assertTrue(); - done(); - }); - } catch (error) { - console.info(`${testNum}:: error :${error}`); - expect(false).assertTrue(); - done(); - } - }); - - /** - * @tc.number : SUB_USERFILE_MGR_RELEASE_01 - * @tc.name : release - * @tc.desc : Release MediaLibrary instance - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_RELEASE_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_RELEASE_PROMISE_01'; - try { - await userfilemgr.release(); - expect(true).assertTrue(); - done(); - } catch (error) { - console.info(`${testNum}:: error :${error}`); - expect(false).assertTrue(); - done(); - } - }); - }); -} - - diff --git a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/module.json b/multimedia/userfilemgr/userfilemgr_base/entry/src/main/module.json deleted file mode 100755 index eea188f92..000000000 --- a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/module.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:mainability_description", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default", - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "ohos.acts.multimedia.userfilemgr.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:mainability_description", - "icon": "$media:icon", - "label": "$string:entry_MainAbility", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities":[ - "entity.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.GET_BUNDLE_INFO", - "reason": "use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name" : "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", - "reason" : "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" - }, - { - "name" : "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", - "reason" : "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS" - }, - { - "name": "ohos.permission.MEDIA_LOCATION", - "reason":"use ohos.permission.MEDIA_LOCATION" - }, - { - "name": "ohos.permission.READ_IMAGEVIDEO", - "reason":"use ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.READ_AUDIO", - "reason":"use ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.READ_DOCUMENT", - "reason":"use ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.WRITE_IMAGEVIDEO", - "reason":"use ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.WRITE_AUDIO", - "reason":"use ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.WRITE_DOCUMENT", - "reason":"use ohos.permission.WRITE_MEDIA" - } - ] - } -} diff --git a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/resources/base/element/string.json b/multimedia/userfilemgr/userfilemgr_base/entry/src/main/resources/base/element/string.json deleted file mode 100755 index d75a3fee6..000000000 --- a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "MediaLibraryJSTestMain" - }, - { - "name": "mainability_description", - "value": "MediaLibraryJSTestMain Ability" - } - ] - } \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_base/entry/src/main/resources/base/media/icon.png b/multimedia/userfilemgr/userfilemgr_base/entry/src/main/resources/base/media/icon.png deleted file mode 100755 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 liter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?`Pekhe2WM(8s{xv-p>Zmu_6{G!-oE$7$mY`MOJorI=+mMx?H;`pr!;fVYz?5~yXBACruWB`Ph zZM}90_<^OBxIhyZ9BW$`>6JvO;%VFpqVr8|7t3~AmxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}y/storage/media/100/local/temp", - "./resource/medialibrary/01.mp3 ->/storage/media/100/local/temp", - "./resource/medialibrary/01.mp4 ->/storage/media/100/local/temp" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "mkdir -pv /storage/media/100/local/files/Pictures/{ModifyCb,ModifyPro,FavCb,FavPro,Thumbnail,FileKey,R_Cb,W_Cb,RW_Cb,R_Pro,W_Pro,RW_Pro,openClose,trashCb,trashPro}", - "mkdir -pv /storage/media/100/local/files/Videos/{ModifyCb,ModifyPro,FavCb,FavPro,Thumbnail,FileKey,R_Cb,W_Cb,RW_Cb,R_Pro,W_Pro,RW_Pro,openClose,trashCb,trashPro}", - "mkdir -pv /storage/media/100/local/files/Audios/{ModifyCb,ModifyPro,FavCb,FavPro,Thumbnail,FileKey,R_Cb,W_Cb,RW_Cb,R_Pro,W_Pro,RW_Pro,openClose,trashCb,trashPro}", - - "for d in FavCb FavPro trashCb trashPro; do for i in $$(seq 3); do cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/$$d/0$$i.jpg; done;done;", - "for d in FavCb FavPro trashCb trashPro; do for i in $$(seq 3); do cp /storage/media/100/local/temp/01.mp3 /storage/media/100/local/files/Audios/$$d/0$$i.mp3; done;done;", - "for d in FavCb FavPro trashCb trashPro; do for i in $$(seq 3); do cp /storage/media/100/local/temp/01.mp4 /storage/media/100/local/files/Videos/$$d/0$$i.mp4; done;done;", - - "for d in Thumbnail openClose W_Cb RW_Cb W_Pro RW_Pro; do for i in $$(seq 2); do cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/$$d/0$$i.jpg; done;done;", - "for d in Thumbnail openClose W_Cb RW_Cb W_Pro RW_Pro; do for i in $$(seq 2); do cp /storage/media/100/local/temp/01.mp3 /storage/media/100/local/files/Audios/$$d/0$$i.mp3; done;done;", - "for d in Thumbnail openClose W_Cb RW_Cb W_Pro RW_Pro; do for i in $$(seq 2); do cp /storage/media/100/local/temp/01.mp4 /storage/media/100/local/files/Videos/$$d/0$$i.mp4; done;done;", - - "for d in ModifyCb ModifyPro FileKey R_Cb R_Pro; do for i in $$(seq 1); do cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/$$d/0$$i.jpg; done;done;", - "for d in ModifyCb ModifyPro FileKey R_Cb R_Pro; do for i in $$(seq 1); do cp /storage/media/100/local/temp/01.mp3 /storage/media/100/local/files/Audios/$$d/0$$i.mp3; done;done;", - "for d in ModifyCb ModifyPro FileKey R_Cb R_Pro; do for i in $$(seq 1); do cp /storage/media/100/local/temp/01.mp4 /storage/media/100/local/files/Videos/$$d/0$$i.mp4; done;done;", - - "chmod -R 777 /storage/media/100/local/files/*", - "chmod -R 777 /data/service/el2/100/hmdfs/account/files/*", - "hilog -Q pidoff", - "hilog -p off", - "hilog -b I", - "hilog -b D -D 0xD002B70", - "scanner", - "sleep 10" - ], - "teardown-command":[ - "hilog -b X -D 0xD002B70" - ] - }, - { - "test-file-name": [ - "ActsUserFileMgrFileAssetJsTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/Application/AbilityStage.ts b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100755 index cbcc939ff..000000000 --- a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,9 +0,0 @@ -import AbilityStage from "@ohos.app.ability.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} diff --git a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/MainAbility/MainAbility.ts b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100755 index 266fcd859..000000000 --- a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,36 +0,0 @@ -import Ability from '@ohos.app.ability.UIAbility' - -export default class MainAbility extends Ability { - onCreate(want,launchParam){ - // Ability is creating, initialize resources for this ability - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("[Demo] MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - //Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("[Demo] MainAbility onBackground") - } -}; \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/pages/index/index.ets b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/pages/index/index.ets deleted file mode 100755 index 624cad290..000000000 --- a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/pages/index/index.ets +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import file from '@system.file'; - -import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index" -import testsuite from "../../test/List.test.ets" - -@Entry -@Component -struct Index { - - aboutToAppear(){ - - console.info("start run testcase!!!!") - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - const reportExtend = new ReportExtend(file) - - core.addService('report', reportExtend) - core.init() - core.subscribeEvent('task', reportExtend) - const configService = core.getDefaultService('config') - console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters)) - globalThis.abilityWant.parameters.timeout = 70000; - configService.setConfig(globalThis.abilityWant.parameters) - console.info('testsuite()---->') - testsuite(globalThis.abilityContext) - core.execute() - console.info('core.execute()---->') - } - - build() { - Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World') - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(25) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/pages/second/second.ets b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/pages/second/second.ets deleted file mode 100755 index 1c1c727ff..000000000 --- a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/pages/second/second.ets +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import router from '@system.router'; - -@Entry -@Component -struct Second { - private content: string = "Second Page" - - build() { - Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text(`${this.content}`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('back to index') - .fontSize(20) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - router.back() - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/List.test.ets b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/List.test.ets deleted file mode 100755 index 9a9193148..000000000 --- a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import fileAssetCommitModifyCallbackTest from './fileAssetCommitModifyCallback.test.ets' -import fileAssetCommitModifyPromiseTest from './fileAssetCommitModifyPromise.test.ets' -import fileAssetFavoriteCallbackTest from './fileAssetFavoriteCallback.test.ets' -import fileAssetFavoritePromiseTest from './fileAssetFavoritePromise.test.ets' -import fileAssetFileKeyTest from './fileAssetFileKey.test.ets' -import fileAssetGetThumbnailCallbackTest from './fileAssetGetThumbnailCallback.test.ets' -import fileAssetGetThumbnailPromiseTest from './fileAssetGetThumbnailPromise.test.ets' -import fileAssetOpenCallbackTest from './fileAssetOpenCallback.test.ets' -import fileAssetOpenPromiseTest from './fileAssetOpenPromise.test.ets' -export default function testsuite(abilityContext) { - fileAssetCommitModifyCallbackTest(abilityContext) - fileAssetCommitModifyPromiseTest(abilityContext) - fileAssetFavoriteCallbackTest(abilityContext) - fileAssetFavoritePromiseTest(abilityContext) - fileAssetFileKeyTest(abilityContext) - fileAssetGetThumbnailCallbackTest(abilityContext) - fileAssetGetThumbnailPromiseTest(abilityContext) - fileAssetOpenCallbackTest(abilityContext) - fileAssetOpenPromiseTest(abilityContext) -} diff --git a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetCommitModifyCallback.test.ets b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetCommitModifyCallback.test.ets deleted file mode 100755 index c6b895bed..000000000 --- a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetCommitModifyCallback.test.ets +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; -import dataSharePredicates from '@ohos.data.dataSharePredicates'; - -import { - sleep, - IMAGE_TYPE, - VIDEO_TYPE, - AUDIO_TYPE, - audioNameFetchOps, - imageVideoNameFetchOps, - checkPresetsAssets, - checkAssetsCount, - getPermission, -} from '../../../../../../common'; - -export default function fileAssetCommitModifyCallbackTest(abilityContext) { - describe('fileAssetCommitModifyCallbackTest', function () { - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - await getPermission(); - await checkPresetsAssets(userfilemgr, 'ActsUserFileMgrFileAssetJsTest') - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - const checkCommitModify = async function (done, testNum, fetchOp, prop, val, isAudio) { - try { - let fetchAssetResult; - let fileKey; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - fileKey = userFileManager.AudioKey; - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - fileKey = userFileManager.ImageVideoKey; - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1); - if (!checkAssetCountPass) return; - const asset = await fetchAssetResult.getFirstObject(); - fetchAssetResult.close(); - asset.set(prop, val); - await asset.commitModify(async (err) => { - if (err) { - console.info(`${testNum} err : ${err}`) - expect().assertFail(); - done(); - return; - } - let predicates = new dataSharePredicates.DataSharePredicates(); - predicates.equalTo(fileKey.URI, asset.get(fileKey.URI)); - let ops = { - fetchColumns: [], - predicates: predicates - }; - let newResult; - if (isAudio) { - newResult = await userfilemgr.getAudioAssets(ops); - } else { - newResult = await userfilemgr.getPhotoAssets(ops); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, newResult, 1); - if (!checkAssetCountPass) return; - const newAsset = await newResult.getFirstObject(); - newResult.close(); - expect(newAsset.get(fileKey.TITLE)).assertEqual(val); - done(); - }); - } catch (error) { - console.info(`${testNum} error : ${error}`) - expect(false).assertTrue(); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_01 - * @tc.name : commitModify - * @tc.desc : image asset modify title - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_01'; - let fetchOp = imageVideoNameFetchOps(testNum, 'Pictures/ModifyCb/', '01.jpg'); - let prop = 'title'; - let val = IMAGE_TYPE.toString(); - let isAudio = false; - await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_02 - * @tc.name : commitModify - * @tc.desc : video asset modify title - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_02'; - let fetchOp = imageVideoNameFetchOps(testNum, 'Videos/ModifyCb/', '01.mp4'); - let prop = 'title'; - let val = VIDEO_TYPE.toString(); - let isAudio = false; - await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_03 - * @tc.name : commitModify - * @tc.desc : audio asset modify title - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_03'; - let fetchOp = audioNameFetchOps(testNum, 'Audios/ModifyCb/', '01.mp3'); - let prop = 'title'; - let val = AUDIO_TYPE.toString(); - let isAudio = true; - await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio); - }); - }); -} - diff --git a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetCommitModifyPromise.test.ets b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetCommitModifyPromise.test.ets deleted file mode 100755 index eccb17049..000000000 --- a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetCommitModifyPromise.test.ets +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; -import dataSharePredicates from '@ohos.data.dataSharePredicates'; - -import { - sleep, - IMAGE_TYPE, - VIDEO_TYPE, - AUDIO_TYPE, - checkPresetsAssets, - checkAssetsCount, - audioNameFetchOps, - imageVideoNameFetchOps, -} from '../../../../../../common'; - -export default function fileAssetCommitModifyPromiseTest(abilityContext) { - describe('fileAssetCommitModifyPromiseTest', function () { - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - await checkPresetsAssets(userfilemgr, 'ActsUserFileMgrFileAssetJsTest') - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - const checkCommitModify = async function (done, testNum, fetchOp, prop, val, isAudio) { - try { - let fetchAssetResult; - let fileKey; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - fileKey = userFileManager.AudioKey; - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - fileKey = userFileManager.ImageVideoKey; - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1); - if (!checkAssetCountPass) return; - const asset = await fetchAssetResult.getFirstObject(); - fetchAssetResult.close(); - asset.set(prop, val); - await asset.commitModify(); - let predicates = new dataSharePredicates.DataSharePredicates(); - predicates.equalTo(fileKey.URI, asset.get(fileKey.URI)); - let ops = { - fetchColumns: [], - predicates: predicates - }; - let newResult; - if (isAudio) { - newResult = await userfilemgr.getAudioAssets(ops); - } else { - newResult = await userfilemgr.getPhotoAssets(ops); - } - checkAssetCountPass = await checkAssetsCount(done, testNum, newResult, 1); - if (!checkAssetCountPass) return; - const newAsset = await newResult.getFirstObject(); - newResult.close(); - expect(newAsset.get(fileKey.TITLE)).assertEqual(val); - done(); - } catch (error) { - console.info(`${testNum} error : ${error}`); - expect(false).assertTrue(); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_01 - * @tc.name : commitModify - * @tc.desc : image asset modify title - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_01'; - let fetchOp = imageVideoNameFetchOps(testNum, 'Pictures/ModifyPro/', '01.jpg'); - let prop = 'title'; - let val = IMAGE_TYPE.toString(); - let isAudio = false; - await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_02 - * @tc.name : commitModify - * @tc.desc : video asset modify title - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_02'; - let fetchOp = imageVideoNameFetchOps(testNum, 'Videos/ModifyPro/', '01.mp4'); - let prop = 'title'; - let val = VIDEO_TYPE.toString(); - let isAudio = false; - await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_03 - * @tc.name : commitModify - * @tc.desc : audio asset modify title - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_03'; - let fetchOp = audioNameFetchOps(testNum, 'Audios/ModifyPro/', '01.mp3'); - let prop = 'title'; - let val = AUDIO_TYPE.toString(); - let isAudio = true; - await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio); - }); - }); -} - diff --git a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetFavoriteCallback.test.ets b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetFavoriteCallback.test.ets deleted file mode 100644 index 494fe7b4c..000000000 --- a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetFavoriteCallback.test.ets +++ /dev/null @@ -1,271 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; -import { - sleep, - checkPresetsAssets, - audioNameFetchOps, - imageVideoNameFetchOps, - checkAssetsCount, - getPermission, -} from '../../../../../../common'; - -export default function fileAssetFavoriteCallbackTest(abilityContext) { - describe('fileAssetFavoriteCallbackTest', function () { - var userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - await getPermission(); - await checkPresetsAssets(userfilemgr, 'ActsUserFileMgrFavorite'); - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - const favoriteDefaultState = async function (done, testNum, fetchOp, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1); - if (!checkAssetCountPass) return; - let asset = await fetchAssetResult.getFirstObject(); - console.info(`${testNum} asset: ${asset}`); - asset.isFavorite(async (err, isFavorite) => { - if (err) { - expect(false).assertTrue(); - await fetchAssetResult.close(); - done(); - return; - } - expect(isFavorite).assertEqual(false); - fetchAssetResult.close(); - done() - }); - } catch (error) { - console.info(`${testNum} failed error: ${error}`); - expect(false).assertTrue(); - done(); - } - } - const favoriteByTrue = async function (done, testNum, fetchOp, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1); - if (!checkAssetCountPass) return; - const asset = await fetchAssetResult.getFirstObject(); - asset.favorite(true, async (err) => { - if(err) { - console.info(`${testNum} failed err: ${err}`); - expect(false).assertTrue(); - done(); - return; - } - let isFavorite = await asset.isFavorite(); - expect(isFavorite).assertEqual(true); - fetchAssetResult.close(); - done(); - }); - - } catch (error) { - console.info(`${testNum} failed error: ${error}`); - expect(false).assertTrue(); - done(); - } - } - const favoriteByFalse = async function (done, testNum, fetchOp, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1); - if (!checkAssetCountPass) return; - const asset = await fetchAssetResult.getFirstObject(); - await asset.favorite(true); - asset.favorite(false, async (err) => { - if(err) { - console.info(`${testNum} failed err: ${err}`); - expect(false).assertTrue(); - done(); - return; - } - let isFavorite = await asset.isFavorite(); - expect(isFavorite).assertEqual(false); - fetchAssetResult.close(); - done(); - }); - } catch (error) { - console.info(`${testNum} failed error: ${error}`); - expect(false).assertTrue(); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_01_001 - * @tc.name : isFavorite - * @tc.desc : isFavorite(image) result false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_01_001', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_01_001'; - let currentFetchOp = imageVideoNameFetchOps(testNum, 'Pictures/FavCb/', '01.jpg'); - let isAudio = false; - await favoriteDefaultState(done, testNum, currentFetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_01_002 - * @tc.name : favorite - * @tc.desc : favorite(image) by true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_01_002', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_01_002'; - let currentFetchOp = imageVideoNameFetchOps(testNum, 'Pictures/FavCb/', '02.jpg'); - let isAudio = false; - await favoriteByTrue(done, testNum, currentFetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_01_003 - * @tc.name : favorite - * @tc.desc : favorite(image) by false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_01_003', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_01_003'; - let currentFetchOp = imageVideoNameFetchOps(testNum, 'Pictures/FavCb/', '03.jpg'); - let isAudio = false; - await favoriteByFalse(done, testNum, currentFetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_02_001 - * @tc.name : isFavorite - * @tc.desc : isFavorite(video) result false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_02_001', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_02_001'; - let currentFetchOp = imageVideoNameFetchOps(testNum, 'Videos/FavCb/', '01.mp4'); - let isAudio = false; - await favoriteDefaultState(done, testNum, currentFetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_02_002 - * @tc.name : favorite - * @tc.desc : favorite(video) by true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_02_002', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_02_002'; - let currentFetchOp = imageVideoNameFetchOps(testNum, 'Videos/FavCb/', '02.mp4'); - let isAudio = false; - await favoriteByTrue(done, testNum, currentFetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_02_003 - * @tc.name : favorite - * @tc.desc : favorite(video) by false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_02_003', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_02_003'; - let currentFetchOp = imageVideoNameFetchOps(testNum, 'Videos/FavCb/', '03.mp4'); - let isAudio = false; - await favoriteByFalse(done, testNum, currentFetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_03_001 - * @tc.name : isFavorite - * @tc.desc : isFavorite(audio) result false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_03_001', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_03_001'; - let currentFetchOp = audioNameFetchOps(testNum, 'Audios/FavCb/', '01.mp3'); - let isAudio = true; - await favoriteDefaultState(done, testNum, currentFetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_03_002 - * @tc.name : favorite - * @tc.desc : favorite(audio) by true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_03_002', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_03_002'; - let currentFetchOp = audioNameFetchOps(testNum, 'Audios/FavCb/', '02.mp3'); - let isAudio = true; - await favoriteByTrue(done, testNum, currentFetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_03_003 - * @tc.name : favorite - * @tc.desc : favorite(audio) by false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_03_003', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_FAVORITE_CALLBACK_03_003'; - let currentFetchOp = audioNameFetchOps(testNum, 'Audios/FavCb/', '03.mp3'); - let isAudio = true; - await favoriteByFalse(done, testNum, currentFetchOp, isAudio); - }); - }); -} diff --git a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetFavoritePromise.test.ets b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetFavoritePromise.test.ets deleted file mode 100644 index 2d0fb0233..000000000 --- a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetFavoritePromise.test.ets +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; -import { - sleep, - checkPresetsAssets, - audioNameFetchOps, - imageVideoNameFetchOps, - checkAssetsCount, -} from '../../../../../../common'; - -export default function fileAssetFavoritePromiseTest(abilityContext) { - describe('fileAssetFavoritePromiseTest', function () { - var userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - await checkPresetsAssets(userfilemgr, 'ActsUserFileMgrFavorite'); - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - const favoriteDefaultState = async function (done, testNum, fetchOp, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1); - if (!checkAssetCountPass) return; - let asset = await fetchAssetResult.getFirstObject(); - let isFavorite = await asset.isFavorite(); - expect(isFavorite).assertEqual(false); - fetchAssetResult.close(); - done() - } catch (error) { - console.info(`${testNum} failed error: ${error}`); - expect(false).assertTrue(); - done(); - } - } - const favoriteByTrue = async function (done, testNum, fetchOp, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1); - if (!checkAssetCountPass) return; - const asset = await fetchAssetResult.getFirstObject(); - await asset.favorite(true); - let isFavorite = await asset.isFavorite(); - expect(isFavorite).assertEqual(true); - fetchAssetResult.close(); - done(); - } catch (error) { - console.info(`${testNum} failed error: ${error}`); - expect(false).assertTrue(); - done(); - } - } - const favoriteByFalse = async function (done, testNum, fetchOp, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1); - if (!checkAssetCountPass) return; - const asset = await fetchAssetResult.getFirstObject(); - await asset.favorite(true); - await asset.favorite(false); - let isFavorite = await asset.isFavorite(); - expect(isFavorite).assertEqual(false); - fetchAssetResult.close(); - done(); - } catch (error) { - console.info(`${testNum} failed error: ${error}`); - expect(false).assertTrue(); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_01_001 - * @tc.name : isFavorite - * @tc.desc : isFavorite(image) result false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_01_001', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_01_001'; - let currentFetchOp = imageVideoNameFetchOps(testNum, 'Pictures/FavPro/', '01.jpg'); - let isAudio = false; - await favoriteDefaultState(done, testNum, currentFetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_01_002 - * @tc.name : favorite - * @tc.desc : favorite(image) by true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_01_002', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_01_002'; - let currentFetchOp = imageVideoNameFetchOps(testNum, 'Pictures/FavPro/', '02.jpg'); - let isAudio = false; - await favoriteByTrue(done, testNum, currentFetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_01_003 - * @tc.name : favorite - * @tc.desc : favorite(image) by false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_01_003', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_01_003'; - let currentFetchOp = imageVideoNameFetchOps(testNum, 'Pictures/FavPro/', '03.jpg'); - let isAudio = false; - await favoriteByFalse(done, testNum, currentFetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_02_001 - * @tc.name : isFavorite - * @tc.desc : isFavorite(video) result false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_02_001', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_02_001'; - let currentFetchOp = imageVideoNameFetchOps(testNum, 'Videos/FavPro/', '01.mp4'); - let isAudio = false; - await favoriteDefaultState(done, testNum, currentFetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_02_002 - * @tc.name : favorite - * @tc.desc : favorite(video) by true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_02_002', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_02_002'; - let currentFetchOp = imageVideoNameFetchOps(testNum, 'Videos/FavPro/', '02.mp4'); - let isAudio = false; - await favoriteByTrue(done, testNum, currentFetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_02_003 - * @tc.name : favorite - * @tc.desc : favorite(video) by false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_02_003', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_02_003'; - let currentFetchOp = imageVideoNameFetchOps(testNum, 'Videos/FavPro/', '03.mp4'); - let isAudio = false; - await favoriteByFalse(done, testNum, currentFetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_03_001 - * @tc.name : isFavorite - * @tc.desc : isFavorite(audio) result false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_03_001', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_03_001'; - let currentFetchOp = audioNameFetchOps(testNum, 'Audios/FavPro/', '01.mp3'); - let isAudio = true; - await favoriteDefaultState(done, testNum, currentFetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_03_002 - * @tc.name : favorite - * @tc.desc : favorite(audio) by true - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_03_002', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_03_002'; - let currentFetchOp = audioNameFetchOps(testNum, 'Audios/FavPro/', '02.mp3'); - let isAudio = true; - await favoriteByTrue(done, testNum, currentFetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_03_003 - * @tc.name : favorite - * @tc.desc : favorite(audio) by false - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_03_003', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_FAVORITE_PROMISE_03_003'; - let currentFetchOp = audioNameFetchOps(testNum, 'Audios/FavPro/', '03.mp3'); - let isAudio = true; - await favoriteByFalse(done, testNum, currentFetchOp, isAudio); - }); - }); -} diff --git a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetFileKey.test.ets b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetFileKey.test.ets deleted file mode 100644 index a3fdde40b..000000000 --- a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetFileKey.test.ets +++ /dev/null @@ -1,548 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; -import dataSharePredicates from '@ohos.data.dataSharePredicates'; - -import { - sleep, - audioFetchOps, - imageVideoFetchOps, - albumFetchOps, - checkPresetsAssets, - checkAssetsCount, -} from '../../../../../../common'; - -export default function fileAssetFileKeyTest(abilityContext) { - describe('fileAssetFileKeyTest', function () { - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - await checkPresetsAssets(userfilemgr, 'ActsUserFileMgrFileAssetJsTest') - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - const AudioKey = userFileManager.AudioKey; - const ImageVideoKey = userFileManager.ImageVideoKey; - const AlbumKey = userFileManager.AlbumKey; - - const getAlbumsByKey = async function (done, testNum, type, fileKey) { - try { - let expectAlbumNum = 1; - let fetchOps = albumFetchOps(testNum, 'Pictures/', 'FileKey'); - let fetchAlbumResult = await userfilemgr.getPhotoAlbums(fetchOps); - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAlbumResult, expectAlbumNum); - if (!checkAssetCountPass) return; - const album = await fetchAlbumResult.getFirstObject(); - console.info(`${testNum} fileKey : ${fileKey}`) - console.info(`${testNum} type : ${album[type]}`) - fetchAlbumResult.close(); - let predicates = new dataSharePredicates.DataSharePredicates(); - predicates.equalTo(fileKey, album[type]); - let ops = { - predicates: predicates - }; - - userfilemgr.getPhotoAlbums(ops, async (err, newAlbumResult) => { - if (err) { - console.info(`${testNum}, err: ${err}`) - expect(false).assertTrue(); - done(); - return; - } - const fetchCount = newAlbumResult.getCount(); - if (fetchCount <= 0) { - expect(false).assertTrue(); - done(); - return; - } - const currentAlbum = await newAlbumResult.getFirstObject(); - expect(currentAlbum[type]).assertEqual(album[type]); - newAlbumResult.close(); - done(); - }); - } catch (error) { - console.info(`${testNum} error : ${error}`) - expect(false).assertTrue(); - done(); - } - } - - const getPhotoAssetsByKey = async function (done, testNum, fileKey) { - try { - let expectAssetNum = 1; - let fetchOps = imageVideoFetchOps(testNum, 'Pictures/FileKey/'); - let fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOps); - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectAssetNum); - if (!checkAssetCountPass) return; - const asset = await fetchAssetResult.getFirstObject(); - console.info(`${testNum} fileKey : ${fileKey}`) - console.info(`${testNum} type : ${asset.get(fileKey)}`) - let predicates = new dataSharePredicates.DataSharePredicates(); - predicates.equalTo(fileKey, asset.get(fileKey)); - let ops = { - fetchColumns: [], - predicates: predicates - }; - - userfilemgr.getPhotoAssets(ops, async (err, newAssetResult) => { - if (err) { - console.info(`${testNum}, err: ${err}`) - expect(false).assertTrue(); - done(); - return; - } - const fetchCount = newAssetResult.getCount(); - if (fetchCount <= 0) { - expect(false).assertTrue(); - done(); - return; - } - const currentAsset = await newAssetResult.getFirstObject(); - expect(currentAsset.get(fileKey)).assertEqual(asset.get(fileKey)); - done(); - }); - } catch (error) { - console.info(`${testNum} error : ${error}`) - expect(false).assertTrue(); - done(); - } - } - - const getAudioAssetsByKey = async function (done, testNum, fileKey) { - try { - let expectAssetNum = 1; - let fetchOps = audioFetchOps(testNum, 'Audios/FileKey/'); - let fetchAssetResult = await userfilemgr.getAudioAssets(fetchOps); - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectAssetNum); - if (!checkAssetCountPass) return; - const asset = await fetchAssetResult.getFirstObject(); - console.info(`${testNum} fileKey : ${fileKey}`) - console.info(`${testNum} type : ${asset.get(fileKey)}`) - let predicates = new dataSharePredicates.DataSharePredicates(); - predicates.equalTo(fileKey, asset.get(fileKey)); - let ops = { - fetchColumns: [], - predicates: predicates - }; - userfilemgr.getAudioAssets(ops, async (err, newAssetResult) => { - if (err) { - console.info(`${testNum}, err: ${err}`) - expect(false).assertTrue(); - done(); - return; - } - const fetchCount = newAssetResult.getCount(); - if (fetchCount <= 0) { - expect(false).assertTrue(); - done(); - return; - } - const currentAsset = await newAssetResult.getFirstObject(); - expect(currentAsset.get(fileKey)).assertEqual(asset.get(fileKey)); - done(); - }); - } catch (error) { - console.info(`${testNum} error : ${error}`) - expect(false).assertTrue(); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOALBUMSBYKEY_01 - * @tc.name : AlbumKey - * @tc.desc : AlbumKey.URI - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPHOTOALBUMSBYKEY_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOALBUMSBYKEY_01'; - let type = 'albumUri'; - let fileKey = AlbumKey.URI; - await getAlbumsByKey(done, testNum, type, fileKey); - }) - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOALBUMSBYKEY_02 - * @tc.name : AlbumKey - * @tc.desc : AlbumKey.FILE_TYPE - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPHOTOALBUMSBYKEY_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOALBUMSBYKEY_02'; - let type = 'fileType'; - let fileKey = AlbumKey.FILE_TYPE; - await getAlbumsByKey(done, testNum, type, fileKey); - }) - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOALBUMSBYKEY_03 - * @tc.name : AlbumKey - * @tc.desc : AlbumKey.ALBUM_NAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPHOTOALBUMSBYKEY_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOALBUMSBYKEY_03'; - let type = 'albumName'; - let fileKey = AlbumKey.ALBUM_NAME; - await getAlbumsByKey(done, testNum, type, fileKey); - }) - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOALBUMSBYKEY_04 - * @tc.name : AlbumKey - * @tc.desc : AlbumKey.DATE_ADDED - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPHOTOALBUMSBYKEY_04', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOALBUMSBYKEY_04'; - let type = 'dateAdded'; - let fileKey = AlbumKey.DATE_ADDED; - await getAlbumsByKey(done, testNum, type, fileKey); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOALBUMSBYKEY_05 - * @tc.name : AlbumKey - * @tc.desc : AlbumKey.DATE_MODIFIED - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPHOTOALBUMSBYKEY_05', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOALBUMSBYKEY_05'; - let type = 'dateModified'; - let fileKey = AlbumKey.DATE_MODIFIED; - await getAlbumsByKey(done, testNum, type, fileKey); - }); - - //------------------------------------------------------------------------------ - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_01 - * @tc.name : ImageVideoKey - * @tc.desc : ImageVideoKey.URI - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_01'; - let fileKey = ImageVideoKey.URI; - await getPhotoAssetsByKey(done, testNum, fileKey); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_02 - * @tc.name : ImageVideoKey - * @tc.desc : ImageVideoKey.FILE_TYPE - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_02'; - let fileKey = ImageVideoKey.FILE_TYPE; - await getPhotoAssetsByKey(done, testNum, fileKey); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_03 - * @tc.name : ImageVideoKey - * @tc.desc : ImageVideoKey.DISPLAY_NAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_03'; - let fileKey = ImageVideoKey.DISPLAY_NAME; - await getPhotoAssetsByKey(done, testNum, fileKey); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_04 - * @tc.name : ImageVideoKey - * @tc.desc : ImageVideoKey.DATE_ADDED - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_04', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_04'; - let fileKey = ImageVideoKey.DATE_ADDED; - await getPhotoAssetsByKey(done, testNum, fileKey); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_05 - * @tc.name : ImageVideoKey - * @tc.desc : ImageVideoKey.DATE_MODIFIED - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_05', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_05'; - let fileKey = ImageVideoKey.DATE_MODIFIED; - await getPhotoAssetsByKey(done, testNum, fileKey); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_06 - * @tc.name : ImageVideoKey - * @tc.desc : ImageVideoKey.TITLE - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_06', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_06'; - let fileKey = ImageVideoKey.TITLE; - await getPhotoAssetsByKey(done, testNum, fileKey); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_07 - * @tc.name : ImageVideoKey - * @tc.desc : ImageVideoKey.DURATION - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_07', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_07'; - let fileKey = ImageVideoKey.DURATION; - await getPhotoAssetsByKey(done, testNum, fileKey); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_08 - * @tc.name : ImageVideoKey - * @tc.desc : ImageVideoKey.WIDTH - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_08', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_08'; - let fileKey = ImageVideoKey.WIDTH; - await getPhotoAssetsByKey(done, testNum, fileKey); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_09 - * @tc.name : ImageVideoKey - * @tc.desc : ImageVideoKey.HEIGHT - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_09', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_09'; - let fileKey = ImageVideoKey.HEIGHT; - await getPhotoAssetsByKey(done, testNum, fileKey); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_010 - * @tc.name : ImageVideoKey - * @tc.desc : ImageVideoKey.DATE_TAKEN - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_010', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_010'; - let fileKey = ImageVideoKey.DATE_TAKEN; - await getPhotoAssetsByKey(done, testNum, fileKey); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_011 - * @tc.name : ImageVideoKey - * @tc.desc : ImageVideoKey.ORIENTATION - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_011', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_011'; - let fileKey = ImageVideoKey.ORIENTATION; - await getPhotoAssetsByKey(done, testNum, fileKey); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_012 - * @tc.name : ImageVideoKey - * @tc.desc : ImageVideoKey.FAVORITE - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_012', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETSBYKEY_012'; - let fileKey = ImageVideoKey.FAVORITE; - await getPhotoAssetsByKey(done, testNum, fileKey); - }); - - //---------------------------------------------------------------------------- - - /** - * @tc.number : SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_01 - * @tc.name : AudioKey - * @tc.desc : AudioKey.URI - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_01'; - let fileKey = AudioKey.URI; - await getAudioAssetsByKey(done, testNum, fileKey); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_02 - * @tc.name : AudioKey - * @tc.desc : AudioKey.DISPLAY_NAME - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_02'; - let fileKey = AudioKey.DISPLAY_NAME; - await getAudioAssetsByKey(done, testNum, fileKey); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_03 - * @tc.name : AudioKey - * @tc.desc : AudioKey.DATE_ADDED - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_03'; - let fileKey = AudioKey.DATE_ADDED; - await getAudioAssetsByKey(done, testNum, fileKey); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_04 - * @tc.name : AudioKey - * @tc.desc : AudioKey.DATE_MODIFIED - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_04', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_04'; - let fileKey = AudioKey.DATE_MODIFIED; - await getAudioAssetsByKey(done, testNum, fileKey); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_05 - * @tc.name : AudioKey - * @tc.desc : AudioKey.TITLE - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_05', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_05'; - let fileKey = AudioKey.TITLE; - await getAudioAssetsByKey(done, testNum, fileKey); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_06 - * @tc.name : AudioKey - * @tc.desc : AudioKey.ARTIST - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_06', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_06'; - let fileKey = AudioKey.ARTIST; - await getAudioAssetsByKey(done, testNum, fileKey); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_07 - * @tc.name : AudioKey - * @tc.desc : AudioKey.AUDIOALBUM - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_07', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_07'; - let fileKey = AudioKey.AUDIOALBUM; - await getAudioAssetsByKey(done, testNum, fileKey); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_08 - * @tc.name : AudioKey - * @tc.desc : AudioKey.DURATION - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_08', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_08'; - let fileKey = AudioKey.DURATION; - await getAudioAssetsByKey(done, testNum, fileKey); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_09 - * @tc.name : AudioKey - * @tc.desc : AudioKey.FAVORITE - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_09', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_GETAUDIOASSETSBYKEY_09'; - let fileKey = AudioKey.FAVORITE; - await getAudioAssetsByKey(done, testNum, fileKey); - }); - }); -} - diff --git a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetGetThumbnailCallback.test.ets b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetGetThumbnailCallback.test.ets deleted file mode 100644 index 12a029cb5..000000000 --- a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetGetThumbnailCallback.test.ets +++ /dev/null @@ -1,525 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; -import image from '@ohos.multimedia.image'; - -import { - sleep, - checkPresetsAssets, - checkAssetsCount, - audioNameFetchOps, - imageVideoNameFetchOps, -} from '../../../../../../common'; -export default function fileAssetGetThumbnailCallbackTest(abilityContext) { - describe('fileAssetGetThumbnailCallbackTest', function () { - image.createPixelMap(new ArrayBuffer(4096), { size: { height: 1, width: 2 } }).then((pixelmap) => { }); - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - await checkPresetsAssets(userfilemgr, 'ActsUserFileMgrGetThumbnailTest'); - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - async function getThumbnailTest(done, testNum, fetchOp, size, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1); - if (!checkAssetCountPass) return; - let asset = await fetchAssetResult.getFirstObject(); - fetchAssetResult.close(); - if (size == 'default') { - size = { width: 256, height: 256 }; - asset.getThumbnail(async (err, pixelmap) => { - if (err != undefined) { - console.info(`${testNum}:: err1 :${err}`); - expect(false).assertTrue(); - done(); - return; - } - await pixelmap.getImageInfo((err, info) => { - if (err != undefined) { - console.info(`${testNum}:: err2 :${err}`); - expect(false).assertTrue(); - done(); - return; - } - console.info(`${testNum}:: width :${info.size.width} height :${info.size.height}`); - expect(info.size.width).assertEqual(size.width); - expect(info.size.height).assertEqual(size.height); - done(); - }); - }) - } else { - asset.getThumbnail(size, async (err, pixelmap) => { - if (err != undefined) { - console.info(`${testNum}:: err1 :${err}`); - expect(false).assertTrue(); - done(); - return; - } - await pixelmap.getImageInfo((err, info) => { - if (err != undefined) { - console.info(`${testNum}:: err2 :${err}`); - expect(false).assertTrue(); - done(); - return; - } - size.width = (size.width == undefined) ? 256 : Math.floor(size.width); - size.height = (size.height == undefined) ? 256 : Math.floor(size.height); - console.info(`${testNum}:: width :${info.size.width} height :${info.size.height}`); - expect(info.size.width).assertEqual(size.width); - expect(info.size.height).assertEqual(size.height); - done(); - }); - }) - } - } catch (error) { - console.info(`${testNum}:: error :${error}`); - expect(false).assertTrue(); - done(); - } - } - - async function getThumbnailErrorSizeTest(done, testNum, fetchOp, size, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1); - if (!checkAssetCountPass) return; - let asset = await fetchAssetResult.getFirstObject(); - fetchAssetResult.close(); - asset.getThumbnail(size, async (err, pixelmap) => { - if (err != undefined) { - console.info(`${testNum}:: err1 :${err}`); - expect(true).assertTrue(); - done(); - return; - } - expect(false).assertTrue(); - done(); - }) - } catch (error) { - console.info(`${testNum}:: error :${error}`); - expect(false).assertTrue(); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_001 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(image) by no arg - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_001', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_001'; - let dOp = imageVideoNameFetchOps(testNum, 'Pictures/Thumbnail/', '01.jpg'); - let size = 'default'; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_002 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(image) by { width: 128, height: 128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_002', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_002'; - let dOp = imageVideoNameFetchOps(testNum, 'Pictures/Thumbnail/', '02.jpg'); - let size = { width: 128, height: 128 }; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_003 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(image) by { width: 128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_003', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_003'; - let dOp = imageVideoNameFetchOps(testNum, 'Pictures/Thumbnail/', '02.jpg'); - let size = { width: 128 }; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_004 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(image) by { height: 128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_004', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_004'; - let dOp = imageVideoNameFetchOps(testNum, 'Pictures/Thumbnail/', '02.jpg'); - let size = { height: 128 }; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_005 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(image) by { width: 1, height: 1 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_005', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_005'; - let dOp = imageVideoNameFetchOps(testNum, 'Pictures/Thumbnail/', '02.jpg'); - let size = { width: 1, height: 1 }; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_006 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(image) by { width: 1.1, height: 1.1 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_006', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_006'; - let dOp = imageVideoNameFetchOps(testNum, 'Pictures/Thumbnail/', '02.jpg'); - let size = { width: 1.1, height: 1.1 }; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_007 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(image) by { width: 0, height: 0 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_007', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_007'; - let dOp = imageVideoNameFetchOps(testNum, 'Pictures/Thumbnail/', '02.jpg'); - let size = { width: 0, height: 0 }; - let isAudio = false; - await getThumbnailErrorSizeTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_008 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(image) by { width: -128, height: -128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_008', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_01_008'; - let dOp = imageVideoNameFetchOps(testNum, 'Pictures/Thumbnail/', '02.jpg'); - let size = { width: -128, height: -128 }; - let isAudio = false; - await getThumbnailErrorSizeTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_001 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(video) by no arg - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_001', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_001'; - let dOp = imageVideoNameFetchOps(testNum, 'Videos/Thumbnail/', '01.mp4'); - let size = 'default'; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_002 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(video) by { width: 128, height: 128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_002', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_002'; - let dOp = imageVideoNameFetchOps(testNum, 'Videos/Thumbnail/', '02.mp4'); - let size = { width: 128, height: 128 }; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_003 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(video) by { width: 128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_003', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_003'; - let dOp = imageVideoNameFetchOps(testNum, 'Videos/Thumbnail/', '02.mp4'); - let size = { width: 128 }; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_004 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(video) by { height: 128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_004', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_004'; - let dOp = imageVideoNameFetchOps(testNum, 'Videos/Thumbnail/', '02.mp4'); - let size = { height: 128 }; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_005 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(video) by { width: 1, height: 1 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_005', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_005'; - let dOp = imageVideoNameFetchOps(testNum, 'Videos/Thumbnail/', '02.mp4'); - let size = { width: 1, height: 1 }; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_006 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(video) by { width: 1.1, height: 1.1 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_006', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_006'; - let dOp = imageVideoNameFetchOps(testNum, 'Videos/Thumbnail/', '02.mp4'); - let size = { width: 1.1, height: 1.1 }; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_007 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(video) by { width: 0, height: 0 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_007', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_007'; - let dOp = imageVideoNameFetchOps(testNum, 'Videos/Thumbnail/', '02.mp4'); - let size = { width: 0, height: 0 }; - let isAudio = false; - await getThumbnailErrorSizeTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_008 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(video) by { width: -128, height: -128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_008', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_02_008'; - let dOp = imageVideoNameFetchOps(testNum, 'Videos/Thumbnail/', '02.mp4'); - let size = { width: -128, height: -128 }; - let isAudio = false; - await getThumbnailErrorSizeTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_001 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(audio) by no arg - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_001', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_001'; - let dOp = audioNameFetchOps(testNum, 'Audios/Thumbnail/', '01.mp3'); - let size = 'default'; - let isAudio = true; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_002 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(audio) by { width: 128, height: 128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_002', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_002'; - let dOp = audioNameFetchOps(testNum, 'Audios/Thumbnail/', '02.mp3'); - let size = { width: 128, height: 128 }; - let isAudio = true; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_003 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(audio) by { width: 128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_003', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_003'; - let dOp = audioNameFetchOps(testNum, 'Audios/Thumbnail/', '02.mp3'); - let size = { width: 128 }; - let isAudio = true; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_004 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(audio) by { height: 128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_004', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_004'; - let dOp = audioNameFetchOps(testNum, 'Audios/Thumbnail/', '02.mp3'); - let size = { height: 128 }; - let isAudio = true; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_005 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(audio) by { width: 1, height: 1 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_005', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_005'; - let dOp = audioNameFetchOps(testNum, 'Audios/Thumbnail/', '02.mp3'); - let size = { width: 1, height: 1 }; - let isAudio = true; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_006 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(audio) by { width: 1.1, height: 1.1 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_006', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_006'; - let dOp = audioNameFetchOps(testNum, 'Audios/Thumbnail/', '02.mp3'); - let size = { width: 1.1, height: 1.1 }; - let isAudio = true; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_007 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(audio) by { width: 0, height: 0 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_007', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_007'; - let dOp = audioNameFetchOps(testNum, 'Audios/Thumbnail/', '02.mp3'); - let size = { width: 0, height: 0 }; - let isAudio = true; - await getThumbnailErrorSizeTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_008 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(audio) by { width: -128, height: -128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_008', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_CALLBACK_03_008'; - let dOp = audioNameFetchOps(testNum, 'Audios/Thumbnail/', '02.mp3'); - let size = { width: -128, height: -128 }; - let isAudio = true; - await getThumbnailErrorSizeTest(done, testNum, dOp, size, isAudio); - }); - }); -} - diff --git a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetGetThumbnailPromise.test.ets b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetGetThumbnailPromise.test.ets deleted file mode 100644 index 76373fbb9..000000000 --- a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetGetThumbnailPromise.test.ets +++ /dev/null @@ -1,499 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; -import image from '@ohos.multimedia.image'; -import { - sleep, - checkPresetsAssets, - checkAssetsCount, - audioNameFetchOps, - imageVideoNameFetchOps, -} from '../../../../../../common'; - -export default function fileAssetGetThumbnailPromiseTest(abilityContext) { - describe('fileAssetGetThumbnailPromiseTest', function () { - image.createPixelMap(new ArrayBuffer(4096), { size: { height: 1, width: 2 } }).then((pixelmap) => { }); - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - await checkPresetsAssets(userfilemgr, 'ActsUserFileMgrGetThumbnailTest'); - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - async function getThumbnailTest(done, testNum, fetchOp, size, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1); - if (!checkAssetCountPass) return; - let asset = await fetchAssetResult.getFirstObject(); - fetchAssetResult.close(); - console.info(`${testNum}:displayName ${asset.displayName}`) - let pixelmap; - if (size == 'default') { - size = { width: 256, height: 256 }; - pixelmap = await asset.getThumbnail() - } else { - pixelmap = await asset.getThumbnail(size) - } - let info = await pixelmap.getImageInfo(); - console.info(`${testNum}:: width :${info.size.width} height :${info.size.height}`); - size.width = (size.width == undefined) ? 256 : Math.floor(size.width); - size.height = (size.height == undefined) ? 256 : Math.floor(size.height); - expect(info.size.width).assertEqual(size.width); - expect(info.size.height).assertEqual(size.height); - done(); - } catch (error) { - console.info(`${testNum}:: error :${error}`); - expect(false).assertTrue(); - done(); - } - } - - async function getThumbnailErrorSizeTest(done, testNum, fetchOp, size, isAudio) { - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1); - if (!checkAssetCountPass) return; - let asset = await fetchAssetResult.getFirstObject(); - fetchAssetResult.close(); - try { - let pixelmap; - if (size == 'default') { - size = { width: 256, height: 256 }; - pixelmap = await asset.getThumbnail() - } else { - pixelmap = await asset.getThumbnail(size) - } - expect(false).assertTrue(); - done(); - } catch (err) { - console.info(`${testNum}:: error :${err}`); - expect(true).assertTrue(); - done(); - } - } catch (error) { - console.info(`${testNum}:: error :${error}`); - expect(false).assertTrue(); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_001 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(image) by no arg - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_001', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_001'; - let dOp = imageVideoNameFetchOps(testNum, 'Pictures/Thumbnail/', '01.jpg'); - let size = 'default'; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_002 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(image) by { width: 128, height: 128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_002', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_002'; - let dOp = imageVideoNameFetchOps(testNum, 'Pictures/Thumbnail/', '02.jpg'); - let size = { width: 128, height: 128 }; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_003 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(image) by { width: 128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_003', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_003'; - let dOp = imageVideoNameFetchOps(testNum, 'Pictures/Thumbnail/', '02.jpg'); - let size = { width: 128 }; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_004 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(image) by { height: 128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_004', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_004'; - let dOp = imageVideoNameFetchOps(testNum, 'Pictures/Thumbnail/', '02.jpg'); - let size = { height: 128 }; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_005 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(image) by { width: 1, height: 1 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_005', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_005'; - let dOp = imageVideoNameFetchOps(testNum, 'Pictures/Thumbnail/', '02.jpg'); - let size = { width: 1, height: 1 }; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_006 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(image) by { width: 1.1, height: 1.1 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_006', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_006'; - let dOp = imageVideoNameFetchOps(testNum, 'Pictures/Thumbnail/', '02.jpg'); - let size = { width: 1.1, height: 1.1 }; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_007 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(image) by { width: 0, height: 0 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_007', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_007'; - let dOp = imageVideoNameFetchOps(testNum, 'Pictures/Thumbnail/', '02.jpg'); - let size = { width: 0, height: 0 }; - let isAudio = false; - await getThumbnailErrorSizeTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_008 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(image) by { width: -128, height: -128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_008', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_01_008'; - let dOp = imageVideoNameFetchOps(testNum, 'Pictures/Thumbnail/', '02.jpg'); - let size = { width: -128, height: -128 }; - let isAudio = false; - await getThumbnailErrorSizeTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_001 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(video) by no arg - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_001', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_001'; - let dOp = imageVideoNameFetchOps(testNum, 'Videos/Thumbnail/', '01.mp4'); - let size = 'default'; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_002 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(video) by { width: 128, height: 128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_002', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_002'; - let dOp = imageVideoNameFetchOps(testNum, 'Videos/Thumbnail/', '02.mp4'); - let size = { width: 128, height: 128 }; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_003 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(video) by { width: 128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_003', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_003'; - let dOp = imageVideoNameFetchOps(testNum, 'Videos/Thumbnail/', '02.mp4'); - let size = { width: 128 }; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_004 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(video) by { height: 128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_004', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_004'; - let dOp = imageVideoNameFetchOps(testNum, 'Videos/Thumbnail/', '02.mp4'); - let size = { height: 128 }; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_005 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(video) by { width: 1, height: 1 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_005', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_005'; - let dOp = imageVideoNameFetchOps(testNum, 'Videos/Thumbnail/', '02.mp4'); - let size = { width: 1, height: 1 }; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_006 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(video) by { width: 1.1, height: 1.1 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_006', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_006'; - let dOp = imageVideoNameFetchOps(testNum, 'Videos/Thumbnail/', '02.mp4'); - let size = { width: 1.1, height: 1.1 }; - let isAudio = false; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_007 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(video) by { width: 0, height: 0 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_007', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_007'; - let dOp = imageVideoNameFetchOps(testNum, 'Videos/Thumbnail/', '02.mp4'); - let size = { width: 0, height: 0 }; - let isAudio = false; - await getThumbnailErrorSizeTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_008 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(video) by { width: -128, height: -128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_008', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_02_008'; - let dOp = imageVideoNameFetchOps(testNum, 'Videos/Thumbnail/', '02.mp4'); - let size = { width: -128, height: -128 }; - let isAudio = false; - await getThumbnailErrorSizeTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_001 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(audio) by no arg - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_001', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_001'; - let dOp = audioNameFetchOps(testNum, 'Audios/Thumbnail/', '01.mp3'); - let size = 'default'; - let isAudio = true; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_002 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(audio) by { width: 128, height: 128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_002', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_002'; - let dOp = audioNameFetchOps(testNum, 'Audios/Thumbnail/', '02.mp3'); - let size = { width: 128, height: 128 }; - let isAudio = true; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_003 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(audio) by { width: 128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_003', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_003'; - let dOp = audioNameFetchOps(testNum, 'Audios/Thumbnail/', '02.mp3'); - let size = { width: 128 }; - let isAudio = true; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_004 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(audio) by { height: 128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_004', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_004'; - let dOp = audioNameFetchOps(testNum, 'Audios/Thumbnail/', '02.mp3'); - let size = { height: 128 }; - let isAudio = true; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_005 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(audio) by { width: 1, height: 1 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_005', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_005'; - let dOp = audioNameFetchOps(testNum, 'Audios/Thumbnail/', '02.mp3'); - let size = { width: 1, height: 1 }; - let isAudio = true; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_006 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(audio) by { width: 1.1, height: 1.1 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_006', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_006'; - let dOp = audioNameFetchOps(testNum, 'Audios/Thumbnail/', '02.mp3'); - let size = { width: 1.1, height: 1.1 }; - let isAudio = true; - await getThumbnailTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_007 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(audio) by { width: 0, height: 0 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_007', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_007'; - let dOp = audioNameFetchOps(testNum, 'Audios/Thumbnail/', '02.mp3'); - let size = { width: 0, height: 0 }; - let isAudio = true; - await getThumbnailErrorSizeTest(done, testNum, dOp, size, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_008 - * @tc.name : getThumbnail - * @tc.desc : getThumbnail(audio) by { width: -128, height: -128 } - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_008', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_GETTHUMBNAIL_PROMISE_03_008'; - let dOp = audioNameFetchOps(testNum, 'Audios/Thumbnail/', '02.mp3'); - let size = { width: -128, height: -128 }; - let isAudio = true; - await getThumbnailErrorSizeTest(done, testNum, dOp, size, isAudio); - }); - }); -} - diff --git a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetOpenCallback.test.ets b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetOpenCallback.test.ets deleted file mode 100755 index 2a4c78e36..000000000 --- a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetOpenCallback.test.ets +++ /dev/null @@ -1,450 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import userFileManager from '@ohos.filemanagement.userFileManager'; -import fileio from '@ohos.fileio'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; -import { - sleep, - audioFetchOps, - imageVideoFetchOps, - audioNameFetchOps, - imageVideoNameFetchOps, - isNum, - checkPresetsAssets, - checkAssetsCount, -} from '../../../../../../common'; -export default function fileAssetOpenCallbackTest(abilityContext) { - describe('fileAssetOpenCallbackTest', function () { - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - await checkPresetsAssets(userfilemgr, 'ActsUserFileMgrFileAssetJsTest') - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - const rOpenTest = async function (done, testNum, fetchOp, assetProps, expectCount, isAudio) { - let asset; - let fd; - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectCount); - if (!checkAssetCountPass) return; - asset = await fetchAssetResult.getFirstObject(); - fetchAssetResult.close(); - asset.open('r', async (err, fd) => { - if (err) { - console.info(`${testNum} :: err: ${err}`); - expect().assertFail(); - done(); - return; - } - expect(isNum(fd)).assertTrue(); - let buf = new ArrayBuffer(4096); - let res = await fileio.read(fd, buf); - console.log(' bytesRead: ' + res.bytesRead) - expect(res.bytesRead).assertEqual(assetProps.bytesRead); - try { - await fileio.write(fd, buf); - expect().assertFail(); - } catch (error) { - expect(true).assertTrue(); - await asset.close(fd); - } - done(); - }); - } catch (error) { - console.info(`${testNum} :: error: ${error}`); - expect().assertFail(); - await asset.close(fd); - done(); - } - } - - const wOpenTest = async function (done, testNum, fetchOp, assetProps, expectCount, isAudio) { - let asset, asset1; - let fd, fd1; - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectCount); - if (!checkAssetCountPass) return; - asset = await fetchAssetResult.getFirstObject(); - asset1 = await fetchAssetResult.getNextObject(); - fetchAssetResult.close(); - asset.open('w', async (err, fd) => { - if (err) { - console.info(`${testNum} :: err: ${err}`); - expect().assertFail(); - done(); - return; - } - expect(isNum(fd)).assertTrue(); - fd1 = await asset1.open('r'); - let buf = new ArrayBuffer(4096); - await fileio.read(fd1, buf); - let write = await fileio.write(fd, buf); - console.info(`${testNum} :: write: ${write}`); - expect(write).assertEqual(assetProps.write); - let buf1 = new ArrayBuffer(4096); - try { - await fileio.read(fd, buf1); - expect().assertFail(); - } catch (error) { - expect(true).assertTrue(); - } - done(); - }); - } catch (error) { - console.info(`${testNum} :: error: ${error}`); - expect(false).assertTrue(); - await asset.close(fd); - await asset1.close(fd1); - done(); - } - } - - const rwOpenTest = async function (done, testNum, fetchOp, assetProps, expectCount, isAudio) { - let asset, asset1; - let fd, fd1; - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectCount); - if (!checkAssetCountPass) return; - asset = await fetchAssetResult.getFirstObject(); - asset.open('rw', async (err, fd) => { - if (err) { - console.info(`${testNum} :: err: ${err}`); - expect().assertFail(); - done(); - return; - } - expect(isNum(fd)).assertTrue(); - let buf = new ArrayBuffer(4096); - let res = await fileio.read(fd, buf); - expect(res.bytesRead).assertEqual(assetProps.bytesRead); - asset1 = await fetchAssetResult.getNextObject(); - fd1 = await asset1.open('r'); - expect(isNum(fd1)).assertTrue(); - let buf1 = new ArrayBuffer(4096); - await fileio.read(fd1, buf1); - let write = await fileio.write(fd, buf1); - expect(write).assertEqual(assetProps.write); - console.info(`res.bytesRead:${res.bytesRead},write:${write}`) - console.info(`fd1:${fd1},fd:${fd}`) - await asset.close(fd); - await asset1.close(fd1); - fetchAssetResult.close(); - done(); - }); - } catch (error) { - console.info(`${testNum} :: error: ${error}`); - await asset.close(fd); - await asset1.close(fd1); - expect().assertFail(); - done(); - } - } - - const closeTest = async function (done, testNum, fetchOp, isAudio) { - let asset; - let fd; - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1); - if (!checkAssetCountPass) return; - const asset = await fetchAssetResult.getFirstObject(); - fd = await asset.open('r'); - expect(isNum(fd)).assertTrue(); - asset.close(fd, async (err) => { - if (err) { - console.info(`${testNum} :: err: ${err}`); - expect().assertFail(); - done(); - return; - } - let count = 0 - let buf = new ArrayBuffer(4096); - try { - await fileio.read(fd, buf); - } catch (error) { - count++ - } - try { - await fileio.write(fd, buf); - } catch (error) { - count++ - } - await sleep(1000) - expect(count).assertEqual(2); - done(); - }); - } catch (error) { - console.info(`${testNum} error:${error}`) - await asset.close(fd); - expect(false).assertTrue(); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_01_001 - * @tc.name : open('r') - * @tc.desc : open -r the type of image - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_01_001', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_01_001'; - let fetchOp = imageVideoFetchOps(testNum, 'Pictures/R_Cb/'); - let assetProps = { - bytesRead: 4096, - }; - let expectCount = 1; - let isAudio = false; - await rOpenTest(done, testNum, fetchOp, assetProps, expectCount, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_01_002 - * @tc.name : open('w') - * @tc.desc : open -w the type of image - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_01_002', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_01_002'; - let fetchOp = imageVideoFetchOps(testNum, 'Pictures/W_Cb/'); - let assetProps = { - write: 4096, - }; - let expectCount = 2; - let isAudio = false; - await wOpenTest(done, testNum, fetchOp, assetProps, expectCount, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_01_003 - * @tc.name : open('rw') - * @tc.desc : open -rw the type of image - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_01_003', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_01_003'; - let fetchOp = imageVideoFetchOps(testNum, 'Pictures/RW_Cb/'); - let assetProps = { - bytesRead: 4096, - write: 4096, - }; - let expectCount = 2; - let isAudio = false; - await rwOpenTest(done, testNum, fetchOp, assetProps, expectCount, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_02_001 - * @tc.name : open('r') - * @tc.desc : open -r the type of video - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_02_001', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_02_001'; - let fetchOp = imageVideoFetchOps(testNum, 'Videos/R_Cb/'); - let assetProps = { - bytesRead: 4096, - }; - let expectCount = 1; - let isAudio = false; - await rOpenTest(done, testNum, fetchOp, assetProps, expectCount, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_02_002 - * @tc.name : open('w') - * @tc.desc : open -w the type of video - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_02_002', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_02_002'; - let fetchOp = imageVideoFetchOps(testNum, 'Videos/W_Cb/'); - let assetProps = { - write: 4096, - }; - let expectCount = 2; - let isAudio = false; - await wOpenTest(done, testNum, fetchOp, assetProps, expectCount, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_02_003 - * @tc.name : open('rw') - * @tc.desc : open -rw the type of video - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_02_003', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_02_003'; - let fetchOp = imageVideoFetchOps(testNum, 'Videos/RW_Cb/'); - let assetProps = { - bytesRead: 4096, - write: 4096, - }; - let expectCount = 2; - let isAudio = false; - await rwOpenTest(done, testNum, fetchOp, assetProps, expectCount, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_03_001 - * @tc.name : open('r') - * @tc.desc : open -r the type of audio - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_03_001', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_03_001'; - let fetchOp = audioFetchOps(testNum, 'Audios/R_Cb/'); - let assetProps = { - bytesRead: 4096, - }; - let expectCount = 1; - let isAudio = true; - await rOpenTest(done, testNum, fetchOp, assetProps, expectCount, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_03_002 - * @tc.name : open('w') - * @tc.desc : open -w the type of audio - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_03_002', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_03_002'; - let fetchOp = audioFetchOps(testNum, 'Audios/W_Cb/'); - let assetProps = { - write: 4096, - }; - let expectCount = 2; - let isAudio = true; - await wOpenTest(done, testNum, fetchOp, assetProps, expectCount, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_03_003 - * @tc.name : open('rw') - * @tc.desc : open -rw the type of audio - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_03_003', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_OPEN_CALLBACK_03_003'; - let fetchOp = audioFetchOps(testNum, 'Audios/RW_Cb/'); - let assetProps = { - bytesRead: 4096, - write: 4096, - }; - let expectCount = 2; - let isAudio = true; - await rwOpenTest(done, testNum, fetchOp, assetProps, expectCount, isAudio); - }); - - //------------------------------------------------------------------------------------ - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_CLOSE_CALLBACK_01 - * @tc.name : close - * @tc.desc : asset close the type of image - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_CLOSE_CALLBACK_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_CLOSE_CALLBACK_01'; - let fetchOp = imageVideoNameFetchOps(testNum, 'Pictures/openClose/', '01.jpg'); - let isAudio = false; - await closeTest(done, testNum, fetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_CLOSE_CALLBACK_02 - * @tc.name : close - * @tc.desc : asset close the type of video - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_CLOSE_CALLBACK_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_CLOSE_CALLBACK_02'; - let fetchOp = imageVideoNameFetchOps(testNum, 'Videos/openClose/', '01.mp4'); - let isAudio = false; - await closeTest(done, testNum, fetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_CLOSE_CALLBACK_03 - * @tc.name : close - * @tc.desc : asset close the type of audio - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_CLOSE_CALLBACK_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_CLOSE_CALLBACK_03'; - let fetchOp = audioNameFetchOps(testNum, 'Audios/openClose/', '01.mp3'); - let isAudio = true; - await closeTest(done, testNum, fetchOp, isAudio); - }); - }); -} diff --git a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetOpenPromise.test.ets b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetOpenPromise.test.ets deleted file mode 100755 index 0dc81d060..000000000 --- a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetOpenPromise.test.ets +++ /dev/null @@ -1,426 +0,0 @@ -/* - * Copyright (C) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import fileio from '@ohos.fileio'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; -import { - sleep, - audioFetchOps, - imageVideoFetchOps, - audioNameFetchOps, - imageVideoNameFetchOps, - checkPresetsAssets, - checkAssetsCount, - isNum, -} from '../../../../../../common'; -export default function fileAssetOpenPromiseTest(abilityContext) { - describe('fileAssetOpenPromiseTest', function () { - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - await checkPresetsAssets(userfilemgr, 'ActsUserFileMgrFileAssetJsTest') - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - const rOpenTest = async function (done, testNum, fetchOp, assetProps, expectCount, isAudio) { - let asset; - let fd; - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectCount); - if (!checkAssetCountPass) return; - asset = await fetchAssetResult.getFirstObject(); - fetchAssetResult.close(); - fd = await asset.open('r'); - expect(isNum(fd)).assertTrue(); - let buf = new ArrayBuffer(4096); - let res = await fileio.read(fd, buf); - console.log(' bytesRead: ' + res.bytesRead) - expect(res.bytesRead).assertEqual(assetProps.bytesRead); - try { - await fileio.write(fd, buf); - expect().assertFail(); - } catch (error) { - expect(true).assertTrue(); - await asset.close(fd); - done(); - } - } catch (error) { - console.info(`${testNum} :: error: ${error}`); - expect().assertFail(); - await asset.close(fd); - done(); - } - } - - const wOpenTest = async function (done, testNum, fetchOp, assetProps, expectCount, isAudio) { - let asset, asset1; - let fd, fd1; - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectCount); - if (!checkAssetCountPass) return; - asset = await fetchAssetResult.getFirstObject(); - asset1 = await fetchAssetResult.getNextObject(); - fetchAssetResult.close(); - - fd = await asset.open('w'); - expect(isNum(fd)).assertTrue(); - fd1 = await asset1.open('r'); - let buf = new ArrayBuffer(4096); - await fileio.read(fd1, buf); - let write = await fileio.write(fd, buf); - console.info(`${testNum} :: write: ${write}`); - expect(write).assertEqual(assetProps.write); - let buf1 = new ArrayBuffer(4096); - try { - await fileio.read(fd, buf1); - expect().assertFail(); - - } catch (error) { - expect(true).assertTrue(); - - } - done(); - } catch (error) { - console.info(`${testNum} :: error: ${error}`); - expect(false).assertTrue(); - await asset.close(fd); - await asset1.close(fd1); - done(); - } - } - - const rwOpenTest = async function (done, testNum, fetchOp, assetProps, expectCount, isAudio) { - let asset, asset1; - let fd, fd1; - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, expectCount); - if (!checkAssetCountPass) return; - asset = await fetchAssetResult.getFirstObject(); - fd = await asset.open('rw'); - expect(isNum(fd)).assertTrue(); - let buf = new ArrayBuffer(4096); - let res = await fileio.read(fd, buf); - expect(res.bytesRead).assertEqual(assetProps.bytesRead); - asset1 = await fetchAssetResult.getNextObject(); - fd1 = await asset1.open('r'); - expect(isNum(fd1)).assertTrue(); - let buf1 = new ArrayBuffer(4096); - await fileio.read(fd1, buf1); - let write = await fileio.write(fd, buf1); - expect(write).assertEqual(assetProps.write); - console.info(`res.bytesRead:${res.bytesRead},write:${write}`) - console.info(`fd1:${fd1},fd:${fd}`) - await asset.close(fd); - await asset1.close(fd1); - fetchAssetResult.close(); - done(); - } catch (error) { - console.info(`${testNum} :: error: ${error}`); - await asset.close(fd); - await asset1.close(fd1); - expect().assertFail(); - done(); - } - } - - const closeTest = async function (done, testNum, fetchOp, isAudio) { - let asset; - let fd; - try { - let fetchAssetResult; - if (isAudio) { - fetchAssetResult = await userfilemgr.getAudioAssets(fetchOp); - } else { - fetchAssetResult = await userfilemgr.getPhotoAssets(fetchOp); - } - let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1); - if (!checkAssetCountPass) return; - const asset = await fetchAssetResult.getFirstObject(); - fd = await asset.open('r'); - expect(isNum(fd)).assertTrue(); - await asset.close(fd); - let count = 0 - let buf = new ArrayBuffer(4096); - try { - await fileio.read(fd, buf); - } catch (error) { - count++ - } - try { - await fileio.write(fd, buf); - } catch (error) { - count++ - } - await sleep(1000) - expect(count).assertEqual(2); - done(); - } catch (error) { - console.info(`${testNum} error:${error}`) - await asset.close(fd); - expect(false).assertTrue(); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_01_001 - * @tc.name : open('r') - * @tc.desc : open -r the type of image - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_01_001', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_01_001'; - let fetchOp = imageVideoFetchOps(testNum, 'Pictures/R_Pro/'); - let assetProps = { - bytesRead: 4096, - }; - let expectCount = 1; - let isAudio = false; - await rOpenTest(done, testNum, fetchOp, assetProps, expectCount, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_01_002 - * @tc.name : open('w') - * @tc.desc : open -w the type of image - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_01_002', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_01_002'; - let fetchOp = imageVideoFetchOps(testNum, 'Pictures/W_Pro/'); - let assetProps = { - write: 4096, - }; - let expectCount = 2; - let isAudio = false; - await wOpenTest(done, testNum, fetchOp, assetProps, expectCount, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_01_003 - * @tc.name : open('rw') - * @tc.desc : open -rw the type of image - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_01_003', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_01_003'; - let fetchOp = imageVideoFetchOps(testNum, 'Pictures/RW_Pro/'); - let assetProps = { - bytesRead: 4096, - write: 4096, - }; - let expectCount = 2; - let isAudio = false; - await rwOpenTest(done, testNum, fetchOp, assetProps, expectCount, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_02_001 - * @tc.name : open('r') - * @tc.desc : open -r the type of video - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_02_001', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_02_001'; - let fetchOp = imageVideoFetchOps(testNum, 'Videos/R_Pro/'); - let assetProps = { - bytesRead: 4096, - }; - let expectCount = 1; - let isAudio = false; - await rOpenTest(done, testNum, fetchOp, assetProps, expectCount, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_02_002 - * @tc.name : open('w') - * @tc.desc : open -w the type of video - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_02_002', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_02_002'; - let fetchOp = imageVideoFetchOps(testNum, 'Videos/W_Pro/'); - let assetProps = { - write: 4096, - }; - let expectCount = 2; - let isAudio = false; - await wOpenTest(done, testNum, fetchOp, assetProps, expectCount, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_02_003 - * @tc.name : open('rw') - * @tc.desc : open -rw the type of video - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_02_003', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_02_003'; - let fetchOp = imageVideoFetchOps(testNum, 'Videos/RW_Pro/'); - let assetProps = { - bytesRead: 4096, - write: 4096, - }; - let expectCount = 2; - let isAudio = false; - await rwOpenTest(done, testNum, fetchOp, assetProps, expectCount, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_03_001 - * @tc.name : open('r') - * @tc.desc : open -r the type of audio - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_03_001', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_03_001'; - let fetchOp = audioFetchOps(testNum, 'Audios/R_Pro/'); - let assetProps = { - bytesRead: 4096, - }; - let expectCount = 1; - let isAudio = true; - await rOpenTest(done, testNum, fetchOp, assetProps, expectCount, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_03_002 - * @tc.name : open('w') - * @tc.desc : open -w the type of audio - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_03_002', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_03_002'; - let fetchOp = audioFetchOps(testNum, 'Audios/W_Pro/'); - let assetProps = { - write: 4096, - }; - let expectCount = 2; - let isAudio = true; - await wOpenTest(done, testNum, fetchOp, assetProps, expectCount, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_03_003 - * @tc.name : open('rw') - * @tc.desc : open -rw the type of audio - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_03_003', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_OPEN_PROMISE_03_003'; - let fetchOp = audioFetchOps(testNum, 'Audios/RW_Pro/'); - let assetProps = { - bytesRead: 4096, - write: 4096, - }; - let expectCount = 2; - let isAudio = true; - await rwOpenTest(done, testNum, fetchOp, assetProps, expectCount, isAudio); - }); - - //-------------------------------------------------------------------------------- - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_CLOSE_PROMISE_01 - * @tc.name : close - * @tc.desc : asset close the type of image - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_CLOSE_PROMISE_01', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_CLOSE_PROMISE_01'; - let fetchOp = imageVideoNameFetchOps(testNum, 'Pictures/openClose/', '02.jpg'); - let isAudio = false; - await closeTest(done, testNum, fetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_CLOSE_PROMISE_02 - * @tc.name : close - * @tc.desc : asset close the type of video - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_CLOSE_PROMISE_02', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_CLOSE_PROMISE_02'; - let fetchOp = imageVideoNameFetchOps(testNum, 'Videos/openClose/', '02.mp4'); - let isAudio = false; - await closeTest(done, testNum, fetchOp, isAudio); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_FILEASSET_CLOSE_PROMISE_03 - * @tc.name : close - * @tc.desc : asset close the type of audio - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 2 - */ - it('SUB_USERFILE_MGR_FILEASSET_CLOSE_PROMISE_03', 2, async function (done) { - let testNum = 'SUB_USERFILE_MGR_FILEASSET_CLOSE_PROMISE_03'; - let fetchOp = audioNameFetchOps(testNum, 'Audios/openClose/', '02.mp3'); - let isAudio = true; - await closeTest(done, testNum, fetchOp, isAudio); - }); - }); -} diff --git a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/module.json b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/module.json deleted file mode 100755 index eea188f92..000000000 --- a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/module.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:mainability_description", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default", - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "ohos.acts.multimedia.userfilemgr.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:mainability_description", - "icon": "$media:icon", - "label": "$string:entry_MainAbility", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities":[ - "entity.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.GET_BUNDLE_INFO", - "reason": "use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name" : "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", - "reason" : "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" - }, - { - "name" : "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", - "reason" : "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS" - }, - { - "name": "ohos.permission.MEDIA_LOCATION", - "reason":"use ohos.permission.MEDIA_LOCATION" - }, - { - "name": "ohos.permission.READ_IMAGEVIDEO", - "reason":"use ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.READ_AUDIO", - "reason":"use ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.READ_DOCUMENT", - "reason":"use ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.WRITE_IMAGEVIDEO", - "reason":"use ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.WRITE_AUDIO", - "reason":"use ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.WRITE_DOCUMENT", - "reason":"use ohos.permission.WRITE_MEDIA" - } - ] - } -} diff --git a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/resources/base/element/string.json b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/resources/base/element/string.json deleted file mode 100755 index d75a3fee6..000000000 --- a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "MediaLibraryJSTestMain" - }, - { - "name": "mainability_description", - "value": "MediaLibraryJSTestMain Ability" - } - ] - } \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/resources/base/media/icon.png b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/resources/base/media/icon.png deleted file mode 100755 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p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oE$7$mY`MOJorI=+mMx?H;`pr!;fVYz?5~yXBACruWB`Ph zZM}90_<^OBxIhyZ9BW$`>6JvO;%VFpqVr8|7t3~AmxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}y' + JSON.stringify(globalThis.abilityWant.parameters)) - globalThis.abilityWant.parameters.timeout = 70000; - configService.setConfig(globalThis.abilityWant.parameters) - console.info('testsuite()---->') - testsuite(globalThis.abilityContext) - core.execute() - console.info('core.execute()---->') - } - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World') - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(25) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/ets/pages/second/second.ets b/multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/ets/pages/second/second.ets deleted file mode 100755 index 1f2a06b64..000000000 --- a/multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/ets/pages/second/second.ets +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import router from '@system.router'; - -@Entry -@Component -struct Second { - private content: string = "Second Page" - - build() { - Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text(`${this.content}`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('back to index') - .fontSize(20) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - router.back() - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/ets/test/List.test.ets b/multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/ets/test/List.test.ets deleted file mode 100755 index 8742e87b8..000000000 --- a/multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileMgrNoPermissionCallback from './userFileMgrNoPermissionCallback.test.ets' -import userFileMgrNoPermissionPromise from './userFileMgrNoPermissionPromise.test.ets' -export default function testsuite(abilityContext) { - userFileMgrNoPermissionCallback(abilityContext) - userFileMgrNoPermissionPromise(abilityContext) -} diff --git a/multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/ets/test/userFileMgrNoPermissionCallback.test.ets b/multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/ets/test/userFileMgrNoPermissionCallback.test.ets deleted file mode 100755 index 0a8b665f4..000000000 --- a/multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/ets/test/userFileMgrNoPermissionCallback.test.ets +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; - -import { - sleep, - allFetchOp, -} from '../../../../../../common'; - - -export default function userFileMgrNoPermissionCallback(abilityContext) { - describe('userFileMgrNoPermissionCallback', function () { - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - const getPhotoAlbumsTest = async function (done, testNum) { - try { - await userfilemgr.getPhotoAlbums(allFetchOp(), async (err, fetchAlbumResult) => { - if (err != undefined) { - console.info(`${testNum}, err: ${err}`); - expect(true).assertTrue(); - done(); - return; - } - expect(false).assertTrue(); - done(); - }) - } catch (error) { - console.info(`${testNum}, failed error: ${error}`) - expect(false).assertTrue(); - done(); - } - } - - const getPhotoAssetsTest = async function (done, testNum) { - try { - await userfilemgr.getPhotoAssets(allFetchOp(), async (err, fetchAssetResult) => { - if (err != undefined) { - console.info(`${testNum}, err: ${err}`); - expect(true).assertTrue(); - done(); - return; - } - expect(false).assertTrue(); - done(); - }) - } catch (error) { - console.info(`${testNum}, failed error: ${error}`) - expect(false).assertTrue(); - done(); - } - } - - const getAudioAssetsTest = async function (done, testNum) { - try { - await userfilemgr.getAudioAssets(allFetchOp(), async (err, fetchAssetResult) => { - if (err != undefined) { - console.info(`${testNum}, err: ${err}`); - expect(true).assertTrue(); - done(); - return; - } - expect(false).assertTrue(); - done(); - }) - } catch (error) { - console.info(`${testNum}, failed error: ${error}`) - expect(false).assertTrue(); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOALBUMS_NOPERMISSION_CALLBACK_01 - * @tc.name : getPhotoAlbums - * @tc.desc : getPhotoAlbums with no permission - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('SUB_USERFILE_MGR_GETPHOTOALBUMS_NOPERMISSION_CALLBACK_01', 1, async function (done) { - const testNum = 'SUB_USERFILE_MGR_GETPHOTOALBUMS_NOPERMISSION_CALLBACK_01'; - await getPhotoAlbumsTest(done, testNum); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETS_NOPERMISSION_CALLBACK_01 - * @tc.name : getPhotoAssets - * @tc.desc : getPhotoAssets with no permission - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETS_NOPERMISSION_CALLBACK_01', 1, async function (done) { - const testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETS_NOPERMISSION_CALLBACK_01'; - await getPhotoAssetsTest(done, testNum); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETAUDIOASSETS_NOPERMISSION_CALLBACK_01 - * @tc.name : getAudioAssets - * @tc.desc : getAudioAssets with no permission - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('SUB_USERFILE_MGR_GETAUDIOASSETS_NOPERMISSION_CALLBACK_01', 1, async function (done) { - const testNum = 'SUB_USERFILE_MGR_GETAUDIOASSETS_NOPERMISSION_CALLBACK_01'; - await getAudioAssetsTest(done, testNum); - }); - }); -} - - diff --git a/multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/ets/test/userFileMgrNoPermissionPromise.test.ets b/multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/ets/test/userFileMgrNoPermissionPromise.test.ets deleted file mode 100755 index f48ed9d30..000000000 --- a/multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/ets/test/userFileMgrNoPermissionPromise.test.ets +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import userFileManager from '@ohos.filemanagement.userFileManager'; -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; - -import { - sleep, - allFetchOp, -} from '../../../../../../common'; - - -export default function userFileMgrNoPermissionPromise(abilityContext) { - describe('userFileMgrNoPermissionPromise', function () { - const userfilemgr = userFileManager.getUserFileMgr(abilityContext); - beforeAll(async function () { - console.info('beforeAll case'); - }); - beforeEach(function () { - console.info('beforeEach case'); - }); - afterEach(async function () { - console.info('afterEach case'); - await sleep() - }); - afterAll(function () { - console.info('afterAll case'); - }); - - const getPhotoAlbumsTest = async function (done, testNum) { - try { - await userfilemgr.getPhotoAlbums(allFetchOp()); - expect(false).assertTrue(); - done(); - } catch (error) { - console.info(`${testNum}, failed error: ${error}`) - expect(true).assertTrue(); - done(); - } - } - - const getPhotoAssetsTest = async function (done, testNum) { - try { - await userfilemgr.getPhotoAssets(allFetchOp()); - expect(false).assertTrue(); - done(); - } catch (error) { - console.info(`${testNum}, failed error: ${error}`) - expect(true).assertTrue(); - done(); - } - } - - const getAudioAssetsTest = async function (done, testNum) { - try { - await userfilemgr.getAudioAssets(allFetchOp()); - expect(false).assertTrue(); - done(); - } catch (error) { - console.info(`${testNum}, failed error: ${error}`) - expect(true).assertTrue(); - done(); - } - } - - /** - * @tc.number : SUB_USERFILE_MGR_GETALBUMS_NOPERMISSION_PROMISE_01 - * @tc.name : getPhotoAlbums - * @tc.desc : getPhotoAlbums with no permission - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('SUB_USERFILE_MGR_GETALBUMS_NOPERMISSION_PROMISE_01', 1, async function (done) { - const testNum = 'SUB_USERFILE_MGR_GETALBUMS_NOPERMISSION_PROMISE_01'; - await getPhotoAlbumsTest(done, testNum); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETPHOTOASSETS_NOPERMISSION_PROMISE_01 - * @tc.name : getPhotoAssets - * @tc.desc : getPhotoAssets with no permission - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('SUB_USERFILE_MGR_GETPHOTOASSETS_NOPERMISSION_PROMISE_01', 1, async function (done) { - const testNum = 'SUB_USERFILE_MGR_GETPHOTOASSETS_NOPERMISSION_PROMISE_01'; - await getPhotoAssetsTest(done, testNum); - }); - - /** - * @tc.number : SUB_USERFILE_MGR_GETAUDIOASSETS_NOPERMISSION_PROMISE_01 - * @tc.name : getAudioAssets - * @tc.desc : getAudioAssets with no permission - * @tc.size : MEDIUM - * @tc.type : Function - * @tc.level : Level 1 - */ - it('SUB_USERFILE_MGR_GETAUDIOASSETS_NOPERMISSION_PROMISE_01', 1, async function (done) { - const testNum = 'SUB_USERFILE_MGR_GETAUDIOASSETS_NOPERMISSION_PROMISE_01'; - await getAudioAssetsTest(done, testNum); - }); - }); -} - - diff --git a/multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/module.json b/multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/module.json deleted file mode 100755 index 0bb8c230e..000000000 --- a/multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/module.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:mainability_description", - "mainElement": "MainAbility", - "deviceTypes": [ - "tablet", - "default", - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "ohos.acts.multimedia.userfilemgr.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:mainability_description", - "icon": "$media:icon", - "label": "$string:entry_MainAbility", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities":[ - "entity.system.home" - ] - } - ] - } - ], - "requestPermissions": [ - { - "name": "ohos.permission.GET_BUNDLE_INFO", - "reason": "use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name" : "ohos.permission.GRANT_SENSITIVE_PERMISSIONS", - "reason" : "use ohos.permission.GRANT_SENSITIVE_PERMISSIONS" - }, - { - "name" : "ohos.permission.REVOKE_SENSITIVE_PERMISSIONS", - "reason" : "use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS" - }, - { - "name": "ohos.permission.MEDIA_LOCATION", - "reason":"use ohos.permission.MEDIA_LOCATION" - }, - { - "name": "ohos.permission.READ_IMAGEVIDEO", - "reason":"use ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.READ_AUDIO", - "reason":"use ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.READ_DOCUMENT", - "reason":"use ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.WRITE_IMAGEVIDEO", - "reason":"use ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.WRITE_AUDIO", - "reason":"use ohos.permission.WRITE_MEDIA" - }, - { - "name": "ohos.permission.WRITE_DOCUMENT", - "reason":"use ohos.permission.WRITE_MEDIA" - } - ] - } -} diff --git a/multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/resources/base/element/string.json b/multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/resources/base/element/string.json deleted file mode 100755 index 32237ee20..000000000 --- a/multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "string": [ - { - "name": "entry_MainAbility", - "value": "MediaLibraryJSTestMain" - }, - { - "name": "mainability_description", - "value": "MediaLibraryJSTestMain Ability" - } - ] - } \ No newline at end of file diff --git a/multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/resources/base/media/icon.png b/multimedia/userfilemgr/userfilemgr_noPermission/entry/src/main/resources/base/media/icon.png deleted file mode 100755 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4ZzgdeKtgoc+o5EvN9A1K1_<>M?MBqb#!ASf&# zEX?<)!RH(7>1P+j=jqG(58}TVN-$psA6K}atCuI!KTJD&FMmH-78ZejBm)0qc{ESp z|LuG1{QnBUJRg_E=h1#XMWt2%fcoN@l7eAS!Es?Q+;XsRNPhiiE=@AqlLkJzF`O18 zbsbSmKN=aaq8k3NFYZfDWpKmM!coBU0(XnL8R{4=i|wi{!uWYM2je{U{B*K2PVdu&=E zTq*-XsEsJ$u5H4g6DIm2Y!DN`>^v|AqlwuCD;w45K0@eqauiqWf7l&o)+YLHm~|L~ z7$0v5mkobriU!H<@mVJHLlmQqzQ3d6Rh_-|%Yy2li*tHO>_vcnuZ7OR_xkAIuIU&x z-|8Y0wj|6|a6_I(v91y%k_kNw6pnkNdxjqG8!%Vz_d%c_!X+6-;1`GC9_FpjoHev5fEV7RhJ>r=mh-jp$fqbqRJ=obwdgLDVP5+s zy1=_DWG0Y-Jb3t^WXmkr(d9~08k-|#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