Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
17b875f3
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看板
提交
17b875f3
编写于
8月 29, 2022
作者:
C
caochuan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
check dateModified change
Signed-off-by:
N
caochuan
<
caochuan@huawei.com
>
上级
007e3b23
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
59 addition
and
6 deletion
+59
-6
multimedia/medialibrary/common.js
multimedia/medialibrary/common.js
+11
-1
multimedia/medialibrary/mediaLibrary_base/entry/src/main/ets/test/mediaLibraryTestCallback.test.ets
...entry/src/main/ets/test/mediaLibraryTestCallback.test.ets
+17
-2
multimedia/medialibrary/mediaLibrary_base/entry/src/main/ets/test/mediaLibraryTestPromise.test.ets
.../entry/src/main/ets/test/mediaLibraryTestPromise.test.ets
+19
-3
multimedia/medialibrary/mediaLibrary_fileAsset/entry/src/main/ets/test/fileAssetTestCallback.test.ets
...et/entry/src/main/ets/test/fileAssetTestCallback.test.ets
+6
-0
multimedia/medialibrary/mediaLibrary_fileAsset/entry/src/main/ets/test/fileAssetTestPromise.test.ets
...set/entry/src/main/ets/test/fileAssetTestPromise.test.ets
+6
-0
未找到文件。
multimedia/medialibrary/common.js
浏览文件 @
17b875f3
...
@@ -75,6 +75,15 @@ const idFetchOps = function (testNum, albumId) {
...
@@ -75,6 +75,15 @@ const idFetchOps = function (testNum, albumId) {
return
ops
return
ops
}
}
const
fileIdFetchOps
=
function
(
testNum
,
id
)
{
let
ops
=
{
selections
:
FILEKEY
.
ID
+
"
= ?
"
,
selectionArgs
:
[
id
+
""
],
};
console
.
info
(
`
${
testNum
}
: fetchOps
${
JSON
.
stringify
(
ops
)}
`
);
return
ops
;
};
const
albumFetchOps
=
function
(
testNum
,
path
,
albumName
,
type
,
const
albumFetchOps
=
function
(
testNum
,
path
,
albumName
,
type
,
others
=
{
order
:
FILEKEY
.
DATE_ADDED
+
"
DESC
"
,
})
{
others
=
{
order
:
FILEKEY
.
DATE_ADDED
+
"
DESC
"
,
})
{
let
ops
=
{
let
ops
=
{
...
@@ -214,4 +223,5 @@ export {
...
@@ -214,4 +223,5 @@ export {
checkAlbumsCount
,
checkAlbumsCount
,
MODIFY_ERROR_CODE_01
,
MODIFY_ERROR_CODE_01
,
isNum
,
isNum
,
}
fileIdFetchOps
,
};
multimedia/medialibrary/mediaLibrary_base/entry/src/main/ets/test/mediaLibraryTestCallback.test.ets
浏览文件 @
17b875f3
...
@@ -528,7 +528,7 @@ export default function mediaLibraryTestCallback(abilityContext) {
...
@@ -528,7 +528,7 @@ export default function mediaLibraryTestCallback(abilityContext) {
/**
/**
* @tc.number : SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETPUBLICDIRECTORY_004
* @tc.number : SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETPUBLICDIRECTORY_004
* @tc.name : getPublicDirectory
* @tc.name : getPublicDirectory
* @tc.desc : getPublicDirectory DIR_
IMAGE
* @tc.desc : getPublicDirectory DIR_
AUDIO
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level 0
* @tc.level : Level 0
...
@@ -549,7 +549,7 @@ export default function mediaLibraryTestCallback(abilityContext) {
...
@@ -549,7 +549,7 @@ export default function mediaLibraryTestCallback(abilityContext) {
* @tc.level : Level 0
* @tc.level : Level 0
*/
*/
it
(
'SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETPUBLICDIRECTORY_005'
,
0
,
async
function
(
done
)
{
it
(
'SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETPUBLICDIRECTORY_005'
,
0
,
async
function
(
done
)
{
let
testNum
=
'SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETPUBLICDIRECTORY_00
4
'
;
let
testNum
=
'SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETPUBLICDIRECTORY_00
5
'
;
let
dir
=
mediaLibrary
.
DirectoryType
.
DIR_DOCUMENTS
;
let
dir
=
mediaLibrary
.
DirectoryType
.
DIR_DOCUMENTS
;
let
val
=
'Documents/'
;
let
val
=
'Documents/'
;
await
checkGetPublicDirectory
(
done
,
testNum
,
dir
,
val
)
await
checkGetPublicDirectory
(
done
,
testNum
,
dir
,
val
)
...
@@ -576,6 +576,21 @@ export default function mediaLibraryTestCallback(abilityContext) {
...
@@ -576,6 +576,21 @@ export default function mediaLibraryTestCallback(abilityContext) {
}
}
});
});
/**
* @tc.number : SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETPUBLICDIRECTORY_007
* @tc.name : getPublicDirectory
* @tc.desc : getPublicDirectory DIR_DOWNLOAD
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETPUBLICDIRECTORY_007'
,
0
,
async
function
(
done
)
{
let
testNum
=
'SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETPUBLICDIRECTORY_007'
;
let
dir
=
mediaLibrary
.
DirectoryType
.
DIR_DOWNLOAD
;
let
val
=
'Download/'
;
await
checkGetPublicDirectory
(
done
,
testNum
,
dir
,
val
)
});
/**
/**
* @tc.number : SUB__MEDIA_MIDIALIBRARY_CALLBACK_CREATEASSET_001
* @tc.number : SUB__MEDIA_MIDIALIBRARY_CALLBACK_CREATEASSET_001
* @tc.name : createAsset
* @tc.name : createAsset
...
...
multimedia/medialibrary/mediaLibrary_base/entry/src/main/ets/test/mediaLibraryTestPromise.test.ets
浏览文件 @
17b875f3
...
@@ -507,7 +507,7 @@ export default function mediaLibraryTestPromiseTest(abilityContext) {
...
@@ -507,7 +507,7 @@ export default function mediaLibraryTestPromiseTest(abilityContext) {
/**
/**
* @tc.number : SUB__MEDIA_MIDIALIBRARY_PROMISE_GETPUBLICDIRECTORY_004
* @tc.number : SUB__MEDIA_MIDIALIBRARY_PROMISE_GETPUBLICDIRECTORY_004
* @tc.name : getPublicDirectory
* @tc.name : getPublicDirectory
* @tc.desc : getPublicDirectory DIR_
IMAGE
* @tc.desc : getPublicDirectory DIR_
AUDIO
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level 0
* @tc.level : Level 0
...
@@ -522,13 +522,13 @@ export default function mediaLibraryTestPromiseTest(abilityContext) {
...
@@ -522,13 +522,13 @@ export default function mediaLibraryTestPromiseTest(abilityContext) {
/**
/**
* @tc.number : SUB__MEDIA_MIDIALIBRARY_PROMISE_GETPUBLICDIRECTORY_005
* @tc.number : SUB__MEDIA_MIDIALIBRARY_PROMISE_GETPUBLICDIRECTORY_005
* @tc.name : getPublicDirectory
* @tc.name : getPublicDirectory
* @tc.desc : getPublicDirectory DIR_
IMAGE
* @tc.desc : getPublicDirectory DIR_
DOCUMENTS
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level 0
* @tc.level : Level 0
*/
*/
it
(
'SUB__MEDIA_MIDIALIBRARY_PROMISE_GETPUBLICDIRECTORY_005'
,
0
,
async
function
(
done
)
{
it
(
'SUB__MEDIA_MIDIALIBRARY_PROMISE_GETPUBLICDIRECTORY_005'
,
0
,
async
function
(
done
)
{
let
testNum
=
'SUB__MEDIA_MIDIALIBRARY_PROMISE_GETPUBLICDIRECTORY_00
4
'
;
let
testNum
=
'SUB__MEDIA_MIDIALIBRARY_PROMISE_GETPUBLICDIRECTORY_00
5
'
;
let
dir
=
mediaLibrary
.
DirectoryType
.
DIR_DOCUMENTS
;
let
dir
=
mediaLibrary
.
DirectoryType
.
DIR_DOCUMENTS
;
let
val
=
'Documents/'
;
let
val
=
'Documents/'
;
await
checkGetPublicDirectory
(
done
,
testNum
,
dir
,
val
)
await
checkGetPublicDirectory
(
done
,
testNum
,
dir
,
val
)
...
@@ -555,6 +555,22 @@ export default function mediaLibraryTestPromiseTest(abilityContext) {
...
@@ -555,6 +555,22 @@ export default function mediaLibraryTestPromiseTest(abilityContext) {
}
}
});
});
/**
* @tc.number : SUB__MEDIA_MIDIALIBRARY_PROMISE_GETPUBLICDIRECTORY_007
* @tc.name : getPublicDirectory
* @tc.desc : getPublicDirectory DIR_DOWNLOAD
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'SUB__MEDIA_MIDIALIBRARY_PROMISE_GETPUBLICDIRECTORY_007'
,
0
,
async
function
(
done
)
{
let
testNum
=
'SUB__MEDIA_MIDIALIBRARY_PROMISE_GETPUBLICDIRECTORY_007'
;
let
dir
=
mediaLibrary
.
DirectoryType
.
DIR_DOWNLOAD
;
let
val
=
'Download/'
;
await
checkGetPublicDirectory
(
done
,
testNum
,
dir
,
val
)
});
/**
/**
* @tc.number : SUB__MEDIA_MIDIALIBRARY_PROMISE_CREATEASSET_001
* @tc.number : SUB__MEDIA_MIDIALIBRARY_PROMISE_CREATEASSET_001
* @tc.name : createAsset
* @tc.name : createAsset
...
...
multimedia/medialibrary/mediaLibrary_fileAsset/entry/src/main/ets/test/fileAssetTestCallback.test.ets
浏览文件 @
17b875f3
...
@@ -26,6 +26,7 @@ import {
...
@@ -26,6 +26,7 @@ import {
checkAssetsCount,
checkAssetsCount,
fetchOps,
fetchOps,
isNum,
isNum,
fileIdFetchOps,
} from '../../../../../../common';
} from '../../../../../../common';
export default function fileAssetTestCallbackTest(abilityContext) {
export default function fileAssetTestCallbackTest(abilityContext) {
describe('fileAssetTestCallbackTest', function () {
describe('fileAssetTestCallbackTest', function () {
...
@@ -76,6 +77,11 @@ export default function fileAssetTestCallbackTest(abilityContext) {
...
@@ -76,6 +77,11 @@ export default function fileAssetTestCallbackTest(abilityContext) {
console.info(`fd1:${fd1},fd:${fd}`)
console.info(`fd1:${fd1},fd:${fd}`)
await asset.close(fd);
await asset.close(fd);
await asset1.close(fd1);
await asset1.close(fd1);
let newFetchFileResult = await media.getFileAssets(fileIdFetchOps(testNum, asset.id));
let checkAssetCountPass = await checkAssetsCount(done, testNum, newFetchFileResult, 1);
if (!checkAssetCountPass) return;
let newAsset = await newFetchFileResult.getFirstObject();
expect(newAsset.dateModified != asset.dateModified).assertTrue();
done();
done();
});
});
...
...
multimedia/medialibrary/mediaLibrary_fileAsset/entry/src/main/ets/test/fileAssetTestPromise.test.ets
浏览文件 @
17b875f3
...
@@ -26,6 +26,7 @@ import {
...
@@ -26,6 +26,7 @@ import {
checkAssetsCount,
checkAssetsCount,
fetchOps,
fetchOps,
isNum,
isNum,
fileIdFetchOps,
} from '../../../../../../common';
} from '../../../../../../common';
export default function fileAssetTestPromiseTest(abilityContext) {
export default function fileAssetTestPromiseTest(abilityContext) {
describe('fileAssetTestPromiseTest', function () {
describe('fileAssetTestPromiseTest', function () {
...
@@ -70,6 +71,11 @@ export default function fileAssetTestPromiseTest(abilityContext) {
...
@@ -70,6 +71,11 @@ export default function fileAssetTestPromiseTest(abilityContext) {
console.info(`fd1:${fd1},fd:${fd}`)
console.info(`fd1:${fd1},fd:${fd}`)
await asset.close(fd);
await asset.close(fd);
await asset1.close(fd1);
await asset1.close(fd1);
let newFetchFileResult = await media.getFileAssets(fileIdFetchOps(testNum, asset.id));
checkAssetCountPass = await checkAssetsCount(done, testNum, newFetchFileResult, 1);
if (!checkAssetCountPass) return;
let newAsset = await newFetchFileResult.getFirstObject();
expect(newAsset.dateModified != asset.dateModified).assertTrue();
done();
done();
} catch (error) {
} catch (error) {
console.info(`${testNum} :: error: ${error}`);
console.info(`${testNum} :: error: ${error}`);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录