Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
35d3c412
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看板
未验证
提交
35d3c412
编写于
5月 23, 2023
作者:
O
openharmony_ci
提交者:
Gitee
5月 23, 2023
浏览文件
操作
浏览文件
下载
差异文件
!8694 非必传参数传入undefined场景用例覆盖
Merge pull request !8694 from yangbo/xts
上级
25198824
ae67b63b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
113 addition
and
44 deletion
+113
-44
multimedia/medialibrary/common.js
multimedia/medialibrary/common.js
+1
-1
multimedia/medialibrary/mediaLibrary_album/entry/src/main/ets/test/albumGetFileAssetsPromise.test.ets
...ntry/src/main/ets/test/albumGetFileAssetsPromise.test.ets
+79
-1
multimedia/medialibrary/mediaLibrary_getThumbnail/entry/src/main/ets/test/getThumbnailPromise.test.ets
...nail/entry/src/main/ets/test/getThumbnailPromise.test.ets
+33
-42
未找到文件。
multimedia/medialibrary/common.js
浏览文件 @
35d3c412
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
multimedia/medialibrary/mediaLibrary_album/entry/src/main/ets/test/albumGetFileAssetsPromise.test.ets
浏览文件 @
35d3c412
/*
* 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");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
...
...
@@ -476,5 +476,83 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
let currentFetchOp = albumFetchOps(testNum, "Videos/", "Static", VIDEO_TYPE);
await checkAlbumAssetsNoOps(done, testNum, currentFetchOp, assetsCount);
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_04
* @tc.name : getFileAssets
* @tc.desc : getFileAssets by undefined option
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_04", 0, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_04";
let fetchOp = albumFetchOps(testNum, "Videos/", "Static", VIDEO_TYPE);
try {
const albumList = await media.getAlbums(fetchOp);
// check album length
const albumCountPass = await checkAlbumsCount(done, testNum, albumList, 1);
if (!albumCountPass) return;
const album = albumList[0];
let fetchFileResult;
let fetchAllResult;
try {
fetchFileResult = await album.getFileAssets(undefined);
fetchAllResult = await album.getFileAssets(allFetchOp());
expect(fetchFileResult.getCount()).assertEqual(fetchAllResult.getCount());
} catch (error) {
console.info(`${testNum} getFileAssets fail, error: ${error}`);
expect(false).assertTrue();
}
fetchFileResult.close();
fetchAllResult.close();
done();
} catch (error) {
console.info(`${testNum}, error: ${error}`);
expect(false).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_05
* @tc.name : getFileAssets
* @tc.desc : getFileAssets by null option
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_05", 0, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_05";
let fetchOp = albumFetchOps(testNum, "Videos/", "Static", VIDEO_TYPE);
try {
const albumList = await media.getAlbums(fetchOp);
// check album length
const albumCountPass = await checkAlbumsCount(done, testNum, albumList, 1);
if (!albumCountPass) return;
const album = albumList[0];
let fetchFileResult;
let fetchAllResult;
try {
fetchFileResult = await album.getFileAssets(null);
fetchAllResult = await album.getFileAssets(allFetchOp());
expect(fetchFileResult.getCount()).assertEqual(fetchAllResult.getCount());
} catch (error) {
console.info(`${testNum} getFileAssets fail, error: ${error}`);
expect(false).assertTrue();
}
fetchFileResult.close();
fetchAllResult.close();
done();
} catch (error) {
console.info(`${testNum}, error: ${error}`);
expect(false).assertTrue();
done();
}
});
});
}
multimedia/medialibrary/mediaLibrary_getThumbnail/entry/src/main/ets/test/getThumbnailPromise.test.ets
浏览文件 @
35d3c412
...
...
@@ -87,6 +87,9 @@ export default function getThumbnailPromise(abilityContext) {
size
=
{
width
:
256
,
height
:
256
};
pixelmap
=
await
asset
.
getThumbnail
();
}
else
{
if
(
size
===
undefined
||
size
===
null
)
{
size
=
{
width
:
256
,
height
:
256
};
}
pixelmap
=
await
asset
.
getThumbnail
(
size
);
}
let
info
=
await
pixelmap
.
getImageInfo
();
...
...
@@ -242,6 +245,36 @@ export default function getThumbnailPromise(abilityContext) {
await
testGetThumbnail
(
done
,
testNum
,
dOp
,
size
);
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_001_08
* @tc.name : getThumbnail
* @tc.desc : getThumbnail(image) by undefined size
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
"SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_001_08"
,
0
,
async
function
(
done
)
{
let
testNum
=
"SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_001_08"
;
let
dOp
=
fetchOps
(
testNum
,
"Pictures/Thumbnail/"
,
IMAGE_TYPE
);
let
size
=
undefined
;
await
testGetThumbnail
(
done
,
testNum
,
dOp
,
size
);
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_001_09
* @tc.name : getThumbnail
* @tc.desc : getThumbnail(image) by null size
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
"SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_001_09"
,
0
,
async
function
(
done
)
{
let
testNum
=
"SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_001_09"
;
let
dOp
=
fetchOps
(
testNum
,
"Pictures/Thumbnail/"
,
IMAGE_TYPE
);
let
size
=
null
;
await
testGetThumbnail
(
done
,
testNum
,
dOp
,
size
);
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_ERROR_001_03
* @tc.name : getThumbnail
...
...
@@ -302,20 +335,6 @@ export default function getThumbnailPromise(abilityContext) {
await
testGetThumbnailError
(
done
,
testNum
,
dOp
,
size
);
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_ERROR_001_07
* @tc.name : getThumbnail
* @tc.desc : getThumbnail(image) by null
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it
(
"SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_ERROR_001_07"
,
3
,
async
function
(
done
)
{
let
testNum
=
"SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_ERROR_001_07"
;
let
dOp
=
fetchOpsNew
(
"Pictures/Thumbnail/"
,
IMAGE_TYPE
);
let
size
=
null
;
await
testGetThumbnailError
(
done
,
testNum
,
dOp
,
size
);
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_ERROR_001_08
* @tc.name : getThumbnail
...
...
@@ -498,20 +517,6 @@ export default function getThumbnailPromise(abilityContext) {
await
testGetThumbnailError
(
done
,
testNum
,
dOp
,
size
);
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_ERROR_002_07
* @tc.name : getThumbnail
* @tc.desc : getThumbnail(video) by null
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it
(
"SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_ERROR_002_07"
,
3
,
async
function
(
done
)
{
let
testNum
=
"SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_ERROR_002_07"
;
let
dOp
=
fetchOpsNew
(
"Videos/Thumbnail/"
,
VIDEO_TYPE
);
let
size
=
null
;
await
testGetThumbnailError
(
done
,
testNum
,
dOp
,
size
);
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_ERROR_002_08
* @tc.name : getThumbnail
...
...
@@ -694,20 +699,6 @@ export default function getThumbnailPromise(abilityContext) {
await
testGetThumbnailError
(
done
,
testNum
,
dOp
,
size
);
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_ERROR_003_07
* @tc.name : getThumbnail
* @tc.desc : getThumbnail(audio) by null
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 3
*/
it
(
"SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_ERROR_003_07"
,
3
,
async
function
(
done
)
{
let
testNum
=
"SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_ERROR_003_07"
;
let
dOp
=
fetchOpsNew
(
"Audios/Thumbnail/"
,
AUDIO_TYPE
);
let
size
=
null
;
await
testGetThumbnailError
(
done
,
testNum
,
dOp
,
size
);
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETTHUMBNAIL_PROMISE_ERROR_003_08
* @tc.name : getThumbnail
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录