提交 17b875f3 编写于 作者: C caochuan

check dateModified change

Signed-off-by: Ncaochuan <caochuan@huawei.com>
上级 007e3b23
......@@ -75,6 +75,15 @@ const idFetchOps = function (testNum, albumId) {
return ops
}
const fileIdFetchOps = function (testNum, id) {
let ops = {
selections: FILEKEY.ID + "= ?",
selectionArgs: [id + ""],
};
console.info(`${testNum}: fetchOps${JSON.stringify(ops)}`);
return ops;
};
const albumFetchOps = function (testNum, path, albumName, type,
others = { order: FILEKEY.DATE_ADDED + " DESC", }) {
let ops = {
......@@ -214,4 +223,5 @@ export {
checkAlbumsCount,
MODIFY_ERROR_CODE_01,
isNum,
}
fileIdFetchOps,
};
......@@ -528,7 +528,7 @@ export default function mediaLibraryTestCallback(abilityContext) {
/**
* @tc.number : SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETPUBLICDIRECTORY_004
* @tc.name : getPublicDirectory
* @tc.desc : getPublicDirectory DIR_IMAGE
* @tc.desc : getPublicDirectory DIR_AUDIO
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
......@@ -549,7 +549,7 @@ export default function mediaLibraryTestCallback(abilityContext) {
* @tc.level : Level 0
*/
it('SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETPUBLICDIRECTORY_005', 0, async function (done) {
let testNum = 'SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETPUBLICDIRECTORY_004';
let testNum = 'SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETPUBLICDIRECTORY_005';
let dir = mediaLibrary.DirectoryType.DIR_DOCUMENTS;
let val = 'Documents/';
await checkGetPublicDirectory(done, testNum, dir, val)
......@@ -576,6 +576,21 @@ export default function mediaLibraryTestCallback(abilityContext) {
}
});
/**
* @tc.number : SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETPUBLICDIRECTORY_007
* @tc.name : getPublicDirectory
* @tc.desc : getPublicDirectory DIR_DOWNLOAD
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETPUBLICDIRECTORY_007', 0, async function (done) {
let testNum = 'SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETPUBLICDIRECTORY_007';
let dir = mediaLibrary.DirectoryType.DIR_DOWNLOAD;
let val = 'Download/';
await checkGetPublicDirectory(done, testNum, dir, val)
});
/**
* @tc.number : SUB__MEDIA_MIDIALIBRARY_CALLBACK_CREATEASSET_001
* @tc.name : createAsset
......
......@@ -507,7 +507,7 @@ export default function mediaLibraryTestPromiseTest(abilityContext) {
/**
* @tc.number : SUB__MEDIA_MIDIALIBRARY_PROMISE_GETPUBLICDIRECTORY_004
* @tc.name : getPublicDirectory
* @tc.desc : getPublicDirectory DIR_IMAGE
* @tc.desc : getPublicDirectory DIR_AUDIO
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
......@@ -522,13 +522,13 @@ export default function mediaLibraryTestPromiseTest(abilityContext) {
/**
* @tc.number : SUB__MEDIA_MIDIALIBRARY_PROMISE_GETPUBLICDIRECTORY_005
* @tc.name : getPublicDirectory
* @tc.desc : getPublicDirectory DIR_IMAGE
* @tc.desc : getPublicDirectory DIR_DOCUMENTS
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB__MEDIA_MIDIALIBRARY_PROMISE_GETPUBLICDIRECTORY_005', 0, async function (done) {
let testNum = 'SUB__MEDIA_MIDIALIBRARY_PROMISE_GETPUBLICDIRECTORY_004';
let testNum = 'SUB__MEDIA_MIDIALIBRARY_PROMISE_GETPUBLICDIRECTORY_005';
let dir = mediaLibrary.DirectoryType.DIR_DOCUMENTS;
let val = 'Documents/';
await checkGetPublicDirectory(done, testNum, dir, val)
......@@ -555,6 +555,22 @@ export default function mediaLibraryTestPromiseTest(abilityContext) {
}
});
/**
* @tc.number : SUB__MEDIA_MIDIALIBRARY_PROMISE_GETPUBLICDIRECTORY_007
* @tc.name : getPublicDirectory
* @tc.desc : getPublicDirectory DIR_DOWNLOAD
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB__MEDIA_MIDIALIBRARY_PROMISE_GETPUBLICDIRECTORY_007', 0, async function (done) {
let testNum = 'SUB__MEDIA_MIDIALIBRARY_PROMISE_GETPUBLICDIRECTORY_007';
let dir = mediaLibrary.DirectoryType.DIR_DOWNLOAD;
let val = 'Download/';
await checkGetPublicDirectory(done, testNum, dir, val)
});
/**
* @tc.number : SUB__MEDIA_MIDIALIBRARY_PROMISE_CREATEASSET_001
* @tc.name : createAsset
......
......@@ -26,6 +26,7 @@ import {
checkAssetsCount,
fetchOps,
isNum,
fileIdFetchOps,
} from '../../../../../../common';
export default function fileAssetTestCallbackTest(abilityContext) {
describe('fileAssetTestCallbackTest', function () {
......@@ -76,6 +77,11 @@ export default function fileAssetTestCallbackTest(abilityContext) {
console.info(`fd1:${fd1},fd:${fd}`)
await asset.close(fd);
await asset1.close(fd1);
let newFetchFileResult = await media.getFileAssets(fileIdFetchOps(testNum, asset.id));
let checkAssetCountPass = await checkAssetsCount(done, testNum, newFetchFileResult, 1);
if (!checkAssetCountPass) return;
let newAsset = await newFetchFileResult.getFirstObject();
expect(newAsset.dateModified != asset.dateModified).assertTrue();
done();
});
......
......@@ -26,6 +26,7 @@ import {
checkAssetsCount,
fetchOps,
isNum,
fileIdFetchOps,
} from '../../../../../../common';
export default function fileAssetTestPromiseTest(abilityContext) {
describe('fileAssetTestPromiseTest', function () {
......@@ -70,6 +71,11 @@ export default function fileAssetTestPromiseTest(abilityContext) {
console.info(`fd1:${fd1},fd:${fd}`)
await asset.close(fd);
await asset1.close(fd1);
let newFetchFileResult = await media.getFileAssets(fileIdFetchOps(testNum, asset.id));
checkAssetCountPass = await checkAssetsCount(done, testNum, newFetchFileResult, 1);
if (!checkAssetCountPass) return;
let newAsset = await newFetchFileResult.getFirstObject();
expect(newAsset.dateModified != asset.dateModified).assertTrue();
done();
} catch (error) {
console.info(`${testNum} :: error: ${error}`);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册