Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
59c50192
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
接近 2 年 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
59c50192
编写于
6月 15, 2023
作者:
Y
yangbo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
Signed-off-by:
N
yangbo
<
yangbo258@huawei.com
>
上级
435ea842
变更
31
隐藏空白更改
内联
并排
Showing
31 changed file
with
218 addition
and
468 deletion
+218
-468
multimedia/medialibrary/common.js
multimedia/medialibrary/common.js
+1
-4
multimedia/medialibrary/mediaLibrary_album/Test.json
multimedia/medialibrary/mediaLibrary_album/Test.json
+9
-3
multimedia/medialibrary/mediaLibrary_album/entry/src/main/ets/test/albumGetFileAssetsCallback.test.ets
...try/src/main/ets/test/albumGetFileAssetsCallback.test.ets
+26
-87
multimedia/medialibrary/mediaLibrary_album/entry/src/main/ets/test/albumGetFileAssetsPromise.test.ets
...ntry/src/main/ets/test/albumGetFileAssetsPromise.test.ets
+30
-91
multimedia/medialibrary/mediaLibrary_album/entry/src/main/ets/test/albumTestCallBack.test.ets
..._album/entry/src/main/ets/test/albumTestCallBack.test.ets
+23
-102
multimedia/medialibrary/mediaLibrary_album/entry/src/main/ets/test/albumTestPromise.test.ets
...y_album/entry/src/main/ets/test/albumTestPromise.test.ets
+27
-111
multimedia/medialibrary/mediaLibrary_base/Test.json
multimedia/medialibrary/mediaLibrary_base/Test.json
+8
-2
multimedia/medialibrary/mediaLibrary_base/entry/src/main/ets/test/mediaLibraryTestCallback.test.ets
...entry/src/main/ets/test/mediaLibraryTestCallback.test.ets
+1
-1
multimedia/medialibrary/mediaLibrary_base/entry/src/main/ets/test/mediaLibraryTestPromise.test.ets
.../entry/src/main/ets/test/mediaLibraryTestPromise.test.ets
+1
-1
multimedia/medialibrary/mediaLibrary_base/entry/src/main/ets/test/mediaLibraryTestPromiseOnOff.test.ets
...y/src/main/ets/test/mediaLibraryTestPromiseOnOff.test.ets
+1
-1
multimedia/medialibrary/mediaLibrary_favorite/Test.json
multimedia/medialibrary/mediaLibrary_favorite/Test.json
+8
-2
multimedia/medialibrary/mediaLibrary_favorite/entry/src/main/ets/test/favoriteTestCallback.test.ets
...ite/entry/src/main/ets/test/favoriteTestCallback.test.ets
+1
-1
multimedia/medialibrary/mediaLibrary_favorite/entry/src/main/ets/test/favoriteTestPromise.test.ets
...rite/entry/src/main/ets/test/favoriteTestPromise.test.ets
+1
-1
multimedia/medialibrary/mediaLibrary_file/Test.json
multimedia/medialibrary/mediaLibrary_file/Test.json
+8
-2
multimedia/medialibrary/mediaLibrary_file/entry/src/main/ets/test/fileTestCallback.test.ets
...ry_file/entry/src/main/ets/test/fileTestCallback.test.ets
+1
-1
multimedia/medialibrary/mediaLibrary_file/entry/src/main/ets/test/fileTestPromise.test.ets
...ary_file/entry/src/main/ets/test/fileTestPromise.test.ets
+1
-1
multimedia/medialibrary/mediaLibrary_fileAsset/Test.json
multimedia/medialibrary/mediaLibrary_fileAsset/Test.json
+8
-2
multimedia/medialibrary/mediaLibrary_fileAsset/entry/src/main/ets/test/fileAssetCallback2.test.ets
...Asset/entry/src/main/ets/test/fileAssetCallback2.test.ets
+1
-1
multimedia/medialibrary/mediaLibrary_fileAsset/entry/src/main/ets/test/fileAssetPromise2.test.ets
...eAsset/entry/src/main/ets/test/fileAssetPromise2.test.ets
+1
-1
multimedia/medialibrary/mediaLibrary_fileKey/Test.json
multimedia/medialibrary/mediaLibrary_fileKey/Test.json
+8
-2
multimedia/medialibrary/mediaLibrary_fileKey/entry/src/main/ets/test/filekeyTestCallback.test.ets
...eKey/entry/src/main/ets/test/filekeyTestCallback.test.ets
+1
-18
multimedia/medialibrary/mediaLibrary_fileKey/entry/src/main/ets/test/filekeyTestPromise.test.ets
...leKey/entry/src/main/ets/test/filekeyTestPromise.test.ets
+1
-18
multimedia/medialibrary/mediaLibrary_fileResult/Test.json
multimedia/medialibrary/mediaLibrary_fileResult/Test.json
+8
-2
multimedia/medialibrary/mediaLibrary_getExifNoLocation/Test.json
...dia/medialibrary/mediaLibrary_getExifNoLocation/Test.json
+8
-2
multimedia/medialibrary/mediaLibrary_getExiflocation/Test.json
...media/medialibrary/mediaLibrary_getExiflocation/Test.json
+8
-2
multimedia/medialibrary/mediaLibrary_getThumbnail/Test.json
multimedia/medialibrary/mediaLibrary_getThumbnail/Test.json
+8
-2
multimedia/medialibrary/mediaLibrary_mediafetchoptions/Test.json
...dia/medialibrary/mediaLibrary_mediafetchoptions/Test.json
+8
-2
multimedia/medialibrary/mediaLibrary_mediafetchoptions/entry/src/main/ets/test/mediafetchoptionsCallback.test.ets
...ntry/src/main/ets/test/mediafetchoptionsCallback.test.ets
+1
-1
multimedia/medialibrary/mediaLibrary_trash/Test.json
multimedia/medialibrary/mediaLibrary_trash/Test.json
+8
-2
multimedia/medialibrary/mediaLibrary_trash/entry/src/main/ets/test/trashCallback.test.ets
...rary_trash/entry/src/main/ets/test/trashCallback.test.ets
+1
-1
multimedia/medialibrary/mediaLibrary_trash/entry/src/main/ets/test/trashPromise.test.ets
...brary_trash/entry/src/main/ets/test/trashPromise.test.ets
+1
-1
未找到文件。
multimedia/medialibrary/common.js
浏览文件 @
59c50192
/*
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -95,9 +95,6 @@ const fileIdFetchOps = function (testNum, id) {
...
@@ -95,9 +95,6 @@ const fileIdFetchOps = function (testNum, id) {
};
};
const
albumFetchOps
=
function
(
testNum
,
albumName
,
others
)
{
const
albumFetchOps
=
function
(
testNum
,
albumName
,
others
)
{
// if (!others) {
// others = { order: FILEKEY.DATE_ADDED + " DESC" };
// }
let
ops
=
{
let
ops
=
{
selections
:
ALBUM_NAME
+
"
= ?
"
,
selections
:
ALBUM_NAME
+
"
= ?
"
,
selectionArgs
:
[
albumName
],
selectionArgs
:
[
albumName
],
...
...
multimedia/medialibrary/mediaLibrary_album/Test.json
浏览文件 @
59c50192
...
@@ -18,9 +18,8 @@
...
@@ -18,9 +18,8 @@
"scanner"
,
"scanner"
,
"sleep 5"
,
"sleep 5"
,
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*"
,
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*"
,
"kill
all com.ohos.medialibrary.medialibrarydata
"
,
"kill
-9 `pidof com.ohos.medialibrary.medialibrarydata`
"
,
"sleep 3"
,
"sleep 3"
,
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}"
,
"mkdir /storage/media/100/local/temp"
,
"mkdir /storage/media/100/local/temp"
,
"param set persist.ace.testmode.enabled 1"
,
"param set persist.ace.testmode.enabled 1"
,
"power-shell wakeup"
,
"power-shell wakeup"
,
...
@@ -56,7 +55,14 @@
...
@@ -56,7 +55,14 @@
"sleep 10"
"sleep 10"
],
],
"teardown-command"
:
[
"teardown-command"
:
[
"power-shell setmode 600"
"power-shell setmode 600"
,
"rm -rf /storage/media/100/local/temp"
,
"rm -rf /storage/media/100/local/files/*"
,
"rm -rf /storage/media/100/local/files/.*"
,
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"sleep 5"
]
]
},
},
{
{
...
...
multimedia/medialibrary/mediaLibrary_album/entry/src/main/ets/test/albumGetFileAssetsCallback.test.ets
浏览文件 @
59c50192
/*
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -57,7 +57,7 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
...
@@ -57,7 +57,7 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
const albumCountPass = await checkAlbumsCount(done, testNum, albumList, expectAlbumCount);
const albumCountPass = await checkAlbumsCount(done, testNum, albumList, expectAlbumCount);
if (!albumCountPass) return;
if (!albumCountPass) return;
// one asset type
// one asset type
let count = 0;
let count = 0;
for (let i = 0; i < albumList.length; i++) {
for (let i = 0; i < albumList.length; i++) {
albumList[i].getFileAssets(allFetchOp(), (err, fetchFileResult) => {
albumList[i].getFileAssets(allFetchOp(), (err, fetchFileResult) => {
...
@@ -118,6 +118,7 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
...
@@ -118,6 +118,7 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
done();
done();
}
}
}
}
const abnormalAlbumAssetsCount = async function (done, testNum, fetchOp, expectAssetsCount, expectAlbumCount = 1) {
const abnormalAlbumAssetsCount = async function (done, testNum, fetchOp, expectAssetsCount, expectAlbumCount = 1) {
try {
try {
const albumList = await media.getAlbums(fetchOp);
const albumList = await media.getAlbums(fetchOp);
...
@@ -144,7 +145,7 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
...
@@ -144,7 +145,7 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
done();
done();
}
}
}
}
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_01
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_01
* @tc.name : getFileAssets
* @tc.name : getFileAssets
...
@@ -160,21 +161,6 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
...
@@ -160,21 +161,6 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount)
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount)
});
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_02
* @tc.name : getFileAssets
* @tc.desc : check Videos album count,check asset count
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_02', 0, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_02';
let assetsCount = [2];
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Videos']);
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount)
});
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_03
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_03
* @tc.name : getFileAssets
* @tc.name : getFileAssets
...
@@ -209,16 +195,16 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
...
@@ -209,16 +195,16 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_05
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_05
* @tc.name : getFileAssets
* @tc.name : getFileAssets
* @tc.desc : check
two
albums count,check asset count
* @tc.desc : check albums count,check asset count
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_05',
0
, async function (done) {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_05',
2
, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_05';
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_05';
let assetsCount = [2, 1];
let assetsCount = [2, 1];
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['
Video
s', 'Camera']);
const currentFetchOp = fileFetchOption(testNum, selections, ['
Screenshot
s', 'Camera']);
let albumCount = 2;
let albumCount = 2;
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount, albumCount)
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount, albumCount)
});
});
...
@@ -226,34 +212,17 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
...
@@ -226,34 +212,17 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_06
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_06
* @tc.name : getFileAssets
* @tc.name : getFileAssets
* @tc.desc : check
three
albums count,check asset count
* @tc.desc : check albums count,check asset count
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_06',
0
, async function (done) {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_06',
2
, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_06';
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_06';
let assetsCount = [2,
2,
1];
let assetsCount = [2, 1];
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Videos', 'Screenshots', 'Camera']);
const currentFetchOp = fileFetchOption(testNum, selections, ['ScreenRecordings', 'Screenshots', 'Camera']);
let albumCount = 3;
let albumCount = 2;
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount, albumCount)
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_07
* @tc.name : getFileAssets
* @tc.desc : check four albums count,check asset count
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_07', 0, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_07';
let assetsCount = [2, 2, 1];
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'Videos', 'Screenshots', 'ScreenRecordings']);
let albumCount = 3;
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount, albumCount)
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount, albumCount)
});
});
...
@@ -263,39 +232,24 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
...
@@ -263,39 +232,24 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
* @tc.desc : Camera album,abnormal option
* @tc.desc : Camera album,abnormal option
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_01',
0
, async function (done) {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_01',
2
, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_01';
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_01';
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']);
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']);
let assetsCount = 0;
let assetsCount = 0;
await abnormalAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount)
await abnormalAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount)
});
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_02
* @tc.name : getFileAssets
* @tc.desc : Videos album,abnormal option
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_02', 0, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_02';
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Videos']);
let assetsCount = 0;
await abnormalAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount)
});
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_03
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_03
* @tc.name : getFileAssets
* @tc.name : getFileAssets
* @tc.desc : Screenshots album,abnormal option
* @tc.desc : Screenshots album,abnormal option
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_03',
0
, async function (done) {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_03',
2
, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_03';
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_03';
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Screenshots']);
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Screenshots']);
let assetsCount = 0;
let assetsCount = 0;
...
@@ -308,9 +262,9 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
...
@@ -308,9 +262,9 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
* @tc.desc : ScreenRecordings album,abnormal option
* @tc.desc : ScreenRecordings album,abnormal option
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_04',
0
, async function (done) {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_04',
2
, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_04';
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_04';
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['ScreenRecordings']);
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['ScreenRecordings']);
let assetsCount = 0;
let assetsCount = 0;
...
@@ -323,39 +277,24 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
...
@@ -323,39 +277,24 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
* @tc.desc : Camera album,no option
* @tc.desc : Camera album,no option
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_01',
0
, async function (done) {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_01',
2
, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_01';
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_01';
let assetsCount = 1;
let assetsCount = 1;
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']);
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']);
await checkAlbumAssetsNoOps(done, testNum, currentFetchOp, assetsCount)
await checkAlbumAssetsNoOps(done, testNum, currentFetchOp, assetsCount)
});
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_02
* @tc.name : getFileAssets
* @tc.desc : Videos album,no option
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_02', 0, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_02';
let assetsCount = 2;
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Videos']);
await checkAlbumAssetsNoOps(done, testNum, currentFetchOp, assetsCount)
});
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_03
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_03
* @tc.name : getFileAssets
* @tc.name : getFileAssets
* @tc.desc : Screenshots album,no option
* @tc.desc : Screenshots album,no option
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_03',
0
, async function (done) {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_03',
2
, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_03';
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_03';
let assetsCount = 2;
let assetsCount = 2;
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Screenshots']);
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Screenshots']);
...
@@ -368,9 +307,9 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
...
@@ -368,9 +307,9 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
* @tc.desc : ScreenRecordings album,no option
* @tc.desc : ScreenRecordings album,no option
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_04',
0
, async function (done) {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_04',
2
, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_04';
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_04';
let assetsCount = 2;
let assetsCount = 2;
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['ScreenRecordings']);
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['ScreenRecordings']);
...
...
multimedia/medialibrary/mediaLibrary_album/entry/src/main/ets/test/albumGetFileAssetsPromise.test.ets
浏览文件 @
59c50192
/*
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -78,6 +78,7 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
...
@@ -78,6 +78,7 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
done();
done();
}
}
};
};
const checkAlbumAssetsNoOps = async function (done, testNum, fetchOp, expectAssetsCount, expectAlbumCount = 1) {
const checkAlbumAssetsNoOps = async function (done, testNum, fetchOp, expectAssetsCount, expectAlbumCount = 1) {
try {
try {
const albumList = await media.getAlbums(fetchOp);
const albumList = await media.getAlbums(fetchOp);
...
@@ -86,7 +87,6 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
...
@@ -86,7 +87,6 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
if (!albumCountPass) return;
if (!albumCountPass) return;
const album = albumList[0];
const album = albumList[0];
let fetchFileResult = await album.getFileAssets();
let fetchFileResult = await album.getFileAssets();
if (fetchFileResult == undefined) {
if (fetchFileResult == undefined) {
console.info(`${testNum} fetchFileResult undefined`);
console.info(`${testNum} fetchFileResult undefined`);
...
@@ -104,6 +104,7 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
...
@@ -104,6 +104,7 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
done();
done();
}
}
};
};
const abnormalAlbumAssetsCount = async function (
const abnormalAlbumAssetsCount = async function (
done,
done,
testNum,
testNum,
...
@@ -135,6 +136,7 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
...
@@ -135,6 +136,7 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
done();
done();
}
}
};
};
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_01
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_01
* @tc.name : getFileAssets
* @tc.name : getFileAssets
...
@@ -150,21 +152,6 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
...
@@ -150,21 +152,6 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount)
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount)
});
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_02
* @tc.name : getFileAssets
* @tc.desc : check Videos album count,check asset count
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_02', 0, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_02';
let assetsCount = [2];
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Videos']);
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount)
});
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_03
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_03
* @tc.name : getFileAssets
* @tc.name : getFileAssets
...
@@ -199,16 +186,16 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
...
@@ -199,16 +186,16 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_05
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_05
* @tc.name : getFileAssets
* @tc.name : getFileAssets
* @tc.desc : check
two
albums count,check asset count
* @tc.desc : check albums count,check asset count
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_05',
0
, async function (done) {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_05',
2
, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_05';
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_05';
let assetsCount = [2, 1];
let assetsCount = [2, 1];
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['
Video
s', 'Camera']);
const currentFetchOp = fileFetchOption(testNum, selections, ['
Screenshot
s', 'Camera']);
let albumCount = 2;
let albumCount = 2;
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount, albumCount)
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount, albumCount)
});
});
...
@@ -216,34 +203,17 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
...
@@ -216,34 +203,17 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_06
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_06
* @tc.name : getFileAssets
* @tc.name : getFileAssets
* @tc.desc : check
three
albums count,check asset count
* @tc.desc : check albums count,check asset count
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_06',
0
, async function (done) {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_06',
2
, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_06';
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_06';
let assetsCount = [2,
2,
1];
let assetsCount = [2, 1];
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'Videos', 'Screenshots']);
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'ScreenRecordings', 'Screenshots']);
let albumCount = 3;
let albumCount = 2;
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount, albumCount)
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_07
* @tc.name : getFileAssets
* @tc.desc : check four albums count,check asset count
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_07', 0, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_07';
let assetsCount = [2, 2, 1];
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'Videos', 'Screenshots', 'ScreenRecordings']);
let albumCount = 3;
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount, albumCount)
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount, albumCount)
});
});
...
@@ -253,39 +223,24 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
...
@@ -253,39 +223,24 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
* @tc.desc : Camera album,abnormal option
* @tc.desc : Camera album,abnormal option
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_01',
0
, async function (done) {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_01',
2
, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_01';
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_01';
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']);
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']);
let assetsCount = 0;
let assetsCount = 0;
await abnormalAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount)
await abnormalAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount)
});
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_02
* @tc.name : getFileAssets
* @tc.desc : Videos album,abnormal option
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_02', 0, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_02';
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Videos']);
let assetsCount = 0;
await abnormalAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount)
});
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_03
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_03
* @tc.name : getFileAssets
* @tc.name : getFileAssets
* @tc.desc : Screenshots album,abnormal option
* @tc.desc : Screenshots album,abnormal option
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_03',
0
, async function (done) {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_03',
2
, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_03';
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_03';
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Screenshots']);
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Screenshots']);
let assetsCount = 0;
let assetsCount = 0;
...
@@ -298,9 +253,9 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
...
@@ -298,9 +253,9 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
* @tc.desc : ScreenRecordings album,abnormal option
* @tc.desc : ScreenRecordings album,abnormal option
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_04',
0
, async function (done) {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_04',
2
, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_04';
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_04';
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['ScreenRecordings']);
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['ScreenRecordings']);
let assetsCount = 0;
let assetsCount = 0;
...
@@ -313,39 +268,24 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
...
@@ -313,39 +268,24 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
* @tc.desc : Camera album,no option
* @tc.desc : Camera album,no option
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_01',
0
, async function (done) {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_01',
2
, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_01';
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_01';
let assetsCount = 1;
let assetsCount = 1;
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']);
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']);
await checkAlbumAssetsNoOps(done, testNum, currentFetchOp, assetsCount)
await checkAlbumAssetsNoOps(done, testNum, currentFetchOp, assetsCount)
});
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_02
* @tc.name : getFileAssets
* @tc.desc : Videos album,no option
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_02', 0, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_02';
let assetsCount = 2;
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Videos']);
await checkAlbumAssetsNoOps(done, testNum, currentFetchOp, assetsCount)
});
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_03
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_03
* @tc.name : getFileAssets
* @tc.name : getFileAssets
* @tc.desc : Screenshots album,no option
* @tc.desc : Screenshots album,no option
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_03',
0
, async function (done) {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_03',
2
, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_03';
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_03';
let assetsCount = 2;
let assetsCount = 2;
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Screenshots']);
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Screenshots']);
...
@@ -358,9 +298,9 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
...
@@ -358,9 +298,9 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
* @tc.desc : ScreenRecordings album,no option
* @tc.desc : ScreenRecordings album,no option
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_04',
0
, async function (done) {
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_04',
2
, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_04';
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_04';
let assetsCount = 2;
let assetsCount = 2;
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['ScreenRecordings']);
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['ScreenRecordings']);
...
@@ -371,12 +311,11 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
...
@@ -371,12 +311,11 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_05
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_05
* @tc.name : getFileAssets
* @tc.name : getFileAssets
* @tc.desc : getFileAssets by undefined option
* @tc.desc : getFileAssets by undefined option
* @tc.desc : ScreenRecordings album,no option
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it("SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_05",
0
, async function (done) {
it("SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_05",
2
, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_05";
const testNum = "SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_05";
let fetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']);
let fetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']);
try {
try {
...
@@ -413,9 +352,9 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
...
@@ -413,9 +352,9 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
* @tc.desc : getFileAssets by null option
* @tc.desc : getFileAssets by null option
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it("SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_06",
0
, async function (done) {
it("SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_06",
2
, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_06";
const testNum = "SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_06";
let fetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']);
let fetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']);
try {
try {
...
...
multimedia/medialibrary/mediaLibrary_album/entry/src/main/ets/test/albumTestCallBack.test.ets
浏览文件 @
59c50192
/*
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -67,6 +67,7 @@ export default function albumTestCallbackTest(abilityContext) {
...
@@ -67,6 +67,7 @@ export default function albumTestCallbackTest(abilityContext) {
expect(album.count).assertEqual(prop.count);
expect(album.count).assertEqual(prop.count);
expect(album.relativePath).assertEqual(relativePath);
expect(album.relativePath).assertEqual(relativePath);
};
};
const checkAlbumInfo = async function (done, testNum, fetchOp, relativePaths, props, expectAlbumCount) {
const checkAlbumInfo = async function (done, testNum, fetchOp, relativePaths, props, expectAlbumCount) {
try {
try {
media.getAlbums(fetchOp, async (err, albumList) => {
media.getAlbums(fetchOp, async (err, albumList) => {
...
@@ -221,30 +222,6 @@ export default function albumTestCallbackTest(abilityContext) {
...
@@ -221,30 +222,6 @@ export default function albumTestCallbackTest(abilityContext) {
await checkAlbumInfo(done, testNum, currentFetchOp, relativePaths, props, expectAlbumCount);
await checkAlbumInfo(done, testNum, currentFetchOp, relativePaths, props, expectAlbumCount);
});
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_02
* @tc.name : getAlbums
* @tc.desc : get Videos album,check album info
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_02", 0, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_02";
const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Videos']);
const relativePaths = [''];
const expectAlbumCount = 1;
const props = [
{
albumName: "Videos",
albumUri: "file://media/album/",
count: 2,
}
];
await checkAlbumInfo(done, testNum, currentFetchOp, relativePaths, props, expectAlbumCount);
});
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_03
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_03
* @tc.name : getAlbums
* @tc.name : getAlbums
...
@@ -296,7 +273,7 @@ export default function albumTestCallbackTest(abilityContext) {
...
@@ -296,7 +273,7 @@ export default function albumTestCallbackTest(abilityContext) {
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_05
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_05
* @tc.name : getAlbums
* @tc.name : getAlbums
* @tc.desc : get Camera and
Video
s album,check album info
* @tc.desc : get Camera and
Screenshot
s album,check album info
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level 0
* @tc.level : Level 0
...
@@ -304,12 +281,12 @@ export default function albumTestCallbackTest(abilityContext) {
...
@@ -304,12 +281,12 @@ export default function albumTestCallbackTest(abilityContext) {
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_05", 0, async function (done) {
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_05", 0, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_05";
const testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_05";
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', '
Video
s']);
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', '
Screenshot
s']);
const relativePaths = ['', ''];
const relativePaths = ['', ''];
const expectAlbumCount = 2;
const expectAlbumCount = 2;
const props = [
const props = [
{
{
albumName: "
Video
s",
albumName: "
Screenshot
s",
albumUri: "file://media/album/",
albumUri: "file://media/album/",
count: 2,
count: 2,
},
},
...
@@ -325,7 +302,7 @@ export default function albumTestCallbackTest(abilityContext) {
...
@@ -325,7 +302,7 @@ export default function albumTestCallbackTest(abilityContext) {
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_06
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_06
* @tc.name : getAlbums
* @tc.name : getAlbums
* @tc.desc : get Camera and
Video
s and Screenshots album,check album info
* @tc.desc : get Camera and
ScreenRecording
s and Screenshots album,check album info
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level 0
* @tc.level : Level 0
...
@@ -333,49 +310,10 @@ export default function albumTestCallbackTest(abilityContext) {
...
@@ -333,49 +310,10 @@ export default function albumTestCallbackTest(abilityContext) {
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_06", 0, async function (done) {
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_06", 0, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_06";
const testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_06";
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'Videos', 'Screenshots']);
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'ScreenRecordings', 'Screenshots']);
const relativePaths = ['', '', ''];
const relativePaths = ['', ''];
const expectAlbumCount = 3;
const expectAlbumCount = 2;
const props = [
{
albumName: "Videos",
albumUri: "file://media/album/",
count: 2,
},
{
albumName: "Screenshots",
albumUri: "file://media/album/",
count: 2,
},
{
albumName: "Camera",
albumUri: "file://media/album/",
count: 1,
},
];
await checkAlbumInfo(done, testNum, currentFetchOp, relativePaths, props, expectAlbumCount);
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_07
* @tc.name : getAlbums
* @tc.desc : get Camera and Videos and Screenshots and ScreenRecordings album,check album info
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_07", 0, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_07";
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'Videos', 'ScreenRecordings', 'Screenshots']);
const relativePaths = ['', '', ''];
const expectAlbumCount = 3;
const props = [
const props = [
{
albumName: "Videos",
albumUri: "file://media/album/",
count: 2,
},
{
{
albumName: "Screenshots",
albumName: "Screenshots",
albumUri: "file://media/album/",
albumUri: "file://media/album/",
...
@@ -398,9 +336,9 @@ export default function albumTestCallbackTest(abilityContext) {
...
@@ -398,9 +336,9 @@ export default function albumTestCallbackTest(abilityContext) {
* @tc.desc : Get Album Assets by fileHasArgsfetchOp3
* @tc.desc : Get Album Assets by fileHasArgsfetchOp3
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_06",
0
, async function (done) {
it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_06",
2
, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_06";
const testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_06";
const selections = FILEKEY.ALBUM_NAME + '= ?';
const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['666']);
const currentFetchOp = fileFetchOption(testNum, selections, ['666']);
...
@@ -413,9 +351,9 @@ export default function albumTestCallbackTest(abilityContext) {
...
@@ -413,9 +351,9 @@ export default function albumTestCallbackTest(abilityContext) {
* @tc.desc : Get Album Assets by fileHasArgsfetchOp4
* @tc.desc : Get Album Assets by fileHasArgsfetchOp4
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_07",
0
, async function (done) {
it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_07",
2
, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_07";
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_07";
const selections = "666" + "= ?";
const selections = "666" + "= ?";
const currentFetchOp = fileFetchOption(testNum, selections, [VIDEO_TYPE.toString()]);
const currentFetchOp = fileFetchOption(testNum, selections, [VIDEO_TYPE.toString()]);
...
@@ -428,9 +366,9 @@ export default function albumTestCallbackTest(abilityContext) {
...
@@ -428,9 +366,9 @@ export default function albumTestCallbackTest(abilityContext) {
* @tc.desc : Get Album Assets by fileHasArgsfetchOp5
* @tc.desc : Get Album Assets by fileHasArgsfetchOp5
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_08",
0
, async function (done) {
it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_08",
2
, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_08";
const testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_08";
const selections = "666" + "= ?";
const selections = "666" + "= ?";
const currentFetchOp = fileFetchOption(testNum, selections, ['666']);
const currentFetchOp = fileFetchOption(testNum, selections, ['666']);
...
@@ -445,9 +383,9 @@ export default function albumTestCallbackTest(abilityContext) {
...
@@ -445,9 +383,9 @@ export default function albumTestCallbackTest(abilityContext) {
* @tc.desc : Modify Camera name ''
* @tc.desc : Modify Camera name ''
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_01",
0
, async function (done) {
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_01",
2
, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_01";
const testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_01";
const selections = FILEKEY.ALBUM_NAME + '= ?';
const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera']);
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera']);
...
@@ -456,32 +394,15 @@ export default function albumTestCallbackTest(abilityContext) {
...
@@ -456,32 +394,15 @@ export default function albumTestCallbackTest(abilityContext) {
await abnormalAlbumCommitModify(done, testNum, currentFetchOp, newName, expectAlbumCount);
await abnormalAlbumCommitModify(done, testNum, currentFetchOp, newName, expectAlbumCount);
});
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_02
* @tc.name : commitModify
* @tc.desc : Modify Videos name ''
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_02", 0, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_02";
const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Videos']);
const newName = "";
const expectAlbumCount = 1;
await abnormalAlbumCommitModify(done, testNum, currentFetchOp, newName, expectAlbumCount);
});
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_04
* @tc.number : SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_04
* @tc.name : commitModify
* @tc.name : commitModify
* @tc.desc : Modify Album name 'aaaaa....' (256)
* @tc.desc : Modify Album name 'aaaaa....' (256)
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_04",
0
, async function (done) {
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_04",
2
, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_04";
const testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_04";
const selections = FILEKEY.ALBUM_NAME + '= ?';
const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots']);
const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots']);
...
@@ -499,9 +420,9 @@ export default function albumTestCallbackTest(abilityContext) {
...
@@ -499,9 +420,9 @@ export default function albumTestCallbackTest(abilityContext) {
* @tc.desc : Modify Album name '中中中中中....' (86 *3)
* @tc.desc : Modify Album name '中中中中中....' (86 *3)
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_05",
0
, async function (done) {
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_05",
2
, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_05";
const testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_05";
const selections = FILEKEY.ALBUM_NAME + '= ?';
const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots']);
const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots']);
...
@@ -519,9 +440,9 @@ export default function albumTestCallbackTest(abilityContext) {
...
@@ -519,9 +440,9 @@ export default function albumTestCallbackTest(abilityContext) {
* @tc.desc : Modify Album name 'aaaaaaa....' (255)
* @tc.desc : Modify Album name 'aaaaaaa....' (255)
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_06",
0
, async function (done) {
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_06",
2
, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_06";
const testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_06";
const selections = FILEKEY.ALBUM_NAME + '= ?';
const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots']);
const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots']);
...
...
multimedia/medialibrary/mediaLibrary_album/entry/src/main/ets/test/albumTestPromise.test.ets
浏览文件 @
59c50192
/*
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -18,14 +18,8 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
...
@@ -18,14 +18,8 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
import {
import {
sleep,
sleep,
IMAGE_TYPE,
VIDEO_TYPE,
AUDIO_TYPE,
FILEKEY,
FILEKEY,
idFetchOps,
idFetchOps,
albumFetchOps,
albumTwoTypesFetchOps,
albumThreeTypesFetchOps,
checkAlbumsCount,
checkAlbumsCount,
fileFetchOption,
fileFetchOption,
} from "../../../../../../common";
} from "../../../../../../common";
...
@@ -70,6 +64,7 @@ export default function albumTestPromiseTest(abilityContext) {
...
@@ -70,6 +64,7 @@ export default function albumTestPromiseTest(abilityContext) {
expect(album.count).assertEqual(prop.count);
expect(album.count).assertEqual(prop.count);
expect(album.relativePath).assertEqual(relativePath);
expect(album.relativePath).assertEqual(relativePath);
};
};
const checkAlbumInfo = async function (done, testNum, fetchOp, relativePaths, props, expectAlbumCount = 1) {
const checkAlbumInfo = async function (done, testNum, fetchOp, relativePaths, props, expectAlbumCount = 1) {
try {
try {
const albumList = await media.getAlbums(fetchOp);
const albumList = await media.getAlbums(fetchOp);
...
@@ -186,29 +181,6 @@ export default function albumTestPromiseTest(abilityContext) {
...
@@ -186,29 +181,6 @@ export default function albumTestPromiseTest(abilityContext) {
await checkAlbumInfo(done, testNum, currentFetchOp, relativePaths, props);
await checkAlbumInfo(done, testNum, currentFetchOp, relativePaths, props);
});
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_02
* @tc.name : getAlbums
* @tc.desc : get Videos album,check album info
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_02", 0, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_02";
const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Videos']);
let relativePaths = [""];
const props = [
{
albumName: "Videos",
albumUri: "file://media/album/",
count: 2,
}
];
await checkAlbumInfo(done, testNum, currentFetchOp, relativePaths, props);
});
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_03
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_03
* @tc.name : getAlbums
* @tc.name : getAlbums
...
@@ -259,20 +231,20 @@ export default function albumTestPromiseTest(abilityContext) {
...
@@ -259,20 +231,20 @@ export default function albumTestPromiseTest(abilityContext) {
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_05
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_05
* @tc.name : getAlbums
* @tc.name : getAlbums
* @tc.desc : get Camera and
Video
s album,check album info
* @tc.desc : get Camera and
Screenshot
s album,check album info
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_05",
0
, async function (done) {
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_05",
2
, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_05";
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_05";
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', '
Video
s']);
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', '
Screenshot
s']);
let relativePaths = ['', ''];
let relativePaths = ['', ''];
let albumCount = 2;
let albumCount = 2;
const props = [
const props = [
{
{
albumName: "
Video
s",
albumName: "
Screenshot
s",
albumUri: "file://media/album/",
albumUri: "file://media/album/",
count: 2,
count: 2,
},
},
...
@@ -288,57 +260,18 @@ export default function albumTestPromiseTest(abilityContext) {
...
@@ -288,57 +260,18 @@ export default function albumTestPromiseTest(abilityContext) {
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_06
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_06
* @tc.name : getAlbums
* @tc.name : getAlbums
* @tc.desc : get Camera and
Video
s and Screenshots album,check album info
* @tc.desc : get Camera and
ScreenRecording
s and Screenshots album,check album info
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_06",
0
, async function (done) {
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_06",
2
, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_06";
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_06";
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'Videos', 'Screenshots']);
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'ScreenRecordings', 'Screenshots']);
let relativePaths = ['', '', ''];
let relativePaths = ['', ''];
let albumCount = 3;
let albumCount = 2;
const props = [
{
albumName: "Videos",
albumUri: "file://media/album/",
count: 2,
},
{
albumName: "Screenshots",
albumUri: "file://media/album/",
count: 2,
},
{
albumName: "Camera",
albumUri: "file://media/album/",
count: 1,
},
];
await checkAlbumInfo(done, testNum, currentFetchOp, relativePaths, props, albumCount);
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_07
* @tc.name : getAlbums
* @tc.desc : get Camera and Videos and Screenshots and ScreenRecordings album,check album info
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_07", 0, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_07";
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'Videos', 'ScreenRecordings', 'Screenshots']);
let relativePaths = ['', '', ''];
let albumCount = 3;
const props = [
const props = [
{
albumName: "Videos",
albumUri: "file://media/album/",
count: 2,
},
{
{
albumName: "Screenshots",
albumName: "Screenshots",
albumUri: "file://media/album/",
albumUri: "file://media/album/",
...
@@ -361,9 +294,9 @@ export default function albumTestPromiseTest(abilityContext) {
...
@@ -361,9 +294,9 @@ export default function albumTestPromiseTest(abilityContext) {
* @tc.desc : Get Album Assets by abnormal option
* @tc.desc : Get Album Assets by abnormal option
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_06",
0
, async function (done) {
it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_06",
2
, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_06";
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_06";
const selections = FILEKEY.ALBUM_NAME + '= ?';
const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['666']);
const currentFetchOp = fileFetchOption(testNum, selections, ['666']);
...
@@ -376,9 +309,9 @@ export default function albumTestPromiseTest(abilityContext) {
...
@@ -376,9 +309,9 @@ export default function albumTestPromiseTest(abilityContext) {
* @tc.desc : Get Album Assets by abnormal option
* @tc.desc : Get Album Assets by abnormal option
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_07",
0
, async function (done) {
it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_07",
2
, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_07";
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_07";
const selections = '666' + '= ?';
const selections = '666' + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera']);
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera']);
...
@@ -391,9 +324,9 @@ export default function albumTestPromiseTest(abilityContext) {
...
@@ -391,9 +324,9 @@ export default function albumTestPromiseTest(abilityContext) {
* @tc.desc : Get Album Assets by abnormal option
* @tc.desc : Get Album Assets by abnormal option
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_08",
0
, async function (done) {
it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_08",
2
, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_08";
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_08";
const selections = '666' + '= ?';
const selections = '666' + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['666']);
const currentFetchOp = fileFetchOption(testNum, selections, ['666']);
...
@@ -408,9 +341,9 @@ export default function albumTestPromiseTest(abilityContext) {
...
@@ -408,9 +341,9 @@ export default function albumTestPromiseTest(abilityContext) {
* @tc.desc : Modify Camera name ''
* @tc.desc : Modify Camera name ''
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_01",
0
, async function (done) {
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_01",
2
, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_01";
let testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_01";
const selections = FILEKEY.ALBUM_NAME + '= ?';
const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera']);
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera']);
...
@@ -419,32 +352,15 @@ export default function albumTestPromiseTest(abilityContext) {
...
@@ -419,32 +352,15 @@ export default function albumTestPromiseTest(abilityContext) {
await abnormalAlbumCommitModify(done, testNum, currentFetchOp, newName, expectAlbumCount);
await abnormalAlbumCommitModify(done, testNum, currentFetchOp, newName, expectAlbumCount);
});
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_02
* @tc.name : commitModify
* @tc.desc : Modify Videos name ''
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_02", 0, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_02";
const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Videos']);
let newName = "";
let expectAlbumCount = 1;
await abnormalAlbumCommitModify(done, testNum, currentFetchOp, newName, expectAlbumCount);
});
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_04
* @tc.number : SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_04
* @tc.name : commitModify
* @tc.name : commitModify
* @tc.desc : Modify Screenshots name 'aaaaa....' (256)
* @tc.desc : Modify Screenshots name 'aaaaa....' (256)
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_04",
0
, async function (done) {
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_04",
2
, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_04";
let testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_04";
const selections = FILEKEY.ALBUM_NAME + '= ?';
const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots']);
const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots']);
...
@@ -462,9 +378,9 @@ export default function albumTestPromiseTest(abilityContext) {
...
@@ -462,9 +378,9 @@ export default function albumTestPromiseTest(abilityContext) {
* @tc.desc : Modify Screenshots name '中中中中中....' (86 *3)
* @tc.desc : Modify Screenshots name '中中中中中....' (86 *3)
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_05",
0
, async function (done) {
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_05",
2
, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_05";
let testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_05";
const selections = FILEKEY.ALBUM_NAME + '= ?';
const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots']);
const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots']);
...
@@ -524,9 +440,9 @@ export default function albumTestPromiseTest(abilityContext) {
...
@@ -524,9 +440,9 @@ export default function albumTestPromiseTest(abilityContext) {
* @tc.desc : check album.coverUri
* @tc.desc : check album.coverUri
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level
0
* @tc.level : Level
2
*/
*/
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_004_01",
0
, async function (done) {
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_004_01",
2
, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_004_01";
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_004_01";
try {
try {
let coverUrifetchOp = {
let coverUrifetchOp = {
...
...
multimedia/medialibrary/mediaLibrary_base/Test.json
浏览文件 @
59c50192
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"scanner"
,
"sleep 5"
,
"sleep 5"
,
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}"
,
"mkdir /storage/media/100/local/temp"
,
"mkdir /storage/media/100/local/temp"
,
"param set persist.ace.testmode.enabled 1"
,
"param set persist.ace.testmode.enabled 1"
,
"power-shell wakeup"
,
"power-shell wakeup"
,
...
@@ -59,7 +58,14 @@
...
@@ -59,7 +58,14 @@
"sleep 10"
"sleep 10"
],
],
"teardown-command"
:
[
"teardown-command"
:
[
"power-shell setmode 600"
"power-shell setmode 600"
,
"rm -rf /storage/media/100/local/temp"
,
"rm -rf /storage/media/100/local/files/*"
,
"rm -rf /storage/media/100/local/files/.*"
,
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"sleep 5"
]
]
},
},
{
{
...
...
multimedia/medialibrary/mediaLibrary_base/entry/src/main/ets/test/mediaLibraryTestCallback.test.ets
浏览文件 @
59c50192
/*
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/medialibrary/mediaLibrary_base/entry/src/main/ets/test/mediaLibraryTestPromise.test.ets
浏览文件 @
59c50192
/*
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/medialibrary/mediaLibrary_base/entry/src/main/ets/test/mediaLibraryTestPromiseOnOff.test.ets
浏览文件 @
59c50192
/*
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/medialibrary/mediaLibrary_favorite/Test.json
浏览文件 @
59c50192
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"scanner"
,
"sleep 5"
,
"sleep 5"
,
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}"
,
"mkdir /storage/media/100/local/temp"
,
"mkdir /storage/media/100/local/temp"
,
"param set persist.ace.testmode.enabled 1"
,
"param set persist.ace.testmode.enabled 1"
,
"power-shell wakeup"
,
"power-shell wakeup"
,
...
@@ -57,7 +56,14 @@
...
@@ -57,7 +56,14 @@
"sleep 10"
"sleep 10"
],
],
"teardown-command"
:
[
"teardown-command"
:
[
"power-shell setmode 600"
"power-shell setmode 600"
,
"rm -rf /storage/media/100/local/temp"
,
"rm -rf /storage/media/100/local/files/*"
,
"rm -rf /storage/media/100/local/files/.*"
,
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"sleep 5"
]
]
},
},
{
{
...
...
multimedia/medialibrary/mediaLibrary_favorite/entry/src/main/ets/test/favoriteTestCallback.test.ets
浏览文件 @
59c50192
/*
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/medialibrary/mediaLibrary_favorite/entry/src/main/ets/test/favoriteTestPromise.test.ets
浏览文件 @
59c50192
/*
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/medialibrary/mediaLibrary_file/Test.json
浏览文件 @
59c50192
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"scanner"
,
"sleep 5"
,
"sleep 5"
,
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}"
,
"mkdir /storage/media/100/local/temp"
,
"mkdir /storage/media/100/local/temp"
,
"param set persist.ace.testmode.enabled 1"
,
"param set persist.ace.testmode.enabled 1"
,
"power-shell wakeup"
,
"power-shell wakeup"
,
...
@@ -61,7 +60,14 @@
...
@@ -61,7 +60,14 @@
"sleep 10"
"sleep 10"
],
],
"teardown-command"
:
[
"teardown-command"
:
[
"power-shell setmode 600"
"power-shell setmode 600"
,
"rm -rf /storage/media/100/local/temp"
,
"rm -rf /storage/media/100/local/files/*"
,
"rm -rf /storage/media/100/local/files/.*"
,
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"sleep 5"
]
]
},
},
{
{
...
...
multimedia/medialibrary/mediaLibrary_file/entry/src/main/ets/test/fileTestCallback.test.ets
浏览文件 @
59c50192
/*
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/medialibrary/mediaLibrary_file/entry/src/main/ets/test/fileTestPromise.test.ets
浏览文件 @
59c50192
/*
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/medialibrary/mediaLibrary_fileAsset/Test.json
浏览文件 @
59c50192
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"scanner"
,
"sleep 5"
,
"sleep 5"
,
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}"
,
"mkdir /storage/media/100/local/temp"
,
"mkdir /storage/media/100/local/temp"
,
"param set persist.ace.testmode.enabled 1"
,
"param set persist.ace.testmode.enabled 1"
,
"power-shell wakeup"
,
"power-shell wakeup"
,
...
@@ -61,7 +60,14 @@
...
@@ -61,7 +60,14 @@
"sleep 10"
"sleep 10"
],
],
"teardown-command"
:
[
"teardown-command"
:
[
"power-shell setmode 600"
"power-shell setmode 600"
,
"rm -rf /storage/media/100/local/temp"
,
"rm -rf /storage/media/100/local/files/*"
,
"rm -rf /storage/media/100/local/files/.*"
,
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"sleep 5"
]
]
},
},
{
{
...
...
multimedia/medialibrary/mediaLibrary_fileAsset/entry/src/main/ets/test/fileAssetCallback2.test.ets
浏览文件 @
59c50192
/*
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/medialibrary/mediaLibrary_fileAsset/entry/src/main/ets/test/fileAssetPromise2.test.ets
浏览文件 @
59c50192
/*
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/medialibrary/mediaLibrary_fileKey/Test.json
浏览文件 @
59c50192
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"scanner"
,
"sleep 5"
,
"sleep 5"
,
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}"
,
"mkdir /storage/media/100/local/temp"
,
"mkdir /storage/media/100/local/temp"
,
"param set persist.ace.testmode.enabled 1"
,
"param set persist.ace.testmode.enabled 1"
,
"power-shell wakeup"
,
"power-shell wakeup"
,
...
@@ -53,7 +52,14 @@
...
@@ -53,7 +52,14 @@
"sleep 10"
"sleep 10"
],
],
"teardown-command"
:
[
"teardown-command"
:
[
"power-shell setmode 600"
"power-shell setmode 600"
,
"rm -rf /storage/media/100/local/temp"
,
"rm -rf /storage/media/100/local/files/*"
,
"rm -rf /storage/media/100/local/files/.*"
,
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"sleep 5"
]
]
},
},
{
{
...
...
multimedia/medialibrary/mediaLibrary_fileKey/entry/src/main/ets/test/filekeyTestCallback.test.ets
浏览文件 @
59c50192
/*
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -49,7 +49,6 @@ export default function filekeyTestCallbackTest(abilityContext) {
...
@@ -49,7 +49,6 @@ export default function filekeyTestCallbackTest(abilityContext) {
});
});
const
{
const
{
PARENT
,
MIME_TYPE
,
MIME_TYPE
,
SIZE
,
SIZE
,
DATE_ADDED
,
DATE_ADDED
,
...
@@ -59,14 +58,12 @@ export default function filekeyTestCallbackTest(abilityContext) {
...
@@ -59,14 +58,12 @@ export default function filekeyTestCallbackTest(abilityContext) {
WIDTH
,
WIDTH
,
HEIGHT
,
HEIGHT
,
ORIENTATION
,
ORIENTATION
,
ALBUM_ID
,
ARTIST
,
ARTIST
,
AUDIOALBUM
,
AUDIOALBUM
,
DATE_MODIFIED
,
DATE_MODIFIED
,
DATE_TAKEN
,
DATE_TAKEN
,
RELATIVE_PATH
,
RELATIVE_PATH
,
DISPLAY_NAME
,
DISPLAY_NAME
,
MEDIA_TYPE
,
}
=
FILEKEY
;
}
=
FILEKEY
;
async
function
getFileAssetsBy
(
done
,
testNum
,
type
,
fileKey
)
{
async
function
getFileAssetsBy
(
done
,
testNum
,
type
,
fileKey
)
{
...
@@ -107,20 +104,6 @@ export default function filekeyTestCallbackTest(abilityContext) {
...
@@ -107,20 +104,6 @@ export default function filekeyTestCallbackTest(abilityContext) {
}
}
}
}
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILE_KEY_CALLBACK_001
* @tc.name : getFileAssets
* @tc.desc : filekey parentOp
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
"SUB_MEDIA_MEDIALIBRARY_FILE_KEY_CALLBACK_001"
,
0
,
async
function
(
done
)
{
let
testNum
=
"SUB_MEDIA_MEDIALIBRARY_FILE_KEY_CALLBACK_001"
;
await
getFileAssetsBy
(
done
,
testNum
,
"parent"
,
PARENT
);
});
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILE_KEY_CALLBACK_002
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILE_KEY_CALLBACK_002
* @tc.name : getFileAssets
* @tc.name : getFileAssets
...
...
multimedia/medialibrary/mediaLibrary_fileKey/entry/src/main/ets/test/filekeyTestPromise.test.ets
浏览文件 @
59c50192
/*
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
@@ -46,7 +46,6 @@ export default function filekeyTestPromiseTest(abilityContext) {
...
@@ -46,7 +46,6 @@ export default function filekeyTestPromiseTest(abilityContext) {
});
});
const
{
const
{
PARENT
,
MIME_TYPE
,
MIME_TYPE
,
SIZE
,
SIZE
,
DATE_ADDED
,
DATE_ADDED
,
...
@@ -56,14 +55,12 @@ export default function filekeyTestPromiseTest(abilityContext) {
...
@@ -56,14 +55,12 @@ export default function filekeyTestPromiseTest(abilityContext) {
WIDTH
,
WIDTH
,
HEIGHT
,
HEIGHT
,
ORIENTATION
,
ORIENTATION
,
ALBUM_ID
,
ARTIST
,
ARTIST
,
AUDIOALBUM
,
AUDIOALBUM
,
DATE_MODIFIED
,
DATE_MODIFIED
,
DATE_TAKEN
,
DATE_TAKEN
,
RELATIVE_PATH
,
RELATIVE_PATH
,
DISPLAY_NAME
,
DISPLAY_NAME
,
MEDIA_TYPE
,
}
=
FILEKEY
;
}
=
FILEKEY
;
async
function
getFileAssetsBy
(
done
,
testNum
,
type
,
fileKey
)
{
async
function
getFileAssetsBy
(
done
,
testNum
,
type
,
fileKey
)
{
...
@@ -97,20 +94,6 @@ export default function filekeyTestPromiseTest(abilityContext) {
...
@@ -97,20 +94,6 @@ export default function filekeyTestPromiseTest(abilityContext) {
}
}
}
}
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILE_KEY_PROMISE_001
* @tc.name : getFileAssets
* @tc.desc : filekey parentOp
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
"SUB_MEDIA_MEDIALIBRARY_FILE_KEY_PROMISE_001"
,
0
,
async
function
(
done
)
{
let
testNum
=
"SUB_MEDIA_MEDIALIBRARY_FILE_KEY_PROMISE_001"
;
await
getFileAssetsBy
(
done
,
testNum
,
"parent"
,
PARENT
);
});
/**
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILE_KEY_PROMISE_002
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILE_KEY_PROMISE_002
* @tc.name : getFileAssets
* @tc.name : getFileAssets
...
...
multimedia/medialibrary/mediaLibrary_fileResult/Test.json
浏览文件 @
59c50192
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"scanner"
,
"sleep 5"
,
"sleep 5"
,
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}"
,
"mkdir /storage/media/100/local/temp"
,
"mkdir /storage/media/100/local/temp"
,
"param set persist.ace.testmode.enabled 1"
,
"param set persist.ace.testmode.enabled 1"
,
"power-shell wakeup"
,
"power-shell wakeup"
,
...
@@ -57,7 +56,14 @@
...
@@ -57,7 +56,14 @@
"sleep 10"
"sleep 10"
],
],
"teardown-command"
:
[
"teardown-command"
:
[
"power-shell setmode 600"
"power-shell setmode 600"
,
"rm -rf /storage/media/100/local/temp"
,
"rm -rf /storage/media/100/local/files/*"
,
"rm -rf /storage/media/100/local/files/.*"
,
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"sleep 5"
]
]
},
},
{
{
...
...
multimedia/medialibrary/mediaLibrary_getExifNoLocation/Test.json
浏览文件 @
59c50192
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"scanner"
,
"sleep 5"
,
"sleep 5"
,
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}"
,
"mkdir /storage/media/100/local/temp"
,
"mkdir /storage/media/100/local/temp"
,
"param set persist.ace.testmode.enabled 1"
,
"param set persist.ace.testmode.enabled 1"
,
"power-shell wakeup"
,
"power-shell wakeup"
,
...
@@ -48,7 +47,14 @@
...
@@ -48,7 +47,14 @@
"sleep 10"
"sleep 10"
],
],
"teardown-command"
:
[
"teardown-command"
:
[
"power-shell setmode 600"
"power-shell setmode 600"
,
"rm -rf /storage/media/100/local/temp"
,
"rm -rf /storage/media/100/local/files/*"
,
"rm -rf /storage/media/100/local/files/.*"
,
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"sleep 5"
]
]
},
},
{
{
...
...
multimedia/medialibrary/mediaLibrary_getExiflocation/Test.json
浏览文件 @
59c50192
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"scanner"
,
"sleep 5"
,
"sleep 5"
,
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}"
,
"mkdir /storage/media/100/local/temp"
,
"mkdir /storage/media/100/local/temp"
,
"param set persist.ace.testmode.enabled 1"
,
"param set persist.ace.testmode.enabled 1"
,
"power-shell wakeup"
,
"power-shell wakeup"
,
...
@@ -48,7 +47,14 @@
...
@@ -48,7 +47,14 @@
"sleep 10"
"sleep 10"
],
],
"teardown-command"
:
[
"teardown-command"
:
[
"power-shell setmode 600"
"power-shell setmode 600"
,
"rm -rf /storage/media/100/local/temp"
,
"rm -rf /storage/media/100/local/files/*"
,
"rm -rf /storage/media/100/local/files/.*"
,
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"sleep 5"
]
]
},
},
{
{
...
...
multimedia/medialibrary/mediaLibrary_getThumbnail/Test.json
浏览文件 @
59c50192
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"scanner"
,
"sleep 5"
,
"sleep 5"
,
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}"
,
"mkdir /storage/media/100/local/temp"
,
"mkdir /storage/media/100/local/temp"
,
"param set persist.ace.testmode.enabled 1"
,
"param set persist.ace.testmode.enabled 1"
,
"power-shell wakeup"
,
"power-shell wakeup"
,
...
@@ -54,7 +53,14 @@
...
@@ -54,7 +53,14 @@
"sleep 10"
"sleep 10"
],
],
"teardown-command"
:
[
"teardown-command"
:
[
"power-shell setmode 600"
"power-shell setmode 600"
,
"rm -rf /storage/media/100/local/temp"
,
"rm -rf /storage/media/100/local/files/*"
,
"rm -rf /storage/media/100/local/files/.*"
,
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"sleep 5"
]
]
},
},
{
{
...
...
multimedia/medialibrary/mediaLibrary_mediafetchoptions/Test.json
浏览文件 @
59c50192
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"scanner"
,
"sleep 5"
,
"sleep 5"
,
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}"
,
"mkdir /storage/media/100/local/temp"
,
"mkdir /storage/media/100/local/temp"
,
"param set persist.ace.testmode.enabled 1"
,
"param set persist.ace.testmode.enabled 1"
,
"power-shell wakeup"
,
"power-shell wakeup"
,
...
@@ -54,7 +53,14 @@
...
@@ -54,7 +53,14 @@
"sleep 10"
"sleep 10"
],
],
"teardown-command"
:
[
"teardown-command"
:
[
"power-shell setmode 600"
"power-shell setmode 600"
,
"rm -rf /storage/media/100/local/temp"
,
"rm -rf /storage/media/100/local/files/*"
,
"rm -rf /storage/media/100/local/files/.*"
,
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"sleep 5"
]
]
},
},
{
{
...
...
multimedia/medialibrary/mediaLibrary_mediafetchoptions/entry/src/main/ets/test/mediafetchoptionsCallback.test.ets
浏览文件 @
59c50192
/*
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/medialibrary/mediaLibrary_trash/Test.json
浏览文件 @
59c50192
...
@@ -18,7 +18,6 @@
...
@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"scanner"
,
"sleep 5"
,
"sleep 5"
,
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}"
,
"mkdir /storage/media/100/local/temp"
,
"mkdir /storage/media/100/local/temp"
,
"param set persist.ace.testmode.enabled 1"
,
"param set persist.ace.testmode.enabled 1"
,
"power-shell wakeup"
,
"power-shell wakeup"
,
...
@@ -57,7 +56,14 @@
...
@@ -57,7 +56,14 @@
"sleep 10"
"sleep 10"
],
],
"teardown-command"
:
[
"teardown-command"
:
[
"power-shell setmode 600"
"power-shell setmode 600"
,
"rm -rf /storage/media/100/local/temp"
,
"rm -rf /storage/media/100/local/files/*"
,
"rm -rf /storage/media/100/local/files/.*"
,
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
,
"sleep 5"
]
]
},
},
{
{
...
...
multimedia/medialibrary/mediaLibrary_trash/entry/src/main/ets/test/trashCallback.test.ets
浏览文件 @
59c50192
/*
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
multimedia/medialibrary/mediaLibrary_trash/entry/src/main/ets/test/trashPromise.test.ets
浏览文件 @
59c50192
/*
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Copyright (C) 2022
-2023
Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* You may obtain a copy of the License at
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录