diff --git a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetCommitModifyCallback.test.ets b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetCommitModifyCallback.test.ets index bc01c7c40c55256e73fe25e148f2c8f0ef956ffb..4c394f5e1bc73a5c1e076434a500f1c0fec5dc0b 100755 --- a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetCommitModifyCallback.test.ets +++ b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetCommitModifyCallback.test.ets @@ -56,8 +56,8 @@ export default function fileAssetCommitModifyCallbackTest(abilityContext) { let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1); if (!checkAssetCountPass) return; const asset = await fetchAssetResult.getFirstObject(); - const oldVal = asset[prop] - asset[prop] = val; + const oldVal = asset.get(prop); + asset.set(prop, val); await asset.commitModify(async (err) => { if (err) { console.info(`${testNum} err : ${err}`) @@ -65,7 +65,7 @@ export default function fileAssetCommitModifyCallbackTest(abilityContext) { done(); return; } - asset[prop] = oldVal; + asset.set(prop, oldVal.toString()); await asset.commitModify(); fetchAssetResult.close(); done(); @@ -88,7 +88,7 @@ export default function fileAssetCommitModifyCallbackTest(abilityContext) { it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_01', 0, async function (done) { let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_01'; let fetchOp = imageVideoNameFetchOps(testNum, 'Pictures/ModifyCb/', '01.jpg'); - let prop = 'displayName'; + let prop = 'display_name'; let val = IMAGE_TYPE.toString() + '.jpg'; let isAudio = false; await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio); @@ -105,7 +105,7 @@ export default function fileAssetCommitModifyCallbackTest(abilityContext) { it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_02', 0, async function (done) { let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_02'; let fetchOp = audioNameFetchOps(testNum, 'Audios/ModifyCb/', '01.mp3'); - let prop = 'displayName'; + let prop = 'display_name'; let val = AUDIO_TYPE.toString() + '.mp3'; let isAudio = true; await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio); @@ -122,7 +122,7 @@ export default function fileAssetCommitModifyCallbackTest(abilityContext) { it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_03', 0, async function (done) { let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_CALLBACK_03'; let fetchOp = imageVideoNameFetchOps(testNum, 'Videos/ModifyCb/', '01.mp4'); - let prop = 'displayName'; + let prop = 'display_name'; let val = VIDEO_TYPE.toString() + '.mp4'; let isAudio = false; await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio); diff --git a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetCommitModifyPromise.test.ets b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetCommitModifyPromise.test.ets index 7dcaf974e798d5a52c4e261050507e89a3ae19eb..34043c6d46eea754a950b1b4071196a6acb6e756 100755 --- a/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetCommitModifyPromise.test.ets +++ b/multimedia/userfilemgr/userfilemgr_fileAsset/entry/src/main/ets/test/fileAssetCommitModifyPromise.test.ets @@ -54,10 +54,10 @@ export default function fileAssetCommitModifyPromiseTest(abilityContext) { let checkAssetCountPass = await checkAssetsCount(done, testNum, fetchAssetResult, 1); if (!checkAssetCountPass) return; const asset = await fetchAssetResult.getFirstObject(); - const oldVal = asset[prop] - asset[prop] = val; + const oldVal = asset.get(prop) + asset.set(prop, val); await asset.commitModify(); - asset[prop] = oldVal; + asset.set(prop, oldVal.toString()); await asset.commitModify(); fetchAssetResult.close(); done(); @@ -79,7 +79,7 @@ export default function fileAssetCommitModifyPromiseTest(abilityContext) { it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_01', 0, async function (done) { let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_01'; let fetchOp = imageVideoNameFetchOps(testNum, 'Pictures/ModifyPro/', '01.jpg'); - let prop = 'displayName'; + let prop = 'display_name'; let val = IMAGE_TYPE.toString() + '.jpg'; let isAudio = false; await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio); @@ -96,7 +96,7 @@ export default function fileAssetCommitModifyPromiseTest(abilityContext) { it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_02', 0, async function (done) { let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_02'; let fetchOp = audioNameFetchOps(testNum, 'Audios/ModifyPro/', '01.mp3'); - let prop = 'displayName'; + let prop = 'display_name'; let val = AUDIO_TYPE.toString() + '.mp3'; let isAudio = true; await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio); @@ -113,7 +113,7 @@ export default function fileAssetCommitModifyPromiseTest(abilityContext) { it('SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_03', 0, async function (done) { let testNum = 'SUB_USERFILE_MGR_FILEASSET_COMMITMODIFY_PROMISE_03'; let fetchOp = imageVideoNameFetchOps(testNum, 'Videos/ModifyPro/', '01.mp4'); - let prop = 'displayName'; + let prop = 'display_name'; let val = VIDEO_TYPE.toString() + '.mp4'; let isAudio = false; await checkCommitModify(done, testNum, fetchOp, prop, val, isAudio);