Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
b4481ea5
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看板
未验证
提交
b4481ea5
编写于
9月 29, 2022
作者:
O
openharmony_ci
提交者:
Gitee
9月 29, 2022
浏览文件
操作
浏览文件
下载
差异文件
!5779 【3.2-Beta3】【ufm】add fileKey xts
Merge pull request !5779 from yangbo/0929_xts_Beta3
上级
233adda7
190dd59a
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
486 addition
and
0 deletion
+486
-0
multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/List.test.ets
...erfilemgr_fileAsset/entry/src/main/ets/test/List.test.ets
+2
-0
multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileKeyTest.test.ets
...gr_fileAsset/entry/src/main/ets/test/fileKeyTest.test.ets
+484
-0
未找到文件。
multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/List.test.ets
浏览文件 @
b4481ea5
...
...
@@ -25,6 +25,7 @@ import fileAssetOpenCallbackTest from './fileAssetOpenCallback.test.ets'
import fileAssetOpenPromiseTest from './fileAssetOpenPromise.test.ets'
import fileAssetTrashCallbackTest from './fileAssetTrashCallback.test.ets'
import fileAssetTrashPromiseTest from './fileAssetTrashPromise.test.ets'
import fileKeyTest from './fileKeyTest.test.ets'
export default function testsuite(abilityContext) {
fileAssetCommitModifyCallbackTest(abilityContext)
fileAssetCommitModifyPromiseTest(abilityContext)
...
...
@@ -38,4 +39,5 @@ export default function testsuite(abilityContext) {
fileAssetOpenPromiseTest(abilityContext)
fileAssetTrashCallbackTest(abilityContext)
fileAssetTrashPromiseTest(abilityContext)
fileKeyTest(abilityContext)
}
multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileKeyTest.test.ets
0 → 100644
浏览文件 @
b4481ea5
/*
* Copyright (C) 2022 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import userfile_manager from '@ohos.filemanagement.userfile_manager';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
import {
sleep,
IMAGE_TYPE,
VIDEO_TYPE,
AUDIO_TYPE,
FILE_TYPE,
fileNameFetchOps,
audioNameFetchOps,
imageVideoNameFetchOps,
albumFetchOps,
checkPresetsAssets,
checkAssetsCount,
checkAlbumsCount,
} from '../../../../../../common';
export default function fileKeyTest(abilityContext) {
describe('fileKeyTest', function () {
const userfile_mgr = userfile_manager.getUserFileMgr(abilityContext);
beforeAll(async function () {
console.info('beforeAll case');
await checkPresetsAssets(userfile_mgr, 'ActsUserFileMgrFileAssetJsTest')
});
beforeEach(function () {
console.info('beforeEach case');
});
afterEach(async function () {
console.info('afterEach case');
await sleep()
});
afterAll(function () {
console.info('afterAll case');
});
const FileKey = userfile_manager.FileKey;
const AudioKey = userfile_manager.AudioKey;
const ImageVideoKey = userfile_manager.ImageVideoKey;
const AlbumKey = userfile_manager.AlbumKey;
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_01_001
* @tc.name : FileKey
* @tc.desc : FileKey.URI
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_01_001', 0, async function (done) {
let key = FileKey.URI;
expect(key.toString()).assertEqual('uri');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_01_002
* @tc.name : FileKey
* @tc.desc : FileKey.RELATIVE_PATH
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_01_002', 0, async function (done) {
let key = FileKey.RELATIVE_PATH;
expect(key.toString()).assertEqual('relative_path');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_01_003
* @tc.name : FileKey
* @tc.desc : FileKey.DISPLAY_NAME
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_01_003', 0, async function (done) {
let key = FileKey.DISPLAY_NAME;
expect(key.toString()).assertEqual('display_name');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_01_004
* @tc.name : FileKey
* @tc.desc : FileKey.DATE_ADDED
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_01_004', 0, async function (done) {
let key = FileKey.DATE_ADDED;
expect(key.toString()).assertEqual('date_added');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_01_005
* @tc.name : FileKey
* @tc.desc : FileKey.DATE_MODIFIED
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_01_005', 0, async function (done) {
let key = FileKey.DATE_MODIFIED;
expect(key.toString()).assertEqual('date_modified');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_01_006
* @tc.name : FileKey
* @tc.desc : FileKey.TITLE
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_01_006', 0, async function (done) {
let key = FileKey.TITLE;
expect(key.toString()).assertEqual('title');
done();
});
//-----------------------------------------------------------------------------
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_02_001
* @tc.name : AudioKey
* @tc.desc : AudioKey.URI
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_02_001', 0, async function (done) {
let key = AudioKey.URI;
expect(key.toString()).assertEqual('uri');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_02_002
* @tc.name : AudioKey
* @tc.desc : AudioKey.RELATIVE_PATH
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_02_002', 0, async function (done) {
let key = AudioKey.RELATIVE_PATH;
expect(key.toString()).assertEqual('relative_path');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_02_003
* @tc.name : AudioKey
* @tc.desc : AudioKey.DISPLAY_NAME
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_02_003', 0, async function (done) {
let key = AudioKey.DISPLAY_NAME;
expect(key.toString()).assertEqual('display_name');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_02_004
* @tc.name : AudioKey
* @tc.desc : AudioKey.DATE_ADDED
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_02_004', 0, async function (done) {
let key = AudioKey.DATE_ADDED;
expect(key.toString()).assertEqual('date_added');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_02_005
* @tc.name : AudioKey
* @tc.desc : AudioKey.DATE_MODIFIED
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_02_005', 0, async function (done) {
let key = AudioKey.DATE_MODIFIED;
expect(key.toString()).assertEqual('date_modified');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_02_006
* @tc.name : AudioKey
* @tc.desc : AudioKey.TITLE
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_02_006', 0, async function (done) {
let key = AudioKey.TITLE;
expect(key.toString()).assertEqual('title');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_02_007
* @tc.name : AudioKey
* @tc.desc : AudioKey.ARTIST
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_02_007', 0, async function (done) {
let key = AudioKey.ARTIST;
expect(key.toString()).assertEqual('artist');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_02_008
* @tc.name : AudioKey
* @tc.desc : AudioKey.AUDIOALBUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_02_008', 0, async function (done) {
let key = AudioKey.AUDIOALBUM;
expect(key.toString()).assertEqual('audio_album');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_02_009
* @tc.name : AudioKey
* @tc.desc : AudioKey.DURATION
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_02_009', 0, async function (done) {
let key = AudioKey.DURATION;
expect(key.toString()).assertEqual('duration');
done();
});
//-----------------------------------------------------------------------------
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_03_001
* @tc.name : ImageVideoKey
* @tc.desc : ImageVideoKey.URI
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_03_001', 0, async function (done) {
let key = ImageVideoKey.URI;
expect(key.toString()).assertEqual('uri');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_03_002
* @tc.name : ImageVideoKey
* @tc.desc : ImageVideoKey.RELATIVE_PATH
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_03_002', 0, async function (done) {
let key = ImageVideoKey.RELATIVE_PATH;
expect(key.toString()).assertEqual('relative_path');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_03_003
* @tc.name : ImageVideoKey
* @tc.desc : ImageVideoKey.DISPLAY_NAME
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_03_003', 0, async function (done) {
let key = ImageVideoKey.DISPLAY_NAME;
expect(key.toString()).assertEqual('display_name');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_03_004
* @tc.name : ImageVideoKey
* @tc.desc : ImageVideoKey.DATE_ADDED
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_03_004', 0, async function (done) {
let key = ImageVideoKey.DATE_ADDED;
expect(key.toString()).assertEqual('date_added');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_03_005
* @tc.name : ImageVideoKey
* @tc.desc : ImageVideoKey.DATE_MODIFIED
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_03_005', 0, async function (done) {
let key = ImageVideoKey.DATE_MODIFIED;
expect(key.toString()).assertEqual('date_modified');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_03_006
* @tc.name : ImageVideoKey
* @tc.desc : ImageVideoKey.TITLE
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_03_006', 0, async function (done) {
let key = ImageVideoKey.TITLE;
expect(key.toString()).assertEqual('title');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_03_007
* @tc.name : ImageVideoKey
* @tc.desc : ImageVideoKey.DURATION
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_03_007', 0, async function (done) {
let key = ImageVideoKey.DURATION;
expect(key.toString()).assertEqual('duration');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_03_008
* @tc.name : ImageVideoKey
* @tc.desc : ImageVideoKey.WIDTH
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_03_008', 0, async function (done) {
let key = ImageVideoKey.WIDTH;
expect(key.toString()).assertEqual('width');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_03_009
* @tc.name : ImageVideoKey
* @tc.desc : ImageVideoKey.HEIGHT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_03_009', 0, async function (done) {
let key = ImageVideoKey.HEIGHT;
expect(key.toString()).assertEqual('height');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_03_010
* @tc.name : ImageVideoKey
* @tc.desc : ImageVideoKey.DATE_TAKEN
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETFILEASSETBYKEY_CALLBACK_03_010', 0, async function (done) {
let key = ImageVideoKey.DATE_TAKEN;
expect(key.toString()).assertEqual('date_taken');
done();
});
//-----------------------------------------------------------------------------
/**
* @tc.number : SUB_USERFILE_MGR_GETALBUMSBYKEY_CALLBACK_01
* @tc.name : AlbumKey
* @tc.desc : AlbumKey.URI
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETALBUMSBYKEY_CALLBACK_01', 0, async function (done) {
let key = AlbumKey.URI;
expect(key.toString()).assertEqual('uri');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETALBUMSBYKEY_CALLBACK_02
* @tc.name : AlbumKey
* @tc.desc : AlbumKey.RELATIVE_PATH
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETALBUMSBYKEY_CALLBACK_02', 0, async function (done) {
let key = AlbumKey.RELATIVE_PATH;
expect(key.toString()).assertEqual('relative_path');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETALBUMSBYKEY_CALLBACK_03
* @tc.name : AlbumKey
* @tc.desc : AlbumKey.DISPLAY_NAME
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETALBUMSBYKEY_CALLBACK_03', 0, async function (done) {
let key = AlbumKey.DISPLAY_NAME;
expect(key.toString()).assertEqual('display_name');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETALBUMSBYKEY_CALLBACK_04
* @tc.name : AlbumKey
* @tc.desc : AlbumKey.DATE_ADDED
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETALBUMSBYKEY_CALLBACK_04', 0, async function (done) {
let key = AlbumKey.DATE_ADDED;
expect(key.toString()).assertEqual('date_added');
done();
});
/**
* @tc.number : SUB_USERFILE_MGR_GETALBUMSBYKEY_CALLBACK_05
* @tc.name : AlbumKey
* @tc.desc : AlbumKey.DATE_MODIFIED
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_USERFILE_MGR_GETALBUMSBYKEY_CALLBACK_05', 0, async function (done) {
let key = AlbumKey.DATE_MODIFIED;
expect(key.toString()).assertEqual('date_modified');
done();
});
});
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录