Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
5e72cd63
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
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看板
未验证
提交
5e72cd63
编写于
10月 17, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 17, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5746 mediaLibrary 矫正预期资源数量
Merge pull request !5746 from caochuan/mediaLibrary
上级
641152c8
497cccee
变更
18
显示空白变更内容
内联
并排
Showing
18 changed file
with
20 addition
and
51 deletion
+20
-51
multimedia/medialibrary/common.js
multimedia/medialibrary/common.js
+16
-11
multimedia/medialibrary/mediaLibrary_album/entry/src/main/ets/test/albumGetFileAssetsPromise.test.ets
...ntry/src/main/ets/test/albumGetFileAssetsPromise.test.ets
+0
-2
multimedia/medialibrary/mediaLibrary_album/entry/src/main/ets/test/albumTestCallBack.test.ets
..._album/entry/src/main/ets/test/albumTestCallBack.test.ets
+0
-4
multimedia/medialibrary/mediaLibrary_album/entry/src/main/ets/test/albumTestPromise.test.ets
...y_album/entry/src/main/ets/test/albumTestPromise.test.ets
+0
-3
multimedia/medialibrary/mediaLibrary_base/entry/src/main/ets/test/mediaLibraryTestPromise.test.ets
.../entry/src/main/ets/test/mediaLibraryTestPromise.test.ets
+0
-2
multimedia/medialibrary/mediaLibrary_base/entry/src/main/ets/test/mediaLibraryTestPromiseOnOff.test.ets
...y/src/main/ets/test/mediaLibraryTestPromiseOnOff.test.ets
+0
-2
multimedia/medialibrary/mediaLibrary_favorite/entry/src/main/ets/test/favoriteTestPromise.test.ets
...rite/entry/src/main/ets/test/favoriteTestPromise.test.ets
+0
-2
multimedia/medialibrary/mediaLibrary_file/entry/src/main/ets/test/fileTestPromise.test.ets
...ary_file/entry/src/main/ets/test/fileTestPromise.test.ets
+0
-2
multimedia/medialibrary/mediaLibrary_fileAsset/entry/src/main/ets/test/fileAssetPromise2.test.ets
...eAsset/entry/src/main/ets/test/fileAssetPromise2.test.ets
+0
-2
multimedia/medialibrary/mediaLibrary_fileAsset/entry/src/main/ets/test/fileAssetTestCallback.test.ets
...et/entry/src/main/ets/test/fileAssetTestCallback.test.ets
+0
-2
multimedia/medialibrary/mediaLibrary_fileAsset/entry/src/main/ets/test/fileAssetTestPromise.test.ets
...set/entry/src/main/ets/test/fileAssetTestPromise.test.ets
+0
-2
multimedia/medialibrary/mediaLibrary_fileKey/entry/src/main/ets/test/filekeyTestPromise.test.ets
...leKey/entry/src/main/ets/test/filekeyTestPromise.test.ets
+0
-2
multimedia/medialibrary/mediaLibrary_fileResult/entry/src/main/ets/test/fetchFileResultPromise.test.ets
...t/entry/src/main/ets/test/fetchFileResultPromise.test.ets
+0
-5
multimedia/medialibrary/mediaLibrary_getThumbnail/entry/src/main/ets/test/getThumbnailCallback.test.ets
...ail/entry/src/main/ets/test/getThumbnailCallback.test.ets
+1
-2
multimedia/medialibrary/mediaLibrary_getThumbnail/entry/src/main/ets/test/getThumbnailPromise.test.ets
...nail/entry/src/main/ets/test/getThumbnailPromise.test.ets
+0
-3
multimedia/medialibrary/mediaLibrary_mediafetchoptions/entry/src/main/ets/test/mediafetchoptionsCallback.test.ets
...ntry/src/main/ets/test/mediafetchoptionsCallback.test.ets
+1
-2
multimedia/medialibrary/mediaLibrary_mediafetchoptions/entry/src/main/ets/test/mediafetchoptionsPromise.test.ets
...entry/src/main/ets/test/mediafetchoptionsPromise.test.ets
+0
-3
multimedia/medialibrary/mediaLibrary_trash/entry/src/main/ets/test/trashCallback.test.ets
...rary_trash/entry/src/main/ets/test/trashCallback.test.ets
+2
-0
未找到文件。
multimedia/medialibrary/common.js
浏览文件 @
5e72cd63
...
...
@@ -18,15 +18,15 @@ import bundle from '@ohos.bundle';
const
presetsCount
=
{
ActsMediaLibraryAlbumTest
:
{
albumsCount
:
7
,
assetsCount
:
19
},
ActsMediaLibraryBaseTest
:
{
albumsCount
:
11
,
assetsCount
:
14
},
ActsMediaLibraryFavoriteTest
:
{
albumsCount
:
6
,
assetsCount
:
32
},
ActsMediaLibraryAlbumFileResultCb
:
{
albumsCount
:
5
,
assetsCount
:
118
},
ActsMediaLibraryFileTest
:
{
albumsCount
:
6
,
assetsCount
:
21
},
ActsMediaLibraryFileAssetTest
:
{
albumsCount
:
27
,
assetsCount
:
72
},
ActsMediaLibraryFileAssetUri
:
{
albumsCount
:
3
,
assetsCount
:
6
},
ActsMediaLibraryFileTest
:
{
albumsCount
:
6
,
assetsCount
:
28
},
ActsMediaLibraryFileAssetTest
:
{
albumsCount
:
27
,
assetsCount
:
100
},
ActsMediaLibraryFileKeyTest
:
{
albumsCount
:
2
,
assetsCount
:
2
},
ActsMediaLibraryFileResultTest
:
{
albumsCount
:
4
,
assetsCount
:
13
},
ActsMediaLibraryGetThumbnail
:
{
albumsCount
:
3
,
assetsCount
:
3
},
ActsMediaLibraryBaseTest
:
{
albumsCount
:
11
,
assetsCount
:
11
},
ActsMediaLibraryFileResultTest
:
{
albumsCount
:
3
,
assetsCount
:
112
},
ActsMediaLibraryGetThumbnailTest
:
{
albumsCount
:
3
,
assetsCount
:
3
},
ActsMediaLibraryMediafetchoptionsTest
:
{
albumsCount
:
3
,
assetsCount
:
8
},
ActsMediaLibraryTrashJsTest
:
{
albumsCount
:
6
,
assetsCount
:
24
},
}
const
IMAGE_TYPE
=
mediaLibrary
.
MediaType
.
IMAGE
;
...
...
@@ -160,10 +160,15 @@ const checkPresetsAssets = async function (media, hapName) {
let
albumsCount
=
albumList
.
length
;
let
fetchFileResult
=
await
media
.
getFileAssets
(
allFetchOp
());
let
assetsCount
=
await
fetchFileResult
.
getCount
();
console
.
info
(
`
${
hapName
}
:: assetsCount:
${
assetsCount
}
albumsCount:
${
albumsCount
}
,
presetsassetsCount:
${
presetsCount
[
hapName
].
assetsCount
}
presetsalbumsCount:
${
presetsCount
[
hapName
].
albumsCount
}
`
);
console
.
info
(
'
checkPresetsAssets end
'
)
let
presetsassetsCount
=
presetsCount
[
hapName
].
assetsCount
;
let
presetsalbumsCount
=
presetsCount
[
hapName
].
albumsCount
;
if
(
assetsCount
!=
presetsCount
[
hapName
].
assetsCount
||
albumsCount
!=
presetsCount
[
hapName
].
albumsCount
)
{
console
.
info
(
`
${
hapName
}
checkPresetsAssets failed;
assetsCount : presetsassetsCount =
${
assetsCount
}
:
${
presetsassetsCount
}
albumsCount : presetsalbumsCount =
${
albumsCount
}
:
${
presetsalbumsCount
}
`
)
}
else
{
console
.
info
(
`
${
hapName
}
checkPresetsAssets passed`
)
}
}
const
checkAssetsCount
=
async
function
(
done
,
testNum
,
fetchFileResult
,
expectCount
)
{
...
...
multimedia/medialibrary/mediaLibrary_album/entry/src/main/ets/test/albumGetFileAssetsPromise.test.ets
浏览文件 @
5e72cd63
...
...
@@ -24,7 +24,6 @@ import {
albumFetchOps,
albumTwoTypesFetchOps,
albumThreeTypesFetchOps,
checkPresetsAssets,
checkAlbumsCount,
} from '../../../../../../common';
...
...
@@ -33,7 +32,6 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
const media = mediaLibrary.getMediaLibrary(abilityContext);
beforeAll(async function () {
console.info('beforeAll case');
await checkPresetsAssets(media, 'ActsMediaLibraryAlbumTest');
});
beforeEach(function () {
console.info('beforeEach case');
...
...
multimedia/medialibrary/mediaLibrary_album/entry/src/main/ets/test/albumTestCallBack.test.ets
浏览文件 @
5e72cd63
...
...
@@ -22,22 +22,18 @@ import {
VIDEO_TYPE,
AUDIO_TYPE,
FILEKEY,
allFetchOp,
idFetchOps,
albumFetchOps,
albumTwoTypesFetchOps,
albumThreeTypesFetchOps,
checkPresetsAssets,
checkAlbumsCount,
} from '../../../../../../common';
export default function albumTestCallbackTest(abilityContext) {
describe('albumTestCallbackTest', function () {
const media = mediaLibrary.getMediaLibrary(abilityContext);
beforeAll(async function () {
console.info('beforeAll case');
await checkPresetsAssets(media, 'ActsMediaLibraryAlbumTest');
});
beforeEach(function () {
console.info('beforeEach case');
...
...
multimedia/medialibrary/mediaLibrary_album/entry/src/main/ets/test/albumTestPromise.test.ets
浏览文件 @
5e72cd63
...
...
@@ -22,12 +22,10 @@ import {
VIDEO_TYPE,
AUDIO_TYPE,
FILEKEY,
allFetchOp,
idFetchOps,
albumFetchOps,
albumTwoTypesFetchOps,
albumThreeTypesFetchOps,
checkPresetsAssets,
checkAlbumsCount,
} from '../../../../../../common';
...
...
@@ -36,7 +34,6 @@ export default function albumTestPromiseTest(abilityContext) {
const media = mediaLibrary.getMediaLibrary(abilityContext);
beforeAll(async function () {
console.info('beforeAll case');
await checkPresetsAssets(media, 'ActsMediaLibraryAlbumTest');
});
beforeEach(function () {
console.info('beforeEach case');
...
...
multimedia/medialibrary/mediaLibrary_base/entry/src/main/ets/test/mediaLibraryTestPromise.test.ets
浏览文件 @
5e72cd63
...
...
@@ -22,7 +22,6 @@ import {
AUDIO_TYPE
,
FILE_TYPE
,
FILEKEY
,
checkPresetsAssets
,
checkAssetsCount
,
fetchOps
,
getPermission
,
...
...
@@ -36,7 +35,6 @@ export default function mediaLibraryTestPromiseTest(abilityContext) {
beforeAll
(
async
function
()
{
console
.
info
(
'beforeAll case'
);
await
getPermission
();
await
checkPresetsAssets
(
media
,
'ActsMediaLibraryBaseTest'
);
});
beforeEach
(
function
()
{
console
.
info
(
'beforeEach case'
);
...
...
multimedia/medialibrary/mediaLibrary_base/entry/src/main/ets/test/mediaLibraryTestPromiseOnOff.test.ets
浏览文件 @
5e72cd63
...
...
@@ -21,7 +21,6 @@ import {
VIDEO_TYPE,
AUDIO_TYPE,
FILE_TYPE,
checkPresetsAssets,
checkAssetsCount,
fetchOps,
albumFetchOps,
...
...
@@ -35,7 +34,6 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext) {
beforeAll(async function () {
console.info('beforeAll case');
await getPermission();
await checkPresetsAssets(media, 'ActsMediaLibraryBaseTest');
});
beforeEach(function () {
console.info('beforeEach case');
...
...
multimedia/medialibrary/mediaLibrary_favorite/entry/src/main/ets/test/favoriteTestPromise.test.ets
浏览文件 @
5e72cd63
...
...
@@ -21,7 +21,6 @@ import {
VIDEO_TYPE,
AUDIO_TYPE,
FILE_TYPE,
checkPresetsAssets,
nameFetchOps,
checkAssetsCount,
} from '../../../../../../common';
...
...
@@ -31,7 +30,6 @@ export default function favoriteTestPromiseTest(abilityContext) {
var media = mediaLibrary.getMediaLibrary(abilityContext);
beforeAll(async function () {
console.info('beforeAll case');
await checkPresetsAssets(media, 'ActsMediaLibraryFavoriteTest');
});
beforeEach(function () {
console.info('beforeEach case');
...
...
multimedia/medialibrary/mediaLibrary_file/entry/src/main/ets/test/fileTestPromise.test.ets
浏览文件 @
5e72cd63
...
...
@@ -23,7 +23,6 @@ import {
VIDEO_TYPE
,
AUDIO_TYPE
,
FILE_TYPE
,
checkPresetsAssets
,
nameFetchOps
,
checkAssetsCount
,
fetchOps
,
...
...
@@ -37,7 +36,6 @@ export default function fileTestPromiseTest(abilityContext) {
const
media
=
mediaLibrary
.
getMediaLibrary
(
abilityContext
);
beforeAll
(
async
function
()
{
console
.
info
(
'beforeAll case'
);
await
checkPresetsAssets
(
media
,
'ActsMediaLibraryFileTest'
)
});
beforeEach
(
function
()
{
console
.
info
(
'beforeEach case'
);
...
...
multimedia/medialibrary/mediaLibrary_fileAsset/entry/src/main/ets/test/fileAssetPromise2.test.ets
浏览文件 @
5e72cd63
...
...
@@ -21,7 +21,6 @@ import {
sleep,
IMAGE_TYPE,
FILEKEY,
checkPresetsAssets,
checkAssetsCount,
nameFetchOps,
} from '../../../../../../common';
...
...
@@ -31,7 +30,6 @@ export default function fileAssetPromise2Test(abilityContext) {
const media = mediaLibrary.getMediaLibrary(abilityContext);
beforeAll(async function () {
console.info('beforeAll case');
await checkPresetsAssets(media, 'ActsMediaLibraryFileAssetTest')
});
beforeEach(function () {
console.info('beforeEach case');
...
...
multimedia/medialibrary/mediaLibrary_fileAsset/entry/src/main/ets/test/fileAssetTestCallback.test.ets
浏览文件 @
5e72cd63
...
...
@@ -22,7 +22,6 @@ import {
VIDEO_TYPE,
AUDIO_TYPE,
FILE_TYPE,
checkPresetsAssets,
checkAssetsCount,
fetchOps,
isNum,
...
...
@@ -33,7 +32,6 @@ export default function fileAssetTestCallbackTest(abilityContext) {
const media = mediaLibrary.getMediaLibrary(abilityContext);
beforeAll(async function () {
console.info('beforeAll case');
await checkPresetsAssets(media, 'ActsMediaLibraryFileAssetTest')
});
beforeEach(function () {
console.info('beforeEach case');
...
...
multimedia/medialibrary/mediaLibrary_fileAsset/entry/src/main/ets/test/fileAssetTestPromise.test.ets
浏览文件 @
5e72cd63
...
...
@@ -22,7 +22,6 @@ import {
VIDEO_TYPE,
AUDIO_TYPE,
FILE_TYPE,
checkPresetsAssets,
checkAssetsCount,
fetchOps,
isNum,
...
...
@@ -33,7 +32,6 @@ export default function fileAssetTestPromiseTest(abilityContext) {
const media = mediaLibrary.getMediaLibrary(abilityContext);
beforeAll(async function () {
console.info('beforeAll case');
await checkPresetsAssets(media, 'ActsMediaLibraryFileAssetTest')
});
beforeEach(function () {
console.info('beforeEach case');
...
...
multimedia/medialibrary/mediaLibrary_fileKey/entry/src/main/ets/test/filekeyTestPromise.test.ets
浏览文件 @
5e72cd63
...
...
@@ -23,7 +23,6 @@ import {
AUDIO_TYPE
,
checkAlbumsCount
,
FILEKEY
,
checkPresetsAssets
,
checkAssetsCount
,
fetchOps
,
}
from
'../../../../../../common'
;
...
...
@@ -35,7 +34,6 @@ export default function filekeyTestPromiseTest(abilityContext) {
beforeAll
(
async
function
()
{
console
.
info
(
'beforeAll case'
);
await
checkPresetsAssets
(
media
,
'ActsMediaLibraryFileKeyTest'
)
});
beforeEach
(
function
()
{
console
.
info
(
'beforeEach case'
);
...
...
multimedia/medialibrary/mediaLibrary_fileResult/entry/src/main/ets/test/fetchFileResultPromise.test.ets
浏览文件 @
5e72cd63
...
...
@@ -19,12 +19,8 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
import {
sleep,
IMAGE_TYPE,
VIDEO_TYPE,
AUDIO_TYPE,
FILE_TYPE,
FILEKEY,
checkPresetsAssets,
nameFetchOps,
checkAssetsCount,
fetchOps,
} from '../../../../../../common';
...
...
@@ -34,7 +30,6 @@ export default function fetchFileResultPromiseTest(abilityContext) {
const media = mediaLibrary.getMediaLibrary(abilityContext);
beforeAll(async function () {
console.info('beforeAll case');
await checkPresetsAssets(media, 'ActsMediaLibraryFileResultTest');
});
beforeEach(function () {
console.info('beforeEach case');
...
...
multimedia/medialibrary/mediaLibrary_getThumbnail/entry/src/main/ets/test/getThumbnailCallback.test.ets
浏览文件 @
5e72cd63
...
...
@@ -22,7 +22,6 @@ import {
IMAGE_TYPE
,
VIDEO_TYPE
,
AUDIO_TYPE
,
FILEKEY
,
checkPresetsAssets
,
checkAssetsCount
,
fetchOps
,
...
...
@@ -35,7 +34,7 @@ export default function getThumbnailCallback(abilityContext) {
beforeAll
(
async
function
()
{
console
.
info
(
'beforeAll case'
);
await
getPermission
();
await
checkPresetsAssets
(
media
,
'ActsMediaLibraryGetThumbnail'
);
await
checkPresetsAssets
(
media
,
'ActsMediaLibraryGetThumbnail
Test
'
);
});
beforeEach
(
function
()
{
console
.
info
(
'beforeEach case'
);
...
...
multimedia/medialibrary/mediaLibrary_getThumbnail/entry/src/main/ets/test/getThumbnailPromise.test.ets
浏览文件 @
5e72cd63
...
...
@@ -21,8 +21,6 @@ import {
IMAGE_TYPE
,
VIDEO_TYPE
,
AUDIO_TYPE
,
FILEKEY
,
checkPresetsAssets
,
checkAssetsCount
,
fetchOps
,
getPermission
,
...
...
@@ -35,7 +33,6 @@ export default function getThumbnailPromise(abilityContext) {
beforeAll
(
async
function
()
{
console
.
info
(
'beforeAll case'
);
await
getPermission
();
await
checkPresetsAssets
(
media
,
'ActsMediaLibraryGetThumbnail'
);
});
beforeEach
(
function
()
{
console
.
info
(
'beforeEach case'
);
...
...
multimedia/medialibrary/mediaLibrary_mediafetchoptions/entry/src/main/ets/test/mediafetchoptionsCallback.test.ets
浏览文件 @
5e72cd63
...
...
@@ -23,7 +23,6 @@ import {
AUDIO_TYPE,
VIDEO_TYPE,
FILE_TYPE,
FILEKEY,
checkPresetsAssets,
checkAssetsCount,
fetchOps,
...
...
@@ -36,7 +35,7 @@ export default function mediafetchoptionsCallback(abilityContext) {
beforeAll(async function () {
console.info('beforeAll case');
await getPermission();
await checkPresetsAssets(media, 'ActsMediaLibrary
FileAssetUri
');
await checkPresetsAssets(media, 'ActsMediaLibrary
MediafetchoptionsTest
');
});
beforeEach(function () {
console.info('beforeEach case');
...
...
multimedia/medialibrary/mediaLibrary_mediafetchoptions/entry/src/main/ets/test/mediafetchoptionsPromise.test.ets
浏览文件 @
5e72cd63
...
...
@@ -24,10 +24,8 @@ import {
VIDEO_TYPE,
FILE_TYPE,
FILEKEY,
checkPresetsAssets,
checkAssetsCount,
fetchOps,
getPermission,
} from '../../../../../../common';
export default function mediafetchoptionsPromise(abilityContext) {
...
...
@@ -35,7 +33,6 @@ export default function mediafetchoptionsPromise(abilityContext) {
const media = mediaLibrary.getMediaLibrary(abilityContext);
beforeAll(async function () {
console.info('beforeAll case');
await checkPresetsAssets(media, 'ActsMediaLibraryFileAssetUri');
});
beforeEach(function () {
console.info('beforeEach case');
...
...
multimedia/medialibrary/mediaLibrary_trash/entry/src/main/ets/test/trashCallback.test.ets
浏览文件 @
5e72cd63
...
...
@@ -25,6 +25,7 @@ import {
getPermission
,
albumFetchOps
,
fileIdFetchOps
,
checkPresetsAssets
,
}
from
"../../../../../../common"
;
export
default
function
trashCallback
(
abilityContext
)
{
...
...
@@ -32,6 +33,7 @@ export default function trashCallback(abilityContext) {
beforeAll
(
async
function
()
{
await
getPermission
();
console
.
info
(
"beforeAll case"
);
await
checkPresetsAssets
(
media
,
'ActsMediaLibraryTrashJsTest'
);
});
beforeEach
(
function
()
{
console
.
info
(
"beforeEach case"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录