Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
641b9a33
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
641b9a33
编写于
10月 07, 2022
作者:
Y
yangbo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
set get
Signed-off-by:
N
yangbo
<
yangbo258@h-partners.com
>
上级
b4e88dec
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
12 addition
and
12 deletion
+12
-12
multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetCommitModifyCallback.test.ets
.../src/main/ets/test/fileAssetCommitModifyCallback.test.ets
+6
-6
multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetCommitModifyPromise.test.ets
...y/src/main/ets/test/fileAssetCommitModifyPromise.test.ets
+6
-6
未找到文件。
multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetCommitModifyCallback.test.ets
浏览文件 @
641b9a33
...
@@ -56,8 +56,8 @@ export default function fileAssetCommitModifyCallbackTest(abilityContext) {
...
@@ -56,8 +56,8 @@ export default function fileAssetCommitModifyCallbackTest(abilityContext) {
let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1);
let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1);
if (!checkAssetCountPass) return;
if (!checkAssetCountPass) return;
const asset = await fetchAssetResult.getFirstObject();
const asset = await fetchAssetResult.getFirstObject();
const oldVal = asset
[prop]
const oldVal = asset
.get(prop);
asset
[prop] = val
;
asset
.set(prop, val)
;
await asset.commitModify(async (err) => {
await asset.commitModify(async (err) => {
if (err) {
if (err) {
console.info(`${testNum} err : ${err}`)
console.info(`${testNum} err : ${err}`)
...
@@ -65,7 +65,7 @@ export default function fileAssetCommitModifyCallbackTest(abilityContext) {
...
@@ -65,7 +65,7 @@ export default function fileAssetCommitModifyCallbackTest(abilityContext) {
done();
done();
return;
return;
}
}
asset
[prop] = oldVal
;
asset
.set(prop, oldVal.toString())
;
await asset.commitModify();
await asset.commitModify();
fetchAssetResult.close();
fetchAssetResult.close();
done();
done();
...
@@ -88,7 +88,7 @@ export default function fileAssetCommitModifyCallbackTest(abilityContext) {
...
@@ -88,7 +88,7 @@ export default function fileAssetCommitModifyCallbackTest(abilityContext) {
it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_01', 0, async function (done) {
it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_01', 0, async function (done) {
let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_01';
let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_01';
let fetchOp = imageVideoNameFetchOps(testNum, 'Pictures/ModifyCb/', '01.jpg');
let fetchOp = imageVideoNameFetchOps(testNum, 'Pictures/ModifyCb/', '01.jpg');
let prop = 'display
N
ame';
let prop = 'display
_n
ame';
let val = IMAGE_TYPE.toString() + '.jpg';
let val = IMAGE_TYPE.toString() + '.jpg';
let isAudio = false;
let isAudio = false;
await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio);
await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio);
...
@@ -105,7 +105,7 @@ export default function fileAssetCommitModifyCallbackTest(abilityContext) {
...
@@ -105,7 +105,7 @@ export default function fileAssetCommitModifyCallbackTest(abilityContext) {
it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_02', 0, async function (done) {
it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_02', 0, async function (done) {
let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_02';
let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_02';
let fetchOp = audioNameFetchOps(testNum, 'Audios/ModifyCb/', '01.mp3');
let fetchOp = audioNameFetchOps(testNum, 'Audios/ModifyCb/', '01.mp3');
let prop = 'display
N
ame';
let prop = 'display
_n
ame';
let val = AUDIO_TYPE.toString() + '.mp3';
let val = AUDIO_TYPE.toString() + '.mp3';
let isAudio = true;
let isAudio = true;
await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio);
await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio);
...
@@ -122,7 +122,7 @@ export default function fileAssetCommitModifyCallbackTest(abilityContext) {
...
@@ -122,7 +122,7 @@ export default function fileAssetCommitModifyCallbackTest(abilityContext) {
it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_03', 0, async function (done) {
it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_03', 0, async function (done) {
let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_03';
let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_03';
let fetchOp = imageVideoNameFetchOps(testNum, 'Videos/ModifyCb/', '01.mp4');
let fetchOp = imageVideoNameFetchOps(testNum, 'Videos/ModifyCb/', '01.mp4');
let prop = 'display
N
ame';
let prop = 'display
_n
ame';
let val = VIDEO_TYPE.toString() + '.mp4';
let val = VIDEO_TYPE.toString() + '.mp4';
let isAudio = false;
let isAudio = false;
await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio);
await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio);
...
...
multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetCommitModifyPromise.test.ets
浏览文件 @
641b9a33
...
@@ -54,10 +54,10 @@ export default function fileAssetCommitModifyPromiseTest(abilityContext) {
...
@@ -54,10 +54,10 @@ export default function fileAssetCommitModifyPromiseTest(abilityContext) {
let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1);
let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1);
if (!checkAssetCountPass) return;
if (!checkAssetCountPass) return;
const asset = await fetchAssetResult.getFirstObject();
const asset = await fetchAssetResult.getFirstObject();
const oldVal = asset
[prop]
const oldVal = asset
.get(prop)
asset
[prop] = val
;
asset
.set(prop, val)
;
await asset.commitModify();
await asset.commitModify();
asset
[prop] = oldVal
;
asset
.set(prop, oldVal.toString())
;
await asset.commitModify();
await asset.commitModify();
fetchAssetResult.close();
fetchAssetResult.close();
done();
done();
...
@@ -79,7 +79,7 @@ export default function fileAssetCommitModifyPromiseTest(abilityContext) {
...
@@ -79,7 +79,7 @@ export default function fileAssetCommitModifyPromiseTest(abilityContext) {
it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_01', 0, async function (done) {
it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_01', 0, async function (done) {
let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_01';
let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_01';
let fetchOp = imageVideoNameFetchOps(testNum, 'Pictures/ModifyPro/', '01.jpg');
let fetchOp = imageVideoNameFetchOps(testNum, 'Pictures/ModifyPro/', '01.jpg');
let prop = 'display
N
ame';
let prop = 'display
_n
ame';
let val = IMAGE_TYPE.toString() + '.jpg';
let val = IMAGE_TYPE.toString() + '.jpg';
let isAudio = false;
let isAudio = false;
await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio);
await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio);
...
@@ -96,7 +96,7 @@ export default function fileAssetCommitModifyPromiseTest(abilityContext) {
...
@@ -96,7 +96,7 @@ export default function fileAssetCommitModifyPromiseTest(abilityContext) {
it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_02', 0, async function (done) {
it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_02', 0, async function (done) {
let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_02';
let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_02';
let fetchOp = audioNameFetchOps(testNum, 'Audios/ModifyPro/', '01.mp3');
let fetchOp = audioNameFetchOps(testNum, 'Audios/ModifyPro/', '01.mp3');
let prop = 'display
N
ame';
let prop = 'display
_n
ame';
let val = AUDIO_TYPE.toString() + '.mp3';
let val = AUDIO_TYPE.toString() + '.mp3';
let isAudio = true;
let isAudio = true;
await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio);
await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio);
...
@@ -113,7 +113,7 @@ export default function fileAssetCommitModifyPromiseTest(abilityContext) {
...
@@ -113,7 +113,7 @@ export default function fileAssetCommitModifyPromiseTest(abilityContext) {
it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_03', 0, async function (done) {
it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_03', 0, async function (done) {
let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_03';
let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_03';
let fetchOp = imageVideoNameFetchOps(testNum, 'Videos/ModifyPro/', '01.mp4');
let fetchOp = imageVideoNameFetchOps(testNum, 'Videos/ModifyPro/', '01.mp4');
let prop = 'display
N
ame';
let prop = 'display
_n
ame';
let val = VIDEO_TYPE.toString() + '.mp4';
let val = VIDEO_TYPE.toString() + '.mp4';
let isAudio = false;
let isAudio = false;
await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio);
await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录