提交 59c50192 编写于 作者: Y yangbo

update

Signed-off-by: Nyangbo <yangbo258@huawei.com>
上级 435ea842
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -95,9 +95,6 @@ const fileIdFetchOps = function (testNum, id) { ...@@ -95,9 +95,6 @@ const fileIdFetchOps = function (testNum, id) {
}; };
const albumFetchOps = function (testNum, albumName, others) { const albumFetchOps = function (testNum, albumName, others) {
// if (!others) {
// others = { order: FILEKEY.DATE_ADDED + " DESC" };
// }
let ops = { let ops = {
selections: ALBUM_NAME + "= ?", selections: ALBUM_NAME + "= ?",
selectionArgs: [albumName], selectionArgs: [albumName],
......
...@@ -18,9 +18,8 @@ ...@@ -18,9 +18,8 @@
"scanner", "scanner",
"sleep 5", "sleep 5",
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*", "rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*",
"killall com.ohos.medialibrary.medialibrarydata", "kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"sleep 3", "sleep 3",
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}",
"mkdir /storage/media/100/local/temp", "mkdir /storage/media/100/local/temp",
"param set persist.ace.testmode.enabled 1", "param set persist.ace.testmode.enabled 1",
"power-shell wakeup", "power-shell wakeup",
...@@ -56,7 +55,14 @@ ...@@ -56,7 +55,14 @@
"sleep 10" "sleep 10"
], ],
"teardown-command": [ "teardown-command": [
"power-shell setmode 600" "power-shell setmode 600",
"rm -rf /storage/media/100/local/temp",
"rm -rf /storage/media/100/local/files/*",
"rm -rf /storage/media/100/local/files/.*",
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*",
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner",
"sleep 5"
] ]
}, },
{ {
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -57,7 +57,7 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) { ...@@ -57,7 +57,7 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
const albumCountPass = await checkAlbumsCount(done, testNum, albumList, expectAlbumCount); const albumCountPass = await checkAlbumsCount(done, testNum, albumList, expectAlbumCount);
if (!albumCountPass) return; if (!albumCountPass) return;
// one asset type // one asset type
let count = 0; let count = 0;
for (let i = 0; i < albumList.length; i++) { for (let i = 0; i < albumList.length; i++) {
albumList[i].getFileAssets(allFetchOp(), (err, fetchFileResult) => { albumList[i].getFileAssets(allFetchOp(), (err, fetchFileResult) => {
...@@ -118,6 +118,7 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) { ...@@ -118,6 +118,7 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
done(); done();
} }
} }
const abnormalAlbumAssetsCount = async function (done, testNum, fetchOp, expectAssetsCount, expectAlbumCount = 1) { const abnormalAlbumAssetsCount = async function (done, testNum, fetchOp, expectAssetsCount, expectAlbumCount = 1) {
try { try {
const albumList = await media.getAlbums(fetchOp); const albumList = await media.getAlbums(fetchOp);
...@@ -144,7 +145,7 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) { ...@@ -144,7 +145,7 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
done(); done();
} }
} }
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_01 * @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_01
* @tc.name : getFileAssets * @tc.name : getFileAssets
...@@ -160,21 +161,6 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) { ...@@ -160,21 +161,6 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount) await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount)
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_02
* @tc.name : getFileAssets
* @tc.desc : check Videos album count,check asset count
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_02', 0, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_02';
let assetsCount = [2];
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Videos']);
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount)
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_03 * @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_03
* @tc.name : getFileAssets * @tc.name : getFileAssets
...@@ -209,16 +195,16 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) { ...@@ -209,16 +195,16 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_05 * @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_05
* @tc.name : getFileAssets * @tc.name : getFileAssets
* @tc.desc : check two albums count,check asset count * @tc.desc : check albums count,check asset count
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_05', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_05', 2, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_05'; const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_05';
let assetsCount = [2, 1]; let assetsCount = [2, 1];
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?'; const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Videos', 'Camera']); const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots', 'Camera']);
let albumCount = 2; let albumCount = 2;
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount, albumCount) await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount, albumCount)
}); });
...@@ -226,34 +212,17 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) { ...@@ -226,34 +212,17 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_06 * @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_06
* @tc.name : getFileAssets * @tc.name : getFileAssets
* @tc.desc : check three albums count,check asset count * @tc.desc : check albums count,check asset count
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_06', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_06', 2, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_06'; const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_06';
let assetsCount = [2, 2, 1]; let assetsCount = [2, 1];
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?'; const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Videos', 'Screenshots', 'Camera']); const currentFetchOp = fileFetchOption(testNum, selections, ['ScreenRecordings', 'Screenshots', 'Camera']);
let albumCount = 3; let albumCount = 2;
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount, albumCount)
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_07
* @tc.name : getFileAssets
* @tc.desc : check four albums count,check asset count
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_07', 0, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_07';
let assetsCount = [2, 2, 1];
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'Videos', 'Screenshots', 'ScreenRecordings']);
let albumCount = 3;
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount, albumCount) await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount, albumCount)
}); });
...@@ -263,39 +232,24 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) { ...@@ -263,39 +232,24 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
* @tc.desc : Camera album,abnormal option * @tc.desc : Camera album,abnormal option
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_01', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_01', 2, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_01'; const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_01';
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']); let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']);
let assetsCount = 0; let assetsCount = 0;
await abnormalAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount) await abnormalAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount)
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_02
* @tc.name : getFileAssets
* @tc.desc : Videos album,abnormal option
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_02', 0, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_02';
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Videos']);
let assetsCount = 0;
await abnormalAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount)
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_03 * @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_03
* @tc.name : getFileAssets * @tc.name : getFileAssets
* @tc.desc : Screenshots album,abnormal option * @tc.desc : Screenshots album,abnormal option
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_03', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_03', 2, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_03'; const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_03';
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Screenshots']); let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Screenshots']);
let assetsCount = 0; let assetsCount = 0;
...@@ -308,9 +262,9 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) { ...@@ -308,9 +262,9 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
* @tc.desc : ScreenRecordings album,abnormal option * @tc.desc : ScreenRecordings album,abnormal option
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_04', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_04', 2, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_04'; const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_003_04';
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['ScreenRecordings']); let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['ScreenRecordings']);
let assetsCount = 0; let assetsCount = 0;
...@@ -323,39 +277,24 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) { ...@@ -323,39 +277,24 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
* @tc.desc : Camera album,no option * @tc.desc : Camera album,no option
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_01', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_01', 2, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_01'; const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_01';
let assetsCount = 1; let assetsCount = 1;
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']); let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']);
await checkAlbumAssetsNoOps(done, testNum, currentFetchOp, assetsCount) await checkAlbumAssetsNoOps(done, testNum, currentFetchOp, assetsCount)
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_02
* @tc.name : getFileAssets
* @tc.desc : Videos album,no option
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_02', 0, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_02';
let assetsCount = 2;
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Videos']);
await checkAlbumAssetsNoOps(done, testNum, currentFetchOp, assetsCount)
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_03 * @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_03
* @tc.name : getFileAssets * @tc.name : getFileAssets
* @tc.desc : Screenshots album,no option * @tc.desc : Screenshots album,no option
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_03', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_03', 2, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_03'; const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_03';
let assetsCount = 2; let assetsCount = 2;
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Screenshots']); let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Screenshots']);
...@@ -368,9 +307,9 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) { ...@@ -368,9 +307,9 @@ export default function albumGetFileAssetsCallbackTest(abilityContext) {
* @tc.desc : ScreenRecordings album,no option * @tc.desc : ScreenRecordings album,no option
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_04', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_04', 2, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_04'; const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_004_04';
let assetsCount = 2; let assetsCount = 2;
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['ScreenRecordings']); let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['ScreenRecordings']);
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -78,6 +78,7 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) { ...@@ -78,6 +78,7 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
done(); done();
} }
}; };
const checkAlbumAssetsNoOps = async function (done, testNum, fetchOp, expectAssetsCount, expectAlbumCount = 1) { const checkAlbumAssetsNoOps = async function (done, testNum, fetchOp, expectAssetsCount, expectAlbumCount = 1) {
try { try {
const albumList = await media.getAlbums(fetchOp); const albumList = await media.getAlbums(fetchOp);
...@@ -86,7 +87,6 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) { ...@@ -86,7 +87,6 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
if (!albumCountPass) return; if (!albumCountPass) return;
const album = albumList[0]; const album = albumList[0];
let fetchFileResult = await album.getFileAssets(); let fetchFileResult = await album.getFileAssets();
if (fetchFileResult == undefined) { if (fetchFileResult == undefined) {
console.info(`${testNum} fetchFileResult undefined`); console.info(`${testNum} fetchFileResult undefined`);
...@@ -104,6 +104,7 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) { ...@@ -104,6 +104,7 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
done(); done();
} }
}; };
const abnormalAlbumAssetsCount = async function ( const abnormalAlbumAssetsCount = async function (
done, done,
testNum, testNum,
...@@ -135,6 +136,7 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) { ...@@ -135,6 +136,7 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
done(); done();
} }
}; };
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_01 * @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_01
* @tc.name : getFileAssets * @tc.name : getFileAssets
...@@ -150,21 +152,6 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) { ...@@ -150,21 +152,6 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount) await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount)
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_02
* @tc.name : getFileAssets
* @tc.desc : check Videos album count,check asset count
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_02', 0, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_02';
let assetsCount = [2];
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Videos']);
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount)
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_03 * @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_03
* @tc.name : getFileAssets * @tc.name : getFileAssets
...@@ -199,16 +186,16 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) { ...@@ -199,16 +186,16 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_05 * @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_05
* @tc.name : getFileAssets * @tc.name : getFileAssets
* @tc.desc : check two albums count,check asset count * @tc.desc : check albums count,check asset count
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_05', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_05', 2, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_05'; const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_05';
let assetsCount = [2, 1]; let assetsCount = [2, 1];
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?'; const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Videos', 'Camera']); const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots', 'Camera']);
let albumCount = 2; let albumCount = 2;
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount, albumCount) await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount, albumCount)
}); });
...@@ -216,34 +203,17 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) { ...@@ -216,34 +203,17 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_06 * @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_06
* @tc.name : getFileAssets * @tc.name : getFileAssets
* @tc.desc : check three albums count,check asset count * @tc.desc : check albums count,check asset count
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_06', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_06', 2, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_06'; const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_06';
let assetsCount = [2, 2, 1]; let assetsCount = [2, 1];
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?'; const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'Videos', 'Screenshots']); const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'ScreenRecordings', 'Screenshots']);
let albumCount = 3; let albumCount = 2;
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount, albumCount)
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_07
* @tc.name : getFileAssets
* @tc.desc : check four albums count,check asset count
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_07', 0, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_07';
let assetsCount = [2, 2, 1];
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'Videos', 'Screenshots', 'ScreenRecordings']);
let albumCount = 3;
await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount, albumCount) await checkAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount, albumCount)
}); });
...@@ -253,39 +223,24 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) { ...@@ -253,39 +223,24 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
* @tc.desc : Camera album,abnormal option * @tc.desc : Camera album,abnormal option
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_01', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_01', 2, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_01'; const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_01';
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']); let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']);
let assetsCount = 0; let assetsCount = 0;
await abnormalAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount) await abnormalAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount)
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_02
* @tc.name : getFileAssets
* @tc.desc : Videos album,abnormal option
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_02', 0, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_02';
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Videos']);
let assetsCount = 0;
await abnormalAlbumAssetsCount(done, testNum, currentFetchOp, assetsCount)
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_03 * @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_03
* @tc.name : getFileAssets * @tc.name : getFileAssets
* @tc.desc : Screenshots album,abnormal option * @tc.desc : Screenshots album,abnormal option
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_03', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_03', 2, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_03'; const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_03';
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Screenshots']); let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Screenshots']);
let assetsCount = 0; let assetsCount = 0;
...@@ -298,9 +253,9 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) { ...@@ -298,9 +253,9 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
* @tc.desc : ScreenRecordings album,abnormal option * @tc.desc : ScreenRecordings album,abnormal option
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_04', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_04', 2, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_04'; const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_003_04';
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['ScreenRecordings']); let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['ScreenRecordings']);
let assetsCount = 0; let assetsCount = 0;
...@@ -313,39 +268,24 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) { ...@@ -313,39 +268,24 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
* @tc.desc : Camera album,no option * @tc.desc : Camera album,no option
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_01', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_01', 2, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_01'; const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_01';
let assetsCount = 1; let assetsCount = 1;
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']); let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']);
await checkAlbumAssetsNoOps(done, testNum, currentFetchOp, assetsCount) await checkAlbumAssetsNoOps(done, testNum, currentFetchOp, assetsCount)
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_02
* @tc.name : getFileAssets
* @tc.desc : Videos album,no option
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_02', 0, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_02';
let assetsCount = 2;
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Videos']);
await checkAlbumAssetsNoOps(done, testNum, currentFetchOp, assetsCount)
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_03 * @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_03
* @tc.name : getFileAssets * @tc.name : getFileAssets
* @tc.desc : Screenshots album,no option * @tc.desc : Screenshots album,no option
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_03', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_03', 2, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_03'; const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_03';
let assetsCount = 2; let assetsCount = 2;
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Screenshots']); let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Screenshots']);
...@@ -358,9 +298,9 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) { ...@@ -358,9 +298,9 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
* @tc.desc : ScreenRecordings album,no option * @tc.desc : ScreenRecordings album,no option
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_04', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_04', 2, async function (done) {
const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_04'; const testNum = 'SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_04';
let assetsCount = 2; let assetsCount = 2;
let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['ScreenRecordings']); let currentFetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['ScreenRecordings']);
...@@ -371,12 +311,11 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) { ...@@ -371,12 +311,11 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
* @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_05 * @tc.number : SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_05
* @tc.name : getFileAssets * @tc.name : getFileAssets
* @tc.desc : getFileAssets by undefined option * @tc.desc : getFileAssets by undefined option
* @tc.desc : ScreenRecordings album,no option
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it("SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_05", 0, async function (done) { it("SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_05", 2, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_05"; const testNum = "SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_05";
let fetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']); let fetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']);
try { try {
...@@ -413,9 +352,9 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) { ...@@ -413,9 +352,9 @@ export default function albumGetFileAssetsPromiseTest(abilityContext) {
* @tc.desc : getFileAssets by null option * @tc.desc : getFileAssets by null option
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it("SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_06", 0, async function (done) { it("SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_06", 2, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_06"; const testNum = "SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_004_06";
let fetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']); let fetchOp = fileFetchOption(testNum, FILEKEY.ALBUM_NAME + "= ?", ['Camera']);
try { try {
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -67,6 +67,7 @@ export default function albumTestCallbackTest(abilityContext) { ...@@ -67,6 +67,7 @@ export default function albumTestCallbackTest(abilityContext) {
expect(album.count).assertEqual(prop.count); expect(album.count).assertEqual(prop.count);
expect(album.relativePath).assertEqual(relativePath); expect(album.relativePath).assertEqual(relativePath);
}; };
const checkAlbumInfo = async function (done, testNum, fetchOp, relativePaths, props, expectAlbumCount) { const checkAlbumInfo = async function (done, testNum, fetchOp, relativePaths, props, expectAlbumCount) {
try { try {
media.getAlbums(fetchOp, async (err, albumList) => { media.getAlbums(fetchOp, async (err, albumList) => {
...@@ -221,30 +222,6 @@ export default function albumTestCallbackTest(abilityContext) { ...@@ -221,30 +222,6 @@ export default function albumTestCallbackTest(abilityContext) {
await checkAlbumInfo(done, testNum, currentFetchOp, relativePaths, props, expectAlbumCount); await checkAlbumInfo(done, testNum, currentFetchOp, relativePaths, props, expectAlbumCount);
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_02
* @tc.name : getAlbums
* @tc.desc : get Videos album,check album info
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_02", 0, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_02";
const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Videos']);
const relativePaths = [''];
const expectAlbumCount = 1;
const props = [
{
albumName: "Videos",
albumUri: "file://media/album/",
count: 2,
}
];
await checkAlbumInfo(done, testNum, currentFetchOp, relativePaths, props, expectAlbumCount);
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_03 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_03
* @tc.name : getAlbums * @tc.name : getAlbums
...@@ -296,7 +273,7 @@ export default function albumTestCallbackTest(abilityContext) { ...@@ -296,7 +273,7 @@ export default function albumTestCallbackTest(abilityContext) {
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_05 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_05
* @tc.name : getAlbums * @tc.name : getAlbums
* @tc.desc : get Camera and Videos album,check album info * @tc.desc : get Camera and Screenshots album,check album info
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
...@@ -304,12 +281,12 @@ export default function albumTestCallbackTest(abilityContext) { ...@@ -304,12 +281,12 @@ export default function albumTestCallbackTest(abilityContext) {
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_05", 0, async function (done) { it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_05", 0, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_05"; const testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_05";
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?'; const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'Videos']); const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'Screenshots']);
const relativePaths = ['', '']; const relativePaths = ['', ''];
const expectAlbumCount = 2; const expectAlbumCount = 2;
const props = [ const props = [
{ {
albumName: "Videos", albumName: "Screenshots",
albumUri: "file://media/album/", albumUri: "file://media/album/",
count: 2, count: 2,
}, },
...@@ -325,7 +302,7 @@ export default function albumTestCallbackTest(abilityContext) { ...@@ -325,7 +302,7 @@ export default function albumTestCallbackTest(abilityContext) {
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_06 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_06
* @tc.name : getAlbums * @tc.name : getAlbums
* @tc.desc : get Camera and Videos and Screenshots album,check album info * @tc.desc : get Camera and ScreenRecordings and Screenshots album,check album info
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
...@@ -333,49 +310,10 @@ export default function albumTestCallbackTest(abilityContext) { ...@@ -333,49 +310,10 @@ export default function albumTestCallbackTest(abilityContext) {
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_06", 0, async function (done) { it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_06", 0, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_06"; const testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_06";
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?'; const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'Videos', 'Screenshots']); const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'ScreenRecordings', 'Screenshots']);
const relativePaths = ['', '', '']; const relativePaths = ['', ''];
const expectAlbumCount = 3; const expectAlbumCount = 2;
const props = [
{
albumName: "Videos",
albumUri: "file://media/album/",
count: 2,
},
{
albumName: "Screenshots",
albumUri: "file://media/album/",
count: 2,
},
{
albumName: "Camera",
albumUri: "file://media/album/",
count: 1,
},
];
await checkAlbumInfo(done, testNum, currentFetchOp, relativePaths, props, expectAlbumCount);
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_07
* @tc.name : getAlbums
* @tc.desc : get Camera and Videos and Screenshots and ScreenRecordings album,check album info
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_07", 0, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_001_07";
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'Videos', 'ScreenRecordings', 'Screenshots']);
const relativePaths = ['', '', ''];
const expectAlbumCount = 3;
const props = [ const props = [
{
albumName: "Videos",
albumUri: "file://media/album/",
count: 2,
},
{ {
albumName: "Screenshots", albumName: "Screenshots",
albumUri: "file://media/album/", albumUri: "file://media/album/",
...@@ -398,9 +336,9 @@ export default function albumTestCallbackTest(abilityContext) { ...@@ -398,9 +336,9 @@ export default function albumTestCallbackTest(abilityContext) {
* @tc.desc : Get Album Assets by fileHasArgsfetchOp3 * @tc.desc : Get Album Assets by fileHasArgsfetchOp3
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_06", 0, async function (done) { it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_06", 2, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_06"; const testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_06";
const selections = FILEKEY.ALBUM_NAME + '= ?'; const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['666']); const currentFetchOp = fileFetchOption(testNum, selections, ['666']);
...@@ -413,9 +351,9 @@ export default function albumTestCallbackTest(abilityContext) { ...@@ -413,9 +351,9 @@ export default function albumTestCallbackTest(abilityContext) {
* @tc.desc : Get Album Assets by fileHasArgsfetchOp4 * @tc.desc : Get Album Assets by fileHasArgsfetchOp4
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_07", 0, async function (done) { it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_07", 2, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_07"; let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_07";
const selections = "666" + "= ?"; const selections = "666" + "= ?";
const currentFetchOp = fileFetchOption(testNum, selections, [VIDEO_TYPE.toString()]); const currentFetchOp = fileFetchOption(testNum, selections, [VIDEO_TYPE.toString()]);
...@@ -428,9 +366,9 @@ export default function albumTestCallbackTest(abilityContext) { ...@@ -428,9 +366,9 @@ export default function albumTestCallbackTest(abilityContext) {
* @tc.desc : Get Album Assets by fileHasArgsfetchOp5 * @tc.desc : Get Album Assets by fileHasArgsfetchOp5
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_08", 0, async function (done) { it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_08", 2, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_08"; const testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_08";
const selections = "666" + "= ?"; const selections = "666" + "= ?";
const currentFetchOp = fileFetchOption(testNum, selections, ['666']); const currentFetchOp = fileFetchOption(testNum, selections, ['666']);
...@@ -445,9 +383,9 @@ export default function albumTestCallbackTest(abilityContext) { ...@@ -445,9 +383,9 @@ export default function albumTestCallbackTest(abilityContext) {
* @tc.desc : Modify Camera name '' * @tc.desc : Modify Camera name ''
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_01", 0, async function (done) { it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_01", 2, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_01"; const testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_01";
const selections = FILEKEY.ALBUM_NAME + '= ?'; const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera']); const currentFetchOp = fileFetchOption(testNum, selections, ['Camera']);
...@@ -456,32 +394,15 @@ export default function albumTestCallbackTest(abilityContext) { ...@@ -456,32 +394,15 @@ export default function albumTestCallbackTest(abilityContext) {
await abnormalAlbumCommitModify(done, testNum, currentFetchOp, newName, expectAlbumCount); await abnormalAlbumCommitModify(done, testNum, currentFetchOp, newName, expectAlbumCount);
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_02
* @tc.name : commitModify
* @tc.desc : Modify Videos name ''
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_02", 0, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_02";
const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Videos']);
const newName = "";
const expectAlbumCount = 1;
await abnormalAlbumCommitModify(done, testNum, currentFetchOp, newName, expectAlbumCount);
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_04 * @tc.number : SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_04
* @tc.name : commitModify * @tc.name : commitModify
* @tc.desc : Modify Album name 'aaaaa....' (256) * @tc.desc : Modify Album name 'aaaaa....' (256)
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_04", 0, async function (done) { it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_04", 2, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_04"; const testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_04";
const selections = FILEKEY.ALBUM_NAME + '= ?'; const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots']); const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots']);
...@@ -499,9 +420,9 @@ export default function albumTestCallbackTest(abilityContext) { ...@@ -499,9 +420,9 @@ export default function albumTestCallbackTest(abilityContext) {
* @tc.desc : Modify Album name '中中中中中....' (86 *3) * @tc.desc : Modify Album name '中中中中中....' (86 *3)
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_05", 0, async function (done) { it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_05", 2, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_05"; const testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_05";
const selections = FILEKEY.ALBUM_NAME + '= ?'; const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots']); const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots']);
...@@ -519,9 +440,9 @@ export default function albumTestCallbackTest(abilityContext) { ...@@ -519,9 +440,9 @@ export default function albumTestCallbackTest(abilityContext) {
* @tc.desc : Modify Album name 'aaaaaaa....' (255) * @tc.desc : Modify Album name 'aaaaaaa....' (255)
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_06", 0, async function (done) { it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_06", 2, async function (done) {
const testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_06"; const testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_06";
const selections = FILEKEY.ALBUM_NAME + '= ?'; const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots']); const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots']);
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -18,14 +18,8 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from ...@@ -18,14 +18,8 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from
import { import {
sleep, sleep,
IMAGE_TYPE,
VIDEO_TYPE,
AUDIO_TYPE,
FILEKEY, FILEKEY,
idFetchOps, idFetchOps,
albumFetchOps,
albumTwoTypesFetchOps,
albumThreeTypesFetchOps,
checkAlbumsCount, checkAlbumsCount,
fileFetchOption, fileFetchOption,
} from "../../../../../../common"; } from "../../../../../../common";
...@@ -70,6 +64,7 @@ export default function albumTestPromiseTest(abilityContext) { ...@@ -70,6 +64,7 @@ export default function albumTestPromiseTest(abilityContext) {
expect(album.count).assertEqual(prop.count); expect(album.count).assertEqual(prop.count);
expect(album.relativePath).assertEqual(relativePath); expect(album.relativePath).assertEqual(relativePath);
}; };
const checkAlbumInfo = async function (done, testNum, fetchOp, relativePaths, props, expectAlbumCount = 1) { const checkAlbumInfo = async function (done, testNum, fetchOp, relativePaths, props, expectAlbumCount = 1) {
try { try {
const albumList = await media.getAlbums(fetchOp); const albumList = await media.getAlbums(fetchOp);
...@@ -186,29 +181,6 @@ export default function albumTestPromiseTest(abilityContext) { ...@@ -186,29 +181,6 @@ export default function albumTestPromiseTest(abilityContext) {
await checkAlbumInfo(done, testNum, currentFetchOp, relativePaths, props); await checkAlbumInfo(done, testNum, currentFetchOp, relativePaths, props);
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_02
* @tc.name : getAlbums
* @tc.desc : get Videos album,check album info
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_02", 0, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_02";
const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Videos']);
let relativePaths = [""];
const props = [
{
albumName: "Videos",
albumUri: "file://media/album/",
count: 2,
}
];
await checkAlbumInfo(done, testNum, currentFetchOp, relativePaths, props);
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_03 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_03
* @tc.name : getAlbums * @tc.name : getAlbums
...@@ -259,20 +231,20 @@ export default function albumTestPromiseTest(abilityContext) { ...@@ -259,20 +231,20 @@ export default function albumTestPromiseTest(abilityContext) {
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_05 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_05
* @tc.name : getAlbums * @tc.name : getAlbums
* @tc.desc : get Camera and Videos album,check album info * @tc.desc : get Camera and Screenshots album,check album info
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_05", 0, async function (done) { it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_05", 2, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_05"; let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_05";
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?'; const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'Videos']); const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'Screenshots']);
let relativePaths = ['', '']; let relativePaths = ['', ''];
let albumCount = 2; let albumCount = 2;
const props = [ const props = [
{ {
albumName: "Videos", albumName: "Screenshots",
albumUri: "file://media/album/", albumUri: "file://media/album/",
count: 2, count: 2,
}, },
...@@ -288,57 +260,18 @@ export default function albumTestPromiseTest(abilityContext) { ...@@ -288,57 +260,18 @@ export default function albumTestPromiseTest(abilityContext) {
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_06 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_06
* @tc.name : getAlbums * @tc.name : getAlbums
* @tc.desc : get Camera and Videos and Screenshots album,check album info * @tc.desc : get Camera and ScreenRecordings and Screenshots album,check album info
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_06", 0, async function (done) { it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_06", 2, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_06"; let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_06";
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?'; const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'Videos', 'Screenshots']); const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'ScreenRecordings', 'Screenshots']);
let relativePaths = ['', '', '']; let relativePaths = ['', ''];
let albumCount = 3; let albumCount = 2;
const props = [
{
albumName: "Videos",
albumUri: "file://media/album/",
count: 2,
},
{
albumName: "Screenshots",
albumUri: "file://media/album/",
count: 2,
},
{
albumName: "Camera",
albumUri: "file://media/album/",
count: 1,
},
];
await checkAlbumInfo(done, testNum, currentFetchOp, relativePaths, props, albumCount);
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_07
* @tc.name : getAlbums
* @tc.desc : get Camera and Videos and Screenshots and ScreenRecordings album,check album info
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_07", 0, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_001_07";
const selections = FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ? or ' + FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera', 'Videos', 'ScreenRecordings', 'Screenshots']);
let relativePaths = ['', '', ''];
let albumCount = 3;
const props = [ const props = [
{
albumName: "Videos",
albumUri: "file://media/album/",
count: 2,
},
{ {
albumName: "Screenshots", albumName: "Screenshots",
albumUri: "file://media/album/", albumUri: "file://media/album/",
...@@ -361,9 +294,9 @@ export default function albumTestPromiseTest(abilityContext) { ...@@ -361,9 +294,9 @@ export default function albumTestPromiseTest(abilityContext) {
* @tc.desc : Get Album Assets by abnormal option * @tc.desc : Get Album Assets by abnormal option
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_06", 0, async function (done) { it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_06", 2, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_06"; let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_06";
const selections = FILEKEY.ALBUM_NAME + '= ?'; const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['666']); const currentFetchOp = fileFetchOption(testNum, selections, ['666']);
...@@ -376,9 +309,9 @@ export default function albumTestPromiseTest(abilityContext) { ...@@ -376,9 +309,9 @@ export default function albumTestPromiseTest(abilityContext) {
* @tc.desc : Get Album Assets by abnormal option * @tc.desc : Get Album Assets by abnormal option
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_07", 0, async function (done) { it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_07", 2, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_07"; let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_07";
const selections = '666' + '= ?'; const selections = '666' + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera']); const currentFetchOp = fileFetchOption(testNum, selections, ['Camera']);
...@@ -391,9 +324,9 @@ export default function albumTestPromiseTest(abilityContext) { ...@@ -391,9 +324,9 @@ export default function albumTestPromiseTest(abilityContext) {
* @tc.desc : Get Album Assets by abnormal option * @tc.desc : Get Album Assets by abnormal option
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_08", 0, async function (done) { it("SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_08", 2, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_08"; let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_08";
const selections = '666' + '= ?'; const selections = '666' + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['666']); const currentFetchOp = fileFetchOption(testNum, selections, ['666']);
...@@ -408,9 +341,9 @@ export default function albumTestPromiseTest(abilityContext) { ...@@ -408,9 +341,9 @@ export default function albumTestPromiseTest(abilityContext) {
* @tc.desc : Modify Camera name '' * @tc.desc : Modify Camera name ''
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_01", 0, async function (done) { it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_01", 2, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_01"; let testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_01";
const selections = FILEKEY.ALBUM_NAME + '= ?'; const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Camera']); const currentFetchOp = fileFetchOption(testNum, selections, ['Camera']);
...@@ -419,32 +352,15 @@ export default function albumTestPromiseTest(abilityContext) { ...@@ -419,32 +352,15 @@ export default function albumTestPromiseTest(abilityContext) {
await abnormalAlbumCommitModify(done, testNum, currentFetchOp, newName, expectAlbumCount); await abnormalAlbumCommitModify(done, testNum, currentFetchOp, newName, expectAlbumCount);
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_02
* @tc.name : commitModify
* @tc.desc : Modify Videos name ''
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_02", 0, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_02";
const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Videos']);
let newName = "";
let expectAlbumCount = 1;
await abnormalAlbumCommitModify(done, testNum, currentFetchOp, newName, expectAlbumCount);
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_04 * @tc.number : SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_04
* @tc.name : commitModify * @tc.name : commitModify
* @tc.desc : Modify Screenshots name 'aaaaa....' (256) * @tc.desc : Modify Screenshots name 'aaaaa....' (256)
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_04", 0, async function (done) { it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_04", 2, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_04"; let testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_04";
const selections = FILEKEY.ALBUM_NAME + '= ?'; const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots']); const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots']);
...@@ -462,9 +378,9 @@ export default function albumTestPromiseTest(abilityContext) { ...@@ -462,9 +378,9 @@ export default function albumTestPromiseTest(abilityContext) {
* @tc.desc : Modify Screenshots name '中中中中中....' (86 *3) * @tc.desc : Modify Screenshots name '中中中中中....' (86 *3)
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_05", 0, async function (done) { it("SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_05", 2, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_05"; let testNum = "SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_05";
const selections = FILEKEY.ALBUM_NAME + '= ?'; const selections = FILEKEY.ALBUM_NAME + '= ?';
const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots']); const currentFetchOp = fileFetchOption(testNum, selections, ['Screenshots']);
...@@ -524,9 +440,9 @@ export default function albumTestPromiseTest(abilityContext) { ...@@ -524,9 +440,9 @@ export default function albumTestPromiseTest(abilityContext) {
* @tc.desc : check album.coverUri * @tc.desc : check album.coverUri
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 2
*/ */
it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_004_01", 0, async function (done) { it("SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_004_01", 2, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_004_01"; let testNum = "SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_004_01";
try { try {
let coverUrifetchOp = { let coverUrifetchOp = {
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`", "kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner", "scanner",
"sleep 5", "sleep 5",
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}",
"mkdir /storage/media/100/local/temp", "mkdir /storage/media/100/local/temp",
"param set persist.ace.testmode.enabled 1", "param set persist.ace.testmode.enabled 1",
"power-shell wakeup", "power-shell wakeup",
...@@ -59,7 +58,14 @@ ...@@ -59,7 +58,14 @@
"sleep 10" "sleep 10"
], ],
"teardown-command": [ "teardown-command": [
"power-shell setmode 600" "power-shell setmode 600",
"rm -rf /storage/media/100/local/temp",
"rm -rf /storage/media/100/local/files/*",
"rm -rf /storage/media/100/local/files/.*",
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*",
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner",
"sleep 5"
] ]
}, },
{ {
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`", "kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner", "scanner",
"sleep 5", "sleep 5",
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}",
"mkdir /storage/media/100/local/temp", "mkdir /storage/media/100/local/temp",
"param set persist.ace.testmode.enabled 1", "param set persist.ace.testmode.enabled 1",
"power-shell wakeup", "power-shell wakeup",
...@@ -57,7 +56,14 @@ ...@@ -57,7 +56,14 @@
"sleep 10" "sleep 10"
], ],
"teardown-command": [ "teardown-command": [
"power-shell setmode 600" "power-shell setmode 600",
"rm -rf /storage/media/100/local/temp",
"rm -rf /storage/media/100/local/files/*",
"rm -rf /storage/media/100/local/files/.*",
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*",
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner",
"sleep 5"
] ]
}, },
{ {
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`", "kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner", "scanner",
"sleep 5", "sleep 5",
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}",
"mkdir /storage/media/100/local/temp", "mkdir /storage/media/100/local/temp",
"param set persist.ace.testmode.enabled 1", "param set persist.ace.testmode.enabled 1",
"power-shell wakeup", "power-shell wakeup",
...@@ -61,7 +60,14 @@ ...@@ -61,7 +60,14 @@
"sleep 10" "sleep 10"
], ],
"teardown-command": [ "teardown-command": [
"power-shell setmode 600" "power-shell setmode 600",
"rm -rf /storage/media/100/local/temp",
"rm -rf /storage/media/100/local/files/*",
"rm -rf /storage/media/100/local/files/.*",
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*",
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner",
"sleep 5"
] ]
}, },
{ {
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`", "kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner", "scanner",
"sleep 5", "sleep 5",
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}",
"mkdir /storage/media/100/local/temp", "mkdir /storage/media/100/local/temp",
"param set persist.ace.testmode.enabled 1", "param set persist.ace.testmode.enabled 1",
"power-shell wakeup", "power-shell wakeup",
...@@ -61,7 +60,14 @@ ...@@ -61,7 +60,14 @@
"sleep 10" "sleep 10"
], ],
"teardown-command": [ "teardown-command": [
"power-shell setmode 600" "power-shell setmode 600",
"rm -rf /storage/media/100/local/temp",
"rm -rf /storage/media/100/local/files/*",
"rm -rf /storage/media/100/local/files/.*",
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*",
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner",
"sleep 5"
] ]
}, },
{ {
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`", "kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner", "scanner",
"sleep 5", "sleep 5",
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}",
"mkdir /storage/media/100/local/temp", "mkdir /storage/media/100/local/temp",
"param set persist.ace.testmode.enabled 1", "param set persist.ace.testmode.enabled 1",
"power-shell wakeup", "power-shell wakeup",
...@@ -53,7 +52,14 @@ ...@@ -53,7 +52,14 @@
"sleep 10" "sleep 10"
], ],
"teardown-command": [ "teardown-command": [
"power-shell setmode 600" "power-shell setmode 600",
"rm -rf /storage/media/100/local/temp",
"rm -rf /storage/media/100/local/files/*",
"rm -rf /storage/media/100/local/files/.*",
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*",
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner",
"sleep 5"
] ]
}, },
{ {
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -49,7 +49,6 @@ export default function filekeyTestCallbackTest(abilityContext) { ...@@ -49,7 +49,6 @@ export default function filekeyTestCallbackTest(abilityContext) {
}); });
const { const {
PARENT,
MIME_TYPE, MIME_TYPE,
SIZE, SIZE,
DATE_ADDED, DATE_ADDED,
...@@ -59,14 +58,12 @@ export default function filekeyTestCallbackTest(abilityContext) { ...@@ -59,14 +58,12 @@ export default function filekeyTestCallbackTest(abilityContext) {
WIDTH, WIDTH,
HEIGHT, HEIGHT,
ORIENTATION, ORIENTATION,
ALBUM_ID,
ARTIST, ARTIST,
AUDIOALBUM, AUDIOALBUM,
DATE_MODIFIED, DATE_MODIFIED,
DATE_TAKEN, DATE_TAKEN,
RELATIVE_PATH, RELATIVE_PATH,
DISPLAY_NAME, DISPLAY_NAME,
MEDIA_TYPE,
} = FILEKEY; } = FILEKEY;
async function getFileAssetsBy(done, testNum, type, fileKey) { async function getFileAssetsBy(done, testNum, type, fileKey) {
...@@ -107,20 +104,6 @@ export default function filekeyTestCallbackTest(abilityContext) { ...@@ -107,20 +104,6 @@ export default function filekeyTestCallbackTest(abilityContext) {
} }
} }
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILE_KEY_CALLBACK_001
* @tc.name : getFileAssets
* @tc.desc : filekey parentOp
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_FILE_KEY_CALLBACK_001", 0, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_FILE_KEY_CALLBACK_001";
await getFileAssetsBy(done, testNum, "parent", PARENT);
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILE_KEY_CALLBACK_002 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FILE_KEY_CALLBACK_002
* @tc.name : getFileAssets * @tc.name : getFileAssets
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
...@@ -46,7 +46,6 @@ export default function filekeyTestPromiseTest(abilityContext) { ...@@ -46,7 +46,6 @@ export default function filekeyTestPromiseTest(abilityContext) {
}); });
const { const {
PARENT,
MIME_TYPE, MIME_TYPE,
SIZE, SIZE,
DATE_ADDED, DATE_ADDED,
...@@ -56,14 +55,12 @@ export default function filekeyTestPromiseTest(abilityContext) { ...@@ -56,14 +55,12 @@ export default function filekeyTestPromiseTest(abilityContext) {
WIDTH, WIDTH,
HEIGHT, HEIGHT,
ORIENTATION, ORIENTATION,
ALBUM_ID,
ARTIST, ARTIST,
AUDIOALBUM, AUDIOALBUM,
DATE_MODIFIED, DATE_MODIFIED,
DATE_TAKEN, DATE_TAKEN,
RELATIVE_PATH, RELATIVE_PATH,
DISPLAY_NAME, DISPLAY_NAME,
MEDIA_TYPE,
} = FILEKEY; } = FILEKEY;
async function getFileAssetsBy(done, testNum, type, fileKey) { async function getFileAssetsBy(done, testNum, type, fileKey) {
...@@ -97,20 +94,6 @@ export default function filekeyTestPromiseTest(abilityContext) { ...@@ -97,20 +94,6 @@ export default function filekeyTestPromiseTest(abilityContext) {
} }
} }
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILE_KEY_PROMISE_001
* @tc.name : getFileAssets
* @tc.desc : filekey parentOp
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it("SUB_MEDIA_MEDIALIBRARY_FILE_KEY_PROMISE_001", 0, async function (done) {
let testNum = "SUB_MEDIA_MEDIALIBRARY_FILE_KEY_PROMISE_001";
await getFileAssetsBy(done, testNum, "parent", PARENT);
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FILE_KEY_PROMISE_002 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FILE_KEY_PROMISE_002
* @tc.name : getFileAssets * @tc.name : getFileAssets
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`", "kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner", "scanner",
"sleep 5", "sleep 5",
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}",
"mkdir /storage/media/100/local/temp", "mkdir /storage/media/100/local/temp",
"param set persist.ace.testmode.enabled 1", "param set persist.ace.testmode.enabled 1",
"power-shell wakeup", "power-shell wakeup",
...@@ -57,7 +56,14 @@ ...@@ -57,7 +56,14 @@
"sleep 10" "sleep 10"
], ],
"teardown-command": [ "teardown-command": [
"power-shell setmode 600" "power-shell setmode 600",
"rm -rf /storage/media/100/local/temp",
"rm -rf /storage/media/100/local/files/*",
"rm -rf /storage/media/100/local/files/.*",
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*",
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner",
"sleep 5"
] ]
}, },
{ {
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`", "kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner", "scanner",
"sleep 5", "sleep 5",
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}",
"mkdir /storage/media/100/local/temp", "mkdir /storage/media/100/local/temp",
"param set persist.ace.testmode.enabled 1", "param set persist.ace.testmode.enabled 1",
"power-shell wakeup", "power-shell wakeup",
...@@ -48,7 +47,14 @@ ...@@ -48,7 +47,14 @@
"sleep 10" "sleep 10"
], ],
"teardown-command": [ "teardown-command": [
"power-shell setmode 600" "power-shell setmode 600",
"rm -rf /storage/media/100/local/temp",
"rm -rf /storage/media/100/local/files/*",
"rm -rf /storage/media/100/local/files/.*",
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*",
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner",
"sleep 5"
] ]
}, },
{ {
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`", "kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner", "scanner",
"sleep 5", "sleep 5",
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}",
"mkdir /storage/media/100/local/temp", "mkdir /storage/media/100/local/temp",
"param set persist.ace.testmode.enabled 1", "param set persist.ace.testmode.enabled 1",
"power-shell wakeup", "power-shell wakeup",
...@@ -48,7 +47,14 @@ ...@@ -48,7 +47,14 @@
"sleep 10" "sleep 10"
], ],
"teardown-command": [ "teardown-command": [
"power-shell setmode 600" "power-shell setmode 600",
"rm -rf /storage/media/100/local/temp",
"rm -rf /storage/media/100/local/files/*",
"rm -rf /storage/media/100/local/files/.*",
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*",
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner",
"sleep 5"
] ]
}, },
{ {
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`", "kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner", "scanner",
"sleep 5", "sleep 5",
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}",
"mkdir /storage/media/100/local/temp", "mkdir /storage/media/100/local/temp",
"param set persist.ace.testmode.enabled 1", "param set persist.ace.testmode.enabled 1",
"power-shell wakeup", "power-shell wakeup",
...@@ -54,7 +53,14 @@ ...@@ -54,7 +53,14 @@
"sleep 10" "sleep 10"
], ],
"teardown-command": [ "teardown-command": [
"power-shell setmode 600" "power-shell setmode 600",
"rm -rf /storage/media/100/local/temp",
"rm -rf /storage/media/100/local/files/*",
"rm -rf /storage/media/100/local/files/.*",
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*",
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner",
"sleep 5"
] ]
}, },
{ {
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`", "kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner", "scanner",
"sleep 5", "sleep 5",
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}",
"mkdir /storage/media/100/local/temp", "mkdir /storage/media/100/local/temp",
"param set persist.ace.testmode.enabled 1", "param set persist.ace.testmode.enabled 1",
"power-shell wakeup", "power-shell wakeup",
...@@ -54,7 +53,14 @@ ...@@ -54,7 +53,14 @@
"sleep 10" "sleep 10"
], ],
"teardown-command": [ "teardown-command": [
"power-shell setmode 600" "power-shell setmode 600",
"rm -rf /storage/media/100/local/temp",
"rm -rf /storage/media/100/local/files/*",
"rm -rf /storage/media/100/local/files/.*",
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*",
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner",
"sleep 5"
] ]
}, },
{ {
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`", "kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner", "scanner",
"sleep 5", "sleep 5",
"mkdir -pv /storage/media/100/local/files/{Camera,Pictures,Videos,Audios,Documents,Download}",
"mkdir /storage/media/100/local/temp", "mkdir /storage/media/100/local/temp",
"param set persist.ace.testmode.enabled 1", "param set persist.ace.testmode.enabled 1",
"power-shell wakeup", "power-shell wakeup",
...@@ -57,7 +56,14 @@ ...@@ -57,7 +56,14 @@
"sleep 10" "sleep 10"
], ],
"teardown-command": [ "teardown-command": [
"power-shell setmode 600" "power-shell setmode 600",
"rm -rf /storage/media/100/local/temp",
"rm -rf /storage/media/100/local/files/*",
"rm -rf /storage/media/100/local/files/.*",
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*",
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`",
"scanner",
"sleep 5"
] ]
}, },
{ {
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
/* /*
* 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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册