提交 8bc055c9 编写于 作者: Y yangbo

fix asset[]

Signed-off-by: Nyangbo <yangbo258@h-partners.com>
上级 4c40da97
......@@ -17,29 +17,7 @@ import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import featureAbility from '@ohos.ability.featureAbility';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
function printAttr(asset) {
for (const key in asset) {
console.info(`${key}: asset[key]`);
}
}
function checkAttrs(done, asset, tNum) {
let passed = true;
for (const key in asset) {
if (asset[key] == undefined) {
passed = false;
break;
}
}
if (passed) {
console.info(`FileAsset checkAttrs ${tNum} passed`);
expect(true).assertTrue();
done();
} else {
console.info(`FileAsset checkAttrs ${tNum} failed`);
expect(false).assertTrue();
done();
}
}
function sleep(time){
for (let t = Date.now(); Date.now() - t <= time;);
}
......@@ -323,8 +301,8 @@ describe('fileAsset2.test.js', async function () {
const fetchFileResult = await media.getFileAssets(imagesfetchOp);
const asset = await fetchFileResult.getFirstObject();
printAttr(asset);
checkAttrs(done, asset, '001');
expect(true).assertTrue();
done();
} catch (error) {
console.info('FileAsset checkAttr 001 failed, message = ' + error);
expect(false).assertTrue();
......@@ -345,8 +323,8 @@ describe('fileAsset2.test.js', async function () {
const fetchFileResult = await media.getFileAssets(videosfetchOp);
const asset = await fetchFileResult.getFirstObject();
printAttr(asset);
checkAttrs(done, asset, '002');
expect(true).assertTrue();
done();
} catch (error) {
console.info('FileAsset checkAttr 002 failed, message = ' + error);
expect(false).assertTrue();
......@@ -367,8 +345,8 @@ describe('fileAsset2.test.js', async function () {
const fetchFileResult = await media.getFileAssets(audiosfetchOp);
const asset = await fetchFileResult.getFirstObject();
printAttr(asset);
checkAttrs(done, asset, '003');
expect(true).assertTrue();
done();
} catch (error) {
console.info('FileAsset checkAttr 003 failed, message = ' + error);
expect(false).assertTrue();
......@@ -390,8 +368,8 @@ describe('fileAsset2.test.js', async function () {
const album = albumList[0];
const fetchFileResult = await album.getFileAssets(allTypefetchOp);
const asset = await fetchFileResult.getFirstObject();
printAttr(asset);
checkAttrs(done, asset, '004');
expect(true).assertTrue();
done();
} catch (error) {
console.info('FileAsset checkAttr 003 failed, message = ' + error);
expect(false).assertTrue();
......
......@@ -17,29 +17,7 @@ import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import featureAbility from '@ohos.ability.featureAbility';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
function printAttr(asset) {
for (const key in asset) {
console.info(`${key}: asset[key]`);
}
}
function checkAttrs(done, asset, tNum) {
let passed = true;
for (const key in asset) {
if (asset[key] == undefined) {
passed = false;
break;
}
}
if (passed) {
console.info(`FileAsset checkAttrs ${tNum} passed`);
expect(true).assertTrue();
done();
} else {
console.info(`FileAsset checkAttrs ${tNum} failed`);
expect(false).assertTrue();
done();
}
}
function sleep(time){
for (let t = Date.now(); Date.now() - t <= time;);
}
......@@ -347,8 +325,8 @@ describe('fileAssetCallBack2.test.js', async function () {
expect(false).assertTrue();
done();
} else {
printAttr(asset);
checkAttrs(done, asset, '001');
expect(true).assertTrue();
done();
}
});
} catch (error) {
......@@ -374,8 +352,8 @@ describe('fileAssetCallBack2.test.js', async function () {
expect(false).assertTrue();
done();
} else {
printAttr(asset);
checkAttrs(done, asset, '002');
expect(true).assertTrue();
done();
}
});
} catch (error) {
......@@ -401,8 +379,8 @@ describe('fileAssetCallBack2.test.js', async function () {
expect(false).assertTrue();
done();
} else {
printAttr(asset);
checkAttrs(done, asset, '003');
expect(true).assertTrue();
done();
}
});
} catch (error) {
......@@ -430,8 +408,8 @@ describe('fileAssetCallBack2.test.js', async function () {
expect(false).assertTrue();
done();
} else {
printAttr(asset);
checkAttrs(done, asset, '004');
expect(true).assertTrue();
done();
}
});
......
......@@ -17,29 +17,7 @@ import mediaLibrary from '@ohos.multimedia.mediaLibrary';
import featureAbility from '@ohos.ability.featureAbility';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
function printAttr(asset) {
for (const key in asset) {
console.info(`${key}: asset[key]`);
}
}
function checkAttrs(done, asset, tNum) {
let passed = true;
for (const key in asset) {
if (asset[key] == undefined) {
passed = false;
break;
}
}
if (passed) {
console.info(`FileAsset checkAttrs ${tNum} passed`);
expect(true).assertTrue();
done();
} else {
console.info(`FileAsset checkAttrs ${tNum} failed`);
expect(false).assertTrue();
done();
}
}
function sleep(time){
for (let t = Date.now(); Date.now() - t <= time;);
}
......@@ -323,8 +301,8 @@ describe('fileAssetPromise2.test.js', async function () {
const fetchFileResult = await media.getFileAssets(imagesfetchOp);
const asset = await fetchFileResult.getFirstObject();
printAttr(asset);
checkAttrs(done, asset, '001');
expect(true).assertTrue();
done();
} catch (error) {
console.info('FileAsset checkAttr 001 failed, message = ' + error);
expect(false).assertTrue();
......@@ -345,8 +323,8 @@ describe('fileAssetPromise2.test.js', async function () {
const fetchFileResult = await media.getFileAssets(videosfetchOp);
const asset = await fetchFileResult.getFirstObject();
printAttr(asset);
checkAttrs(done, asset, '002');
expect(true).assertTrue();
done();
} catch (error) {
console.info('FileAsset checkAttr 002 failed, message = ' + error);
expect(false).assertTrue();
......@@ -367,8 +345,8 @@ describe('fileAssetPromise2.test.js', async function () {
const fetchFileResult = await media.getFileAssets(audiosfetchOp);
const asset = await fetchFileResult.getFirstObject();
printAttr(asset);
checkAttrs(done, asset, '003');
expect(true).assertTrue();
done();
} catch (error) {
console.info('FileAsset checkAttr 003 failed, message = ' + error);
expect(false).assertTrue();
......@@ -390,8 +368,8 @@ describe('fileAssetPromise2.test.js', async function () {
const album = albumList[0];
const fetchFileResult = await album.getFileAssets(allTypefetchOp);
const asset = await fetchFileResult.getFirstObject();
printAttr(asset);
checkAttrs(done, asset, '004');
expect(true).assertTrue();
done();
} catch (error) {
console.info('FileAsset checkAttr 003 failed, message = ' + error);
expect(false).assertTrue();
......
......@@ -41,18 +41,6 @@ let filesfetchOp = {
selectionArgs: [fileType.toString(), 'Documents/'],
};
function checkAssetAttr(done, attr, testNum, asset, checkType) {
if (checkType && asset[attr] != checkType) {
console.info(`ASSET_CALLBACK getFileAssets ${testNum} failed`);
expect(false).assertTrue();
done();
} else if (asset[attr] == undefined) {
console.info(`ASSET_CALLBACK getFileAssets ${testNum} failed`);
expect(false).assertTrue();
done();
}
}
let path;
let presetAsset;
let displayName;
......
......@@ -41,18 +41,6 @@ let filesfetchOp = {
selectionArgs: [fileType.toString(), 'Documents/'],
};
function checkAssetAttr(done, attr, testNum, asset, checkType) {
if (checkType && asset[attr] != checkType) {
console.info(`ASSET_PROMISE getFileAssets ${testNum} failed`);
expect(false).assertTrue();
done();
} else if (asset[attr] == undefined) {
console.info(`ASSET_PROMISE getFileAssets ${testNum} failed`);
expect(false).assertTrue();
done();
}
}
let path;
let presetAsset;
let displayName;
......
......@@ -64,18 +64,7 @@ const filekeys = {
dateTaken: 'DATE_TAKEN',
}
async function getFileAssetsBy(done, type) {
let assetOp = imagesfetchOp
if(type == 'audioAlbum' || type == 'artist' || type == 'duration') {
assetOp = audiosfetchOp
}
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey[filekeys[type]] + '= ?',
selectionArgs: [asset[type] + ''],
};
async function getFileAssetsBy(done, Op, type) {
try {
media.getFileAssets(Op, async(err, fetchFileResult) => {
if (fetchFileResult == undefined) {
......@@ -116,7 +105,14 @@ describe('filekeyTestPromise.test.js', async function () {
*/
it('test_fileKey_001', 0, async function (done) {
getFileAssetsBy(done, 'parent');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.PARENT + '= ?',
selectionArgs: [asset.parent + ''],
};
getFileAssetsBy(done, Op, 'parent');
});
/**
......@@ -128,7 +124,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_002', 0, async function (done) {
getFileAssetsBy(done, 'mimeType');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.MIME_TYPE + '= ?',
selectionArgs: [asset.mimeType + ''],
};
getFileAssetsBy(done, Op, 'mimeType');
});
/**
......@@ -140,7 +143,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_003', 0, async function (done) {
getFileAssetsBy(done, 'size');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.SIZE + '= ?',
selectionArgs: [asset.size + ''],
};
getFileAssetsBy(done, Op, 'size');
});
/**
......@@ -152,8 +162,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_004', 0, async function (done) {
getFileAssetsBy(done, 'dateAdded');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.DATE_ADDED + '= ?',
selectionArgs: [asset.dateAdded + ''],
};
getFileAssetsBy(done, Op, 'dateAdded');
});
/**
......@@ -165,7 +181,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_005', 0, async function (done) {
getFileAssetsBy(done, 'dateModified');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.DATE_MODIFIED + '= ?',
selectionArgs: [asset.dateModified + ''],
};
getFileAssetsBy(done, Op, 'dateModified');
});
/**
......@@ -177,7 +200,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_006', 0, async function (done) {
getFileAssetsBy(done, 'dateTaken');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.DATE_TAKEN + '= ?',
selectionArgs: [asset.dateTaken + ''],
};
getFileAssetsBy(done, Op, 'dateTaken');
});
/**
......@@ -189,7 +219,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_007', 0, async function (done) {
getFileAssetsBy(done, 'title');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.TITLE + '= ?',
selectionArgs: [asset.title + ''],
};
getFileAssetsBy(done, Op, 'title');
});
/**
......@@ -201,7 +238,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_008', 0, async function (done) {
getFileAssetsBy(done, 'duration');
let assetOp = audiosfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.DURATION + '= ?',
selectionArgs: [asset.duration + ''],
};
getFileAssetsBy(done, Op, 'duration');
});
/**
......@@ -213,7 +257,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_009', 0, async function (done) {
getFileAssetsBy(done, 'width');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.WIDTH + '= ?',
selectionArgs: [asset.width + ''],
};
getFileAssetsBy(done, Op, 'width');
});
/**
......@@ -225,7 +276,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_010', 0, async function (done) {
getFileAssetsBy(done, 'height');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.HEIGHT + '= ?',
selectionArgs: [asset.height + ''],
};
getFileAssetsBy(done, Op, 'height');
});
/**
......@@ -237,7 +295,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_011', 0, async function (done) {
getFileAssetsBy(done, 'orientation');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.ORIENTATION + '= ?',
selectionArgs: [asset.orientation + ''],
};
getFileAssetsBy(done, Op, 'orientation');
});
/**
......@@ -249,7 +314,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_012', 0, async function (done) {
getFileAssetsBy(done, 'albumId');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.ALBUM_ID + '= ?',
selectionArgs: [asset.albumId + ''],
};
getFileAssetsBy(done, Op, 'albumId');
});
/**
......@@ -261,7 +333,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_0013', 0, async function (done) {
getFileAssetsBy(done, 'albumName');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.ALBUM_NAME + '= ?',
selectionArgs: [asset.albumName + ''],
};
getFileAssetsBy(done, Op, 'albumName');
});
/**
......@@ -273,7 +352,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_0014', 0, async function (done) {
getFileAssetsBy(done, 'artist');
let assetOp = audiosfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.ARTIST + '= ?',
selectionArgs: [asset.artist + ''],
};
getFileAssetsBy(done, Op, 'artist');
});
/**
......@@ -285,6 +371,13 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_0015', 0, async function (done) {
getFileAssetsBy(done, 'audioAlbum');
let assetOp = audiosfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.AUDIOALBUM + '= ?',
selectionArgs: [asset.audioAlbum + ''],
};
getFileAssetsBy(done, Op, 'audioAlbum');
});
});
......@@ -64,17 +64,8 @@ const filekeys = {
dateTaken: 'DATE_TAKEN',
}
async function getFileAssetsBy(done, type) {
let assetOp = imagesfetchOp
if(type == 'audioAlbum' || type == 'artist' || type == 'duration') {
assetOp = audiosfetchOp
}
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey[filekeys[type]] + '= ?',
selectionArgs: [asset[type] + ''],
};
async function getFileAssetsBy(done, Op, type) {
try {
let fetchFileResult = await media.getFileAssets(Op);
......@@ -105,7 +96,14 @@ describe('filekeyTestPromise.test.js', async function () {
*/
it('test_fileKey_001', 0, async function (done) {
getFileAssetsBy(done, 'parent');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.PARENT + '= ?',
selectionArgs: [asset.parent + ''],
};
getFileAssetsBy(done, Op, 'parent');
});
/**
......@@ -117,7 +115,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_002', 0, async function (done) {
getFileAssetsBy(done, 'mimeType');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.MIME_TYPE + '= ?',
selectionArgs: [asset.mimeType + ''],
};
getFileAssetsBy(done, Op, 'mimeType');
});
/**
......@@ -129,7 +134,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_003', 0, async function (done) {
getFileAssetsBy(done, 'size');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.SIZE + '= ?',
selectionArgs: [asset.size + ''],
};
getFileAssetsBy(done, Op, 'size');
});
/**
......@@ -141,8 +153,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_004', 0, async function (done) {
getFileAssetsBy(done, 'dateAdded');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.DATE_ADDED + '= ?',
selectionArgs: [asset.dateAdded + ''],
};
getFileAssetsBy(done, Op, 'dateAdded');
});
/**
......@@ -154,7 +172,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_005', 0, async function (done) {
getFileAssetsBy(done, 'dateModified');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.DATE_MODIFIED + '= ?',
selectionArgs: [asset.dateModified + ''],
};
getFileAssetsBy(done, Op, 'dateModified');
});
/**
......@@ -166,7 +191,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_006', 0, async function (done) {
getFileAssetsBy(done, 'dateTaken');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.DATE_TAKEN + '= ?',
selectionArgs: [asset.dateTaken + ''],
};
getFileAssetsBy(done, Op, 'dateTaken');
});
/**
......@@ -178,7 +210,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_007', 0, async function (done) {
getFileAssetsBy(done, 'title');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.TITLE + '= ?',
selectionArgs: [asset.title + ''],
};
getFileAssetsBy(done, Op, 'title');
});
/**
......@@ -190,7 +229,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_008', 0, async function (done) {
getFileAssetsBy(done, 'duration');
let assetOp = audiosfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.DURATION + '= ?',
selectionArgs: [asset.duration + ''],
};
getFileAssetsBy(done, Op, 'duration');
});
/**
......@@ -202,7 +248,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_009', 0, async function (done) {
getFileAssetsBy(done, 'width');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.WIDTH + '= ?',
selectionArgs: [asset.width + ''],
};
getFileAssetsBy(done, Op, 'width');
});
/**
......@@ -214,7 +267,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_010', 0, async function (done) {
getFileAssetsBy(done, 'height');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.HEIGHT + '= ?',
selectionArgs: [asset.height + ''],
};
getFileAssetsBy(done, Op, 'height');
});
/**
......@@ -226,7 +286,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_011', 0, async function (done) {
getFileAssetsBy(done, 'orientation');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.ORIENTATION + '= ?',
selectionArgs: [asset.orientation + ''],
};
getFileAssetsBy(done, Op, 'orientation');
});
/**
......@@ -238,7 +305,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_012', 0, async function (done) {
getFileAssetsBy(done, 'albumId');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.ALBUM_ID + '= ?',
selectionArgs: [asset.albumId + ''],
};
getFileAssetsBy(done, Op, 'albumId');
});
/**
......@@ -250,7 +324,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_0013', 0, async function (done) {
getFileAssetsBy(done, 'albumName');
let assetOp = imagesfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.ALBUM_NAME + '= ?',
selectionArgs: [asset.albumName + ''],
};
getFileAssetsBy(done, Op, 'albumName');
});
/**
......@@ -262,7 +343,14 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_0014', 0, async function (done) {
getFileAssetsBy(done, 'artist');
let assetOp = audiosfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.ARTIST + '= ?',
selectionArgs: [asset.artist + ''],
};
getFileAssetsBy(done, Op, 'artist');
});
/**
......@@ -274,6 +362,13 @@ describe('filekeyTestPromise.test.js', async function () {
* @tc.level : Level 0
*/
it('test_fileKey_0015', 0, async function (done) {
getFileAssetsBy(done, 'audioAlbum');
let assetOp = audiosfetchOp
const fetchFileResult = await media.getFileAssets(assetOp);
const asset = await fetchFileResult.getFirstObject();
let Op = {
selections: mediaLibrary.FileKey.AUDIOALBUM + '= ?',
selectionArgs: [asset.audioAlbum + ''],
};
getFileAssetsBy(done, Op, 'audioAlbum');
});
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册