提交 89e153e3 编写于 作者: Z zhang-daiyue

Fix ERROR in build logs

Signed-off-by: Nzhang-daiyue <zhangdaiyue1@huawei.com>
Change-Id: I778d8342fe9f1782eed773de35b6fe5d10b6e744
上级 d43070b9
...@@ -354,147 +354,6 @@ export default function albumTestCallBackTest(abilityContext){ ...@@ -354,147 +354,6 @@ export default function albumTestCallBackTest(abilityContext){
// ------------------------------ 001 test end ------------------------- // ------------------------------ 001 test end -------------------------
// ------------------------------ 002 test start ------------------------- // ------------------------------ 002 test start -------------------------
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_002_01
* @tc.name : getAlbums
* @tc.desc : Get Album by 666
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_002_01', 0, async function (done) {
try {
media.getAlbums(666, (err, albumList) => {
if (albumList == undefined) {
console.info('ALBUM_CALLBACK getalbum 002_01 passed');
expect(true).assertTrue();
done();
} else {
expect(false).assertTrue();
console.info('ALBUM_CALLBACK getalbum 002_01 failed');
done();
}
});
} catch (error) {
console.info('ALBUM_CALLBACK getalbum 002_01 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_002_02
* @tc.name : getAlbums
* @tc.desc : Get Album by '666'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_002_02', 0, async function (done) {
try {
media.getAlbums('666', (err, albumList) => {
if (albumList == undefined) {
console.info('ALBUM_CALLBACK getalbum 002_02 passed');
expect(true).assertTrue();
done();
} else {
expect(false).assertTrue();
console.info('ALBUM_CALLBACK getalbum 002_02 failed');
done();
}
});
} catch (error) {
console.info('ALBUM_CALLBACK getalbum 002_02 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_002_03
* @tc.name : getAlbums
* @tc.desc : Get Album by 0
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_002_03', 0, async function (done) {
try {
media.getAlbums(0, (err, albumList) => {
if (albumList == undefined) {
console.info('ALBUM_CALLBACK getalbum 002_03 passed');
expect(true).assertTrue();
done();
} else {
expect(false).assertTrue();
console.info('ALBUM_CALLBACK getalbum 002_03 failed');
done();
}
});
} catch (error) {
console.info('ALBUM_CALLBACK getalbum 002_03 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_002_04
* @tc.name : getAlbums
* @tc.desc : Get Album by true
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_002_04', 0, async function (done) {
try {
media.getAlbums(true, (err, albumList) => {
if (albumList == undefined) {
console.info('ALBUM_CALLBACK getalbum 002_04 passed');
expect(true).assertTrue();
done();
} else {
expect(false).assertTrue();
console.info('ALBUM_CALLBACK getalbum 002_04 failed');
done();
}
});
} catch (error) {
console.info('ALBUM_CALLBACK getalbum 002_04 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_002_05
* @tc.name : getAlbums
* @tc.desc : Get Album by false
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_GETALBUM_CALLBACK_002_05', 0, async function (done) {
try {
media.getAlbums(false, (err, albumList) => {
if (albumList == undefined) {
console.info('ALBUM_CALLBACK getalbum 002_05 passed');
expect(true).assertTrue();
done();
} else {
expect(false).assertTrue();
console.info('ALBUM_CALLBACK getalbum 002_05 failed');
done();
}
});
} catch (error) {
console.info('ALBUM_CALLBACK getalbum 002_05 passed');
expect(true).assertTrue();
done();
}
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_06 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_06
* @tc.name : album.getFileAssets * @tc.name : album.getFileAssets
...@@ -685,9 +544,9 @@ export default function albumTestCallBackTest(abilityContext){ ...@@ -685,9 +544,9 @@ export default function albumTestCallBackTest(abilityContext){
const albumId = album.albumId; const albumId = album.albumId;
console.info('ALBUM_CALLBACK Modify 003_03 album.albumName(old) = ' + album.albumName); console.info('ALBUM_CALLBACK Modify 003_03 album.albumName(old) = ' + album.albumName);
let newName = true; let newName = "";
for (var i = 0; i < 1200; i++) { for (var i = 0; i < 1200; i++) {
newName += 'i'; newName += i.toString();
} }
album.albumName = newName; album.albumName = newName;
...@@ -712,83 +571,6 @@ export default function albumTestCallBackTest(abilityContext){ ...@@ -712,83 +571,6 @@ export default function albumTestCallBackTest(abilityContext){
} }
done(); done();
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_04
* @tc.name : commitModify
* @tc.desc : Modify Album name true
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_04', 0, async function (done) {
try {
const albumList = await media.getAlbums(allTypefetchOp);
const album = albumList[0];
const albumId = album.albumId;
console.info('ALBUM_CALLBACK Modify 003_04 album.albumName(old) = ' + album.albumName);
const newName = true;
album.albumName = newName;
album.commitModify(async () => {
try {
let currentfetchOp = {
selections: fileKeyObj.ALBUM_ID + '= ?',
selectionArgs: [albumId + ''],
};
const newAlbumList = await media.getAlbums(currentfetchOp);
expect(newAlbumList[0].albumName == newName).assertFalse();
done();
} catch (error) {
console.info('ALBUM_CALLBACK Modify 003_04 commitModify failed, message = ' + error);
}
});
} catch (error) {
console.info('ALBUM_CALLBACK Modify 003_04 passed');
expect(true).assertTrue();
}
done();
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_05
* @tc.name : commitModify
* @tc.desc : Modify Album name false
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_003_05', 0, async function (done) {
try {
const albumList = await media.getAlbums(allTypefetchOp);
const album = albumList[0];
const albumId = album.albumId;
console.info('ALBUM_CALLBACK Modify 003_05 album.albumName(old) = ' + album.albumName);
const newName = false;
album.albumName = newName;
album.commitModify(async () => {
try {
let currentfetchOp = {
selections: fileKeyObj.ALBUM_ID + '= ?',
selectionArgs: [albumId + ''],
};
const newAlbumList = await media.getAlbums(currentfetchOp);
expect(newAlbumList[0].albumName == newName).assertFalse();
done();
} catch (error) {
console.info('ALBUM_CALLBACK Modify 003_05 commitModify failed, message = ' + error);
}
});
} catch (error) {
console.info('ALBUM_CALLBACK Modify 003_05 passed');
expect(true).assertTrue();
}
done();
});
// ------------------------------ 003 test end ------------------------- // ------------------------------ 003 test end -------------------------
// ------------------------------ 004 test start ------------------------- // ------------------------------ 004 test start -------------------------
...@@ -835,52 +617,6 @@ export default function albumTestCallBackTest(abilityContext){ ...@@ -835,52 +617,6 @@ export default function albumTestCallBackTest(abilityContext){
} }
}); });
// ------------------------------ 004 test end ------------------------- // ------------------------------ 004 test end -------------------------
// ------------------------------ 006 test start -------------------------
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_006_01
* @tc.name : commitModify
* @tc.desc : Modify Album albumUri
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_006_01', 0, async function (done) {
const albumList = await media.getAlbums(allTypefetchOp);
const album = albumList[0];
try {
album.albumUri = 'testalbumUri';
expect(false).assertTrue();
done();
} catch (error) {
expect(true).assertTrue();
done();
console.info('ALBUM_CALLBACK Modify 006_01 003 album.albumUri error = album.albumUri has no setter');
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_006_02
* @tc.name : commitModify
* @tc.desc : Modify Album name false
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_CALLBACK_006_02', 0, async function (done) {
const albumList = await media.getAlbums(allTypefetchOp);
const album = albumList[0];
try {
album.coverUri = 'testcoverUri';
expect(false).assertTrue();
done();
} catch (error) {
expect(true).assertTrue();
console.info('ALBUM_CALLBACK Modify 006_01 003 album.albumUri error = album.coverUri has no setter');
done();
}
});
// ------------------------------ 006 test end -------------------------
}); });
} }
......
...@@ -313,111 +313,6 @@ export default function albumTestPromiseTest(abilityContext){ ...@@ -313,111 +313,6 @@ export default function albumTestPromiseTest(abilityContext){
// ------------------------------ 001 test end ------------------------- // ------------------------------ 001 test end -------------------------
// ------------------------------ 002 test start ------------------------- // ------------------------------ 002 test start -------------------------
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_002_01
* @tc.name : getAlbums
* @tc.desc : Get Album by 666
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_002_01', 0, async function (done) {
try {
await media.getAlbums(666);
expect(false).assertTrue();
console.info('ALBUM_PROMISE getalbum 002_01 failed');
done();
} catch (error) {
console.info('ALBUM_PROMISE getalbum 002_01 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_002_02
* @tc.name : getAlbums
* @tc.desc : Get Album by '666'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_002_02', 0, async function (done) {
try {
await media.getAlbums('666');
console.info('ALBUM_PROMISE getalbum 002_02 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('ALBUM_PROMISE getalbum 002_02 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_002_03
* @tc.name : getAlbums
* @tc.desc : Get Album by 0
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_002_03', 0, async function (done) {
try {
await media.getAlbums(0);
console.info('ALBUM_PROMISE getalbum 002_03 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('ALBUM_PROMISE getalbum 002_03 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_002_04
* @tc.name : getAlbums
* @tc.desc : Get Album by true
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_002_04', 0, async function (done) {
try {
await media.getAlbums(true);
console.info('ALBUM_PROMISE getalbum 002_04 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('ALBUM_PROMISE getalbum 002_04 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_002_05
* @tc.name : getAlbums
* @tc.desc : Get Album by false
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_GETALBUM_PROMISE_002_05', 0, async function (done) {
try {
await media.getAlbums(false);
console.info('ALBUM_PROMISE getalbum 002_05 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('ALBUM_PROMISE getalbum 002_05 passed');
expect(true).assertTrue();
done();
}
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_06 * @tc.number : SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_06
* @tc.name : album.getFileAssets * @tc.name : album.getFileAssets
...@@ -581,9 +476,9 @@ export default function albumTestPromiseTest(abilityContext){ ...@@ -581,9 +476,9 @@ export default function albumTestPromiseTest(abilityContext){
const albumId = album.albumId; const albumId = album.albumId;
console.info('ALBUM_PROMISE Modify 003_04 album.albumName(old) = ' + album.albumName); console.info('ALBUM_PROMISE Modify 003_04 album.albumName(old) = ' + album.albumName);
let newName = true; let newName = "";
for (var i = 0; i < 1200; i++) { for (var i = 0; i < 1200; i++) {
newName += 'i'; newName += i.toString();
} }
album.albumName = newName; album.albumName = newName;
...@@ -603,76 +498,6 @@ export default function albumTestPromiseTest(abilityContext){ ...@@ -603,76 +498,6 @@ export default function albumTestPromiseTest(abilityContext){
} }
done(); done();
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_05
* @tc.name : commitModify
* @tc.desc : Modify Album name true
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_05', 0, async function (done) {
try {
const albumList = await media.getAlbums(allTypefetchOp);
const album = albumList[0];
const albumId = album.albumId;
console.info('ALBUM_PROMISE Modify 003_05 album.albumName(old) = ' + album.albumName);
const newName = true;
album.albumName = newName;
await album.commitModify();
let currentfetchOp = {
selections: fileKeyObj.ALBUM_ID + '= ?',
selectionArgs: [albumId + ''],
};
const newAlbumList = await media.getAlbums(currentfetchOp);
expect(newAlbumList[0].albumName === newName).assertFalse();
done();
} catch (error) {
console.info('ALBUM_PROMISE Modify 003_05 passed');
expect(true).assertTrue();
}
done();
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_06
* @tc.name : commitModify
* @tc.desc : Modify Album name false
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_003_06', 0, async function (done) {
try {
const albumList = await media.getAlbums(allTypefetchOp);
const album = albumList[0];
const albumId = album.albumId;
console.info('ALBUM_PROMISE Modify 003_06 album.albumName(old) = ' + album.albumName);
const newName = false;
album.albumName = newName;
await album.commitModify();
let currentfetchOp = {
selections: fileKeyObj.ALBUM_ID + '= ?',
selectionArgs: [albumId + ''],
};
const newAlbumList = await media.getAlbums(currentfetchOp);
expect(newAlbumList[0].albumName === newName).assertFalse();
done();
} catch (error) {
console.info('ALBUM_PROMISE Modify 003_06 passed');
expect(true).assertTrue();
}
done();
});
// ------------------------------ 003 test end ------------------------- // ------------------------------ 003 test end -------------------------
// ------------------------------ 004 test start ------------------------- // ------------------------------ 004 test start -------------------------
...@@ -713,54 +538,6 @@ export default function albumTestPromiseTest(abilityContext){ ...@@ -713,54 +538,6 @@ export default function albumTestPromiseTest(abilityContext){
} }
}); });
// ------------------------------ 004 test end ------------------------- // ------------------------------ 004 test end -------------------------
// ------------------------------ 006 test start -------------------------
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_006_01
* @tc.name : commitModify
* @tc.desc : Modify Album albumUri
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_006_01', 0, async function (done) {
try {
const albumList = await media.getAlbums(allTypefetchOp);
const album = albumList[0];
album.albumUri = 'testalbumUri';
await album.commitModify();
console.info('ALBUM_PROMISE Modify 006_01 failed');
expect(false).assertTrue();
} catch (error) {
console.info('ALBUM_PROMISE Modify 006_01 passed');
expect(true).assertTrue();
}
done();
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_006_02
* @tc.name : commitModify
* @tc.desc : Modify Album name false
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_MODIFYALBUM_PROMISE_006_02', 0, async function (done) {
try {
const albumList = await media.getAlbums(allTypefetchOp);
const album = albumList[0];
album.coverUri = 'testcoverUri';
await album.commitModify();
console.info('ALBUM_PROMISE Modify 006_02 failed');
expect(false).assertTrue();
} catch (error) {
console.info('ALBUM_PROMISE Modify 006_02 passed');
expect(true).assertTrue();
}
done();
});
// ------------------------------ 006 test end -------------------------
}); });
} }
......
...@@ -180,171 +180,6 @@ export default function favoriteTestCallBackTest(abilityContext) { ...@@ -180,171 +180,6 @@ export default function favoriteTestCallBackTest(abilityContext) {
} }
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_001_03
* @tc.name : favorite
* @tc.desc : favorite(file) by 'true'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_001_03', 0, async function (done) {
try {
media.getFileAssets(fileFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
try {
asset.favorite('true', () => {
console.info('FAV_ASSET_CALLBACK 001_03 fail');
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 001_03 pass');
expect(true).assertTrue();
done();
}
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 001_03 pass');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_001_04
* @tc.name : favorite
* @tc.desc : favorite(file) by 'false'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_001_04', 0, async function (done) {
try {
media.getFileAssets(fileFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
try {
asset.favorite('false', () => {
console.info('FAV_ASSET_CALLBACK 001_04 fail');
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 001_04 pass');
expect(true).assertTrue();
done();
}
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 001_04 pass');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_001_05
* @tc.name : favorite
* @tc.desc : favorite(file) by 'fav'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_001_05', 0, async function (done) {
try {
media.getFileAssets(fileFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
try {
asset.favorite('fav', () => {
console.info('FAV_ASSET_CALLBACK 001_05 fail');
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 001_05 pass');
expect(true).assertTrue();
done();
}
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 001_05 pass');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_001_06
* @tc.name : favorite
* @tc.desc : favorite(file) by 666
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_001_06', 0, async function (done) {
try {
media.getFileAssets(fileFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
try {
asset.favorite(666, () => {
console.info('FAV_ASSET_CALLBACK 001_06 fail');
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 001_06 pass');
expect(true).assertTrue();
done();
}
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 001_06 pass');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_001_07
* @tc.name : favorite
* @tc.desc : favorite(file) by no arg
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_001_07', 0, async function (done) {
try {
media.getFileAssets(fileFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
try {
asset.favorite(() => {
console.info('FAV_ASSET_CALLBACK 001_07 fail');
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 001_07 pass');
expect(true).assertTrue();
done();
}
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 001_07 pass');
expect(true).assertTrue();
done();
}
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_001_08 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_001_08
* @tc.name : isFavorite * @tc.name : isFavorite
...@@ -543,335 +378,170 @@ export default function favoriteTestCallBackTest(abilityContext) { ...@@ -543,335 +378,170 @@ export default function favoriteTestCallBackTest(abilityContext) {
}); });
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_002_03 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_002_08
* @tc.name : favorite * @tc.name : isFavorite
* @tc.desc : favorite(image) by 'true' * @tc.desc : isFavorite(image) result false
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_002_03', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_002_08', 0, async function (done) {
try { try {
media.getFileAssets(imageFetchOp, (error, fileAssets) => { media.getFileAssets(imageFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => { fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0]; const asset = dataList[0];
try { asset.isFavorite((err1, isFavorite) => {
asset.favorite('true', () => { if (isFavorite) {
console.info('FAV_ASSET_CALLBACK 002_03 fail'); console.info('FAV_ASSET_CALLBACK 002_08 fail');
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
}); } else {
} catch (error) { console.info('FAV_ASSET_CALLBACK 002_08 pass');
console.info('FAV_ASSET_CALLBACK 002_03 passed');
expect(true).assertTrue(); expect(true).assertTrue();
done(); done();
} }
}); });
}); });
});
} catch (error) { } catch (error) {
console.info('FAV_ASSET_CALLBACK 002_03 passed'); console.info('FAV_ASSET_CALLBACK 002_08 failed, message = ' + error);
expect(true).assertTrue(); expect(false).assertTrue();
done(); done();
} }
}); });
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_002_04 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_002_09
* @tc.name : favorite * @tc.name : isFavorite
* @tc.desc : favorite(image) by 'false' * @tc.desc : isFavorite(image) result true
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_002_04', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_002_09', 0, async function (done) {
try { try {
media.getFileAssets(imageFetchOp, (error, fileAssets) => { media.getFileAssets(imageFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => { fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0]; const asset = dataList[0];
try { asset.favorite(true, () => {
asset.favorite('false', () => { asset.isFavorite((err1, isFavorite) => {
console.info('FAV_ASSET_CALLBACK 002_04 fail'); if (isFavorite) {
expect(false).assertTrue(); console.info('FAV_ASSET_CALLBACK 002_09 pass');
done();
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 002_04 passed');
expect(true).assertTrue(); expect(true).assertTrue();
done(); done();
} else {
console.info('FAV_ASSET_CALLBACK 002_09 fail');
expect(false).assertTrue();
done();
} }
}); });
}); });
});
});
} catch (error) { } catch (error) {
console.info('FAV_ASSET_CALLBACK 002_04 passed'); console.info('FAV_ASSET_CALLBACK 002_09 failed, message = ' + error);
expect(true).assertTrue(); expect(false).assertTrue();
done(); done();
} }
}); });
// ------------------------------ image type end ------------------------
// ------------------------------ video type start ------------------------
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_002_05 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_003_01
* @tc.name : favorite * @tc.name : favorite
* @tc.desc : favorite(image) by 'fav' * @tc.desc : favorite(video) by true
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_002_05', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_003_01', 0, async function (done) {
try { try {
media.getFileAssets(imageFetchOp, (error, fileAssets) => { media.getFileAssets(videoFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => { fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0]; const asset = dataList[0];
try { asset.isFavorite((err1, isFavorite) => {
asset.favorite('fav', () => { if (isFavorite) {
console.info('FAV_ASSET_CALLBACK 002_05 fail'); asset.favorite(false, () => {
asset.isFavorite((err1, isFavorite) => {
if (isFavorite) {
console.info('FAV_ASSET_CALLBACK 003_01 fail');
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
}); } else {
} catch (error) { asset.favorite(true, () => {
console.info('FAV_ASSET_CALLBACK 002_05 passed'); asset.isFavorite((err1, isFavorite) => {
if (isFavorite) {
console.info('FAV_ASSET_CALLBACK 003_01 success');
expect(true).assertTrue(); expect(true).assertTrue();
done(); done();
} else {
console.info('FAV_ASSET_CALLBACK 003_01 fail');
expect(false).assertTrue();
done();
} }
}); });
}); });
} catch (error) {
console.info('FAV_ASSET_CALLBACK 002_05 passed');
expect(true).assertTrue();
done();
} }
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_002_06
* @tc.name : favorite
* @tc.desc : favorite(image) by 666
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_002_06', 0, async function (done) {
try {
media.getFileAssets(imageFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
try {
asset.favorite(666, () => {
console.info('FAV_ASSET_CALLBACK 002_06 fail');
expect(false).assertTrue();
done();
}); });
} catch (error) { } else {
console.info('FAV_ASSET_CALLBACK 002_06 passed'); asset.favorite(true, () => {
asset.isFavorite((err1, isFavorite) => {
if (isFavorite) {
console.info('FAV_ASSET_CALLBACK 003_01 success');
expect(true).assertTrue(); expect(true).assertTrue();
done(); done();
} else {
console.info('FAV_ASSET_CALLBACK 003_01 fail');
expect(false).assertTrue();
done();
}
});
});
} }
});
}); });
}); });
} catch (error) { } catch (error) {
console.info('FAV_ASSET_CALLBACK 002_06 passed'); console.info('FAV_ASSET_CALLBACK 003_01 failed, message = ' + error);
expect(true).assertTrue(); expect(false).assertTrue();
done(); done();
} }
}); });
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_002_07 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_003_02
* @tc.name : favorite * @tc.name : favorite
* @tc.desc : favorite(image) by no arg * @tc.desc : favorite(video) by false
* @tc.size : MEDIUM * @tc.size : MEDIUM
* @tc.type : Function * @tc.type : Function
* @tc.level : Level 0 * @tc.level : Level 0
*/ */
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_002_07', 0, async function (done) { it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_003_02', 0, async function (done) {
try { try {
media.getFileAssets(imageFetchOp, (error, fileAssets) => { media.getFileAssets(videoFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => { fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0]; const asset = dataList[0];
try { asset.isFavorite((err1, isFavorite) => {
asset.favorite(() => { if (!isFavorite) {
console.info('FAV_ASSET_CALLBACK 002_07 fail'); asset.favorite(true, () => {
asset.isFavorite((err1, isFavorite) => {
if (!isFavorite) {
console.info('FAV_ASSET_CALLBACK 003_02 fail');
expect(false).assertTrue(); expect(false).assertTrue();
done(); done();
}); } else {
} catch (error) { asset.favorite(false, () => {
console.info('FAV_ASSET_CALLBACK 002_07 passed'); asset.isFavorite((err1, isFavorite) => {
if (!isFavorite) {
console.info('FAV_ASSET_CALLBACK 003_02 pass');
expect(true).assertTrue(); expect(true).assertTrue();
done(); done();
} } else {
}); console.info('FAV_ASSET_CALLBACK 003_02 fail');
}); expect(false).assertTrue();
} catch (error) {
console.info('FAV_ASSET_CALLBACK 002_07 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_002_08
* @tc.name : isFavorite
* @tc.desc : isFavorite(image) result false
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_002_08', 0, async function (done) {
try {
media.getFileAssets(imageFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
asset.isFavorite((err1, isFavorite) => {
if (isFavorite) {
console.info('FAV_ASSET_CALLBACK 002_08 fail');
expect(false).assertTrue();
done();
} else {
console.info('FAV_ASSET_CALLBACK 002_08 pass');
expect(true).assertTrue();
done();
}
});
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 002_08 failed, message = ' + error);
expect(false).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_002_09
* @tc.name : isFavorite
* @tc.desc : isFavorite(image) result true
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_002_09', 0, async function (done) {
try {
media.getFileAssets(imageFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
asset.favorite(true, () => {
asset.isFavorite((err1, isFavorite) => {
if (isFavorite) {
console.info('FAV_ASSET_CALLBACK 002_09 pass');
expect(true).assertTrue();
done();
} else {
console.info('FAV_ASSET_CALLBACK 002_09 fail');
expect(false).assertTrue();
done();
}
});
});
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 002_09 failed, message = ' + error);
expect(false).assertTrue();
done();
}
});
// ------------------------------ image type end ------------------------
// ------------------------------ video type start ------------------------
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_003_01
* @tc.name : favorite
* @tc.desc : favorite(video) by true
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_003_01', 0, async function (done) {
try {
media.getFileAssets(videoFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
asset.isFavorite((err1, isFavorite) => {
if (isFavorite) {
asset.favorite(false, () => {
asset.isFavorite((err1, isFavorite) => {
if (isFavorite) {
console.info('FAV_ASSET_CALLBACK 003_01 fail');
expect(false).assertTrue();
done();
} else {
asset.favorite(true, () => {
asset.isFavorite((err1, isFavorite) => {
if (isFavorite) {
console.info('FAV_ASSET_CALLBACK 003_01 success');
expect(true).assertTrue();
done();
} else {
console.info('FAV_ASSET_CALLBACK 003_01 fail');
expect(false).assertTrue();
done();
}
});
});
}
});
});
} else {
asset.favorite(true, () => {
asset.isFavorite((err1, isFavorite) => {
if (isFavorite) {
console.info('FAV_ASSET_CALLBACK 003_01 success');
expect(true).assertTrue();
done();
} else {
console.info('FAV_ASSET_CALLBACK 003_01 fail');
expect(false).assertTrue();
done();
}
});
});
}
});
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 003_01 failed, message = ' + error);
expect(false).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_003_02
* @tc.name : favorite
* @tc.desc : favorite(video) by false
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_003_02', 0, async function (done) {
try {
media.getFileAssets(videoFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
asset.isFavorite((err1, isFavorite) => {
if (!isFavorite) {
asset.favorite(true, () => {
asset.isFavorite((err1, isFavorite) => {
if (!isFavorite) {
console.info('FAV_ASSET_CALLBACK 003_02 fail');
expect(false).assertTrue();
done();
} else {
asset.favorite(false, () => {
asset.isFavorite((err1, isFavorite) => {
if (!isFavorite) {
console.info('FAV_ASSET_CALLBACK 003_02 pass');
expect(true).assertTrue();
done();
} else {
console.info('FAV_ASSET_CALLBACK 003_02 fail');
expect(false).assertTrue();
done(); done();
} }
}); });
...@@ -905,171 +575,6 @@ export default function favoriteTestCallBackTest(abilityContext) { ...@@ -905,171 +575,6 @@ export default function favoriteTestCallBackTest(abilityContext) {
} }
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_003_03
* @tc.name : favorite
* @tc.desc : favorite(video) by 'true'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_003_03', 0, async function (done) {
try {
media.getFileAssets(videoFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
try {
asset.favorite('true', () => {
console.info('FAV_ASSET_CALLBACK 003_03 fail');
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 003_03 passed');
expect(true).assertTrue();
done();
}
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 003_03 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_003_04
* @tc.name : favorite
* @tc.desc : favorite(video) by 'false'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_003_04', 0, async function (done) {
try {
media.getFileAssets(videoFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
try {
asset.favorite('false', () => {
console.info('FAV_ASSET_CALLBACK 003_04 fail');
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 003_04 passed');
expect(true).assertTrue();
done();
}
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 003_04 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_003_05
* @tc.name : favorite
* @tc.desc : favorite(video) by 'fav'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_003_05', 0, async function (done) {
try {
media.getFileAssets(videoFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
try {
asset.favorite('fav', () => {
console.info('FAV_ASSET_CALLBACK 003_05 fail');
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 003_05 passed');
expect(true).assertTrue();
done();
}
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 003_05 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_003_06
* @tc.name : favorite
* @tc.desc : favorite(video) by 666
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_003_06', 0, async function (done) {
try {
media.getFileAssets(videoFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
try {
asset.favorite(666, () => {
console.info('FAV_ASSET_CALLBACK 003_06 fail');
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 003_06 passed');
expect(true).assertTrue();
done();
}
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 003_06 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_003_07
* @tc.name : favorite
* @tc.desc : favorite(video) by no arg
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_003_07', 0, async function (done) {
try {
media.getFileAssets(videoFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
try {
asset.favorite(() => {
console.info('FAV_ASSET_CALLBACK 003_07 fail');
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 003_07 passed');
expect(true).assertTrue();
done();
}
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 003_07 passed');
expect(true).assertTrue();
done();
}
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_003_08 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_003_08
* @tc.name : isFavorite * @tc.name : isFavorite
...@@ -1268,171 +773,6 @@ export default function favoriteTestCallBackTest(abilityContext) { ...@@ -1268,171 +773,6 @@ export default function favoriteTestCallBackTest(abilityContext) {
} }
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_004_03
* @tc.name : favorite
* @tc.desc : favorite(audio) by 'true'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_004_03', 0, async function (done) {
try {
media.getFileAssets(audioFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
try {
asset.favorite('true', () => {
console.info('FAV_ASSET_CALLBACK 004_03 fail');
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 004_03 passed');
expect(true).assertTrue();
done();
}
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 004_03 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_004_04
* @tc.name : favorite
* @tc.desc : favorite(audio) by 'false'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_004_04', 0, async function (done) {
try {
media.getFileAssets(audioFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
try {
asset.favorite('false', () => {
console.info('FAV_ASSET_CALLBACK 004_04 fail');
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 004_04 passed');
expect(true).assertTrue();
done();
}
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 004_04 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_004_05
* @tc.name : favorite
* @tc.desc : favorite(audio) by 'fav'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_004_05', 0, async function (done) {
try {
media.getFileAssets(audioFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
try {
asset.favorite('fav', () => {
console.info('FAV_ASSET_CALLBACK 004_05 fail');
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 004_05 passed');
expect(true).assertTrue();
done();
}
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 004_05 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_004_06
* @tc.name : favorite
* @tc.desc : favorite(audio) by 666
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_004_06', 0, async function (done) {
try {
media.getFileAssets(audioFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
try {
asset.favorite(666, () => {
console.info('FAV_ASSET_CALLBACK 004_06 fail');
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 004_06 passed');
expect(true).assertTrue();
done();
}
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 004_06 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_004_07
* @tc.name : favorite
* @tc.desc : favorite(audio) by no arg
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_004_07', 0, async function (done) {
try {
media.getFileAssets(audioFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
try {
asset.favorite(() => {
console.info('FAV_ASSET_CALLBACK 004_07 fail');
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 004_07 passed');
expect(true).assertTrue();
done();
}
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 004_07 passed');
expect(true).assertTrue();
done();
}
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_004_08 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_004_08
* @tc.name : isFavorite * @tc.name : isFavorite
......
...@@ -137,126 +137,6 @@ export default function favoriteTestPromiseTest(abilityContext) { ...@@ -137,126 +137,6 @@ export default function favoriteTestPromiseTest(abilityContext) {
} }
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_001_03
* @tc.name : favorite
* @tc.desc : favorite(file) by 'true'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_001_03', 0, async function (done) {
try {
const fileAssets = await media.getFileAssets(fileFetchOp);
const dataList = await fileAssets.getAllObject();
const asset = dataList[0];
await asset.favorite('true');
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 001_03 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 001_03 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_001_04
* @tc.name : favorite
* @tc.desc : favorite(file) by 'false'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_001_04', 0, async function (done) {
try {
const fileAssets = await media.getFileAssets(fileFetchOp);
const dataList = await fileAssets.getAllObject();
const asset = dataList[0];
await asset.favorite('false');
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 001_04 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 001_04 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_001_05
* @tc.name : favorite
* @tc.desc : favorite(file) by 'fav'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_001_05', 0, async function (done) {
try {
const fileAssets = await media.getFileAssets(fileFetchOp);
const dataList = await fileAssets.getAllObject();
const asset = dataList[0];
await asset.favorite('fav');
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 001_05 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 001_05 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_001_06
* @tc.name : favorite
* @tc.desc : favorite(file) by 666
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_001_06', 0, async function (done) {
try {
const fileAssets = await media.getFileAssets(fileFetchOp);
const dataList = await fileAssets.getAllObject();
const asset = dataList[0];
await asset.favorite(666);
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 001_06 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 001_06 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_001_07
* @tc.name : favorite
* @tc.desc : favorite(file) by no arg
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_001_07', 0, async function (done) {
try {
const fileAssets = await media.getFileAssets(fileFetchOp);
const dataList = await fileAssets.getAllObject();
const asset = dataList[0];
await asset.favorite();
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 001_07 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 001_07 passed');
expect(true).assertTrue();
done();
}
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_001_08 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_001_08
* @tc.name : isFavorite * @tc.name : isFavorite
...@@ -403,126 +283,6 @@ export default function favoriteTestPromiseTest(abilityContext) { ...@@ -403,126 +283,6 @@ export default function favoriteTestPromiseTest(abilityContext) {
} }
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_002_03
* @tc.name : favorite
* @tc.desc : favorite(image) by 'true'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_002_03', 0, async function (done) {
try {
const fileAssets = await media.getFileAssets(imageFetchOp);
const dataList = await fileAssets.getAllObject();
const asset = dataList[0];
await asset.favorite('true');
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 002_03 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 002_03 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_002_04
* @tc.name : favorite
* @tc.desc : favorite(image) by 'false'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_002_04', 0, async function (done) {
try {
const fileAssets = await media.getFileAssets(imageFetchOp);
const dataList = await fileAssets.getAllObject();
const asset = dataList[0];
await asset.favorite('false');
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 002_04 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 002_04 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_002_05
* @tc.name : favorite
* @tc.desc : favorite(image) by 'fav'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_002_05', 0, async function (done) {
try {
const fileAssets = await media.getFileAssets(imageFetchOp);
const dataList = await fileAssets.getAllObject();
const asset = dataList[0];
await asset.favorite('fav');
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 002_05 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 002_05 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_002_06
* @tc.name : favorite
* @tc.desc : favorite(image) by 666
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_002_06', 0, async function (done) {
try {
const fileAssets = await media.getFileAssets(imageFetchOp);
const dataList = await fileAssets.getAllObject();
const asset = dataList[0];
await asset.favorite(666);
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 002_06 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 002_06 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_002_07
* @tc.name : favorite
* @tc.desc : favorite(image) by no arg
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_002_07', 0, async function (done) {
try {
const fileAssets = await media.getFileAssets(imageFetchOp);
const dataList = await fileAssets.getAllObject();
const asset = dataList[0];
await asset.favorite();
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 002_07 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 002_07 passed');
expect(true).assertTrue();
done();
}
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_002_08 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_002_08
* @tc.name : isFavorite * @tc.name : isFavorite
...@@ -668,126 +428,6 @@ export default function favoriteTestPromiseTest(abilityContext) { ...@@ -668,126 +428,6 @@ export default function favoriteTestPromiseTest(abilityContext) {
} }
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_003_03
* @tc.name : favorite
* @tc.desc : favorite(video) by 'true'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_003_03', 0, async function (done) {
try {
const fileAssets = await media.getFileAssets(videoFetchOp);
const dataList = await fileAssets.getAllObject();
const asset = dataList[0];
await asset.favorite('true');
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 003_03 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 003_03 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_003_04
* @tc.name : favorite
* @tc.desc : favorite(video) by 'false'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_003_04', 0, async function (done) {
try {
const fileAssets = await media.getFileAssets(videoFetchOp);
const dataList = await fileAssets.getAllObject();
const asset = dataList[0];
await asset.favorite('false');
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 003_04 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 003_04 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_003_05
* @tc.name : favorite
* @tc.desc : favorite(video) by 'fav'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_003_05', 0, async function (done) {
try {
const fileAssets = await media.getFileAssets(videoFetchOp);
const dataList = await fileAssets.getAllObject();
const asset = dataList[0];
await asset.favorite('fav');
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 003_05 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 003_05 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_003_06
* @tc.name : favorite
* @tc.desc : favorite(video) by 666
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_003_06', 0, async function (done) {
try {
const fileAssets = await media.getFileAssets(videoFetchOp);
const dataList = await fileAssets.getAllObject();
const asset = dataList[0];
await asset.favorite(666);
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 003_06 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 003_06 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_003_07
* @tc.name : favorite
* @tc.desc : favorite(video) by no arg
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_003_07', 0, async function (done) {
try {
const fileAssets = await media.getFileAssets(videoFetchOp);
const dataList = await fileAssets.getAllObject();
const asset = dataList[0];
await asset.favorite();
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 003_07 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 003_07 passed');
expect(true).assertTrue();
done();
}
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_003_08 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_003_08
* @tc.name : isFavorite * @tc.name : isFavorite
...@@ -933,126 +573,6 @@ export default function favoriteTestPromiseTest(abilityContext) { ...@@ -933,126 +573,6 @@ export default function favoriteTestPromiseTest(abilityContext) {
} }
}); });
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_004_03
* @tc.name : favorite
* @tc.desc : favorite(audio) by 'true'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_004_03', 0, async function (done) {
try {
const fileAssets = await media.getFileAssets(audioFetchOp);
const dataList = await fileAssets.getAllObject();
const asset = dataList[0];
await asset.favorite('true');
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 004_03 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 004_03 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_004_04
* @tc.name : favorite
* @tc.desc : favorite(audio) by 'false'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_004_04', 0, async function (done) {
try {
const fileAssets = await media.getFileAssets(audioFetchOp);
const dataList = await fileAssets.getAllObject();
const asset = dataList[0];
await asset.favorite('false');
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 004_04 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 004_04 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_004_05
* @tc.name : favorite
* @tc.desc : favorite(audio) by 'fav'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_004_05', 0, async function (done) {
try {
const fileAssets = await media.getFileAssets(audioFetchOp);
const dataList = await fileAssets.getAllObject();
const asset = dataList[0];
await asset.favorite('fav');
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 004_05 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 004_05 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_004_06
* @tc.name : favorite
* @tc.desc : favorite(audio) by 666
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_004_06', 0, async function (done) {
try {
const fileAssets = await media.getFileAssets(audioFetchOp);
const dataList = await fileAssets.getAllObject();
const asset = dataList[0];
await asset.favorite(666);
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 004_06 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 004_06 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_004_07
* @tc.name : favorite
* @tc.desc : favorite(audio) by no arg
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_004_07', 0, async function (done) {
try {
const fileAssets = await media.getFileAssets(audioFetchOp);
const dataList = await fileAssets.getAllObject();
const asset = dataList[0];
await asset.favorite();
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 004_07 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('MediaLibraryTest : FAV_ASSET_PROMISE 004_07 passed');
expect(true).assertTrue();
done();
}
});
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_004_08 * @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_PROMISE_004_08
* @tc.name : isFavorite * @tc.name : isFavorite
......
...@@ -334,7 +334,8 @@ export default function fetchFileResultCallBackTest(abilityContext) { ...@@ -334,7 +334,8 @@ export default function fetchFileResultCallBackTest(abilityContext) {
console.info('MediaLibraryTest : FETCHRESULT getNextObject 008_01 fail'); console.info('MediaLibraryTest : FETCHRESULT getNextObject 008_01 fail');
done(); done();
} else { } else {
expect(0 < targetObjects.length <= 1).assertTrue(); expect(targetObjects.length > 0).assertTrue();
expect(targetObjects.length <= 1).assertTrue();
console.info('MediaLibraryTest : FETCHRESULT getPositionObject 008_01 end'); console.info('MediaLibraryTest : FETCHRESULT getPositionObject 008_01 end');
done(); done();
} }
...@@ -365,7 +366,8 @@ export default function fetchFileResultCallBackTest(abilityContext) { ...@@ -365,7 +366,8 @@ export default function fetchFileResultCallBackTest(abilityContext) {
console.info('MediaLibraryTest : FETCHRESULT getNextObject 008_01 fail'); console.info('MediaLibraryTest : FETCHRESULT getNextObject 008_01 fail');
done(); done();
} else { } else {
expect(0 < targetObjects.length <= 2).assertTrue(); expect(targetObjects.length > 0).assertTrue();
expect(targetObjects.length <= 2).assertTrue();
console.info('MediaLibraryTest : FETCHRESULT getAllObject 008_02 targetObjects.length:' console.info('MediaLibraryTest : FETCHRESULT getAllObject 008_02 targetObjects.length:'
+ targetObjects.length); + targetObjects.length);
console.info('MediaLibraryTest : FETCHRESULT getAllObject 008_02 end'); console.info('MediaLibraryTest : FETCHRESULT getAllObject 008_02 end');
...@@ -398,7 +400,8 @@ export default function fetchFileResultCallBackTest(abilityContext) { ...@@ -398,7 +400,8 @@ export default function fetchFileResultCallBackTest(abilityContext) {
console.info('MediaLibraryTest : FETCHRESULT getNextObject 008_03 fail'); console.info('MediaLibraryTest : FETCHRESULT getNextObject 008_03 fail');
done(); done();
} else { } else {
expect(0 < targetObjects.length <= 100).assertTrue(); expect(targetObjects.length > 0).assertTrue();
expect(targetObjects.length <= 100).assertTrue();
console.info('MediaLibraryTest : FETCHRESULT getAllObject 008_03 end'); console.info('MediaLibraryTest : FETCHRESULT getAllObject 008_03 end');
done(); done();
} }
......
...@@ -270,7 +270,6 @@ export default function fetchFileResultPromiseTest(abilityContext){ ...@@ -270,7 +270,6 @@ export default function fetchFileResultPromiseTest(abilityContext){
let targetObject = await fetchFileResult.getPositionObject(0); let targetObject = await fetchFileResult.getPositionObject(0);
expect(false).assertTrue(); expect(false).assertTrue();
console.info('MediaLibraryTest : FETCHRESULT close getPositionObject 003 failed'); console.info('MediaLibraryTest : FETCHRESULT close getPositionObject 003 failed');
s
done(); done();
} catch { } catch {
console.info('MediaLibraryTest : FETCHRESULT close 003 closed'); console.info('MediaLibraryTest : FETCHRESULT close 003 closed');
......
...@@ -204,76 +204,6 @@ export default function fileAssetCallBack2Test(abilityContext){ ...@@ -204,76 +204,6 @@ export default function fileAssetCallBack2Test(abilityContext){
} }
}); });
/**
* @tc.number : SUB_MEDIA_FILEASSET_commitModify_callback_005
* @tc.name : commitModify
* @tc.desc : Modify uri
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_FILEASSET_commitModify_callback_005', 0, async function (done) {
try {
const fetchFileResult = await media.getFileAssets(imagesfetchOp);
const asset = await fetchFileResult.getFirstObject();
const id = asset.id;
const newUri = 'newUri';
asset.uri = newUri;
asset.commitModify(async (err) => {
if (err) {
expect(true).assertTrue();
done();
} else {
console.info('FileAsset commitModify 005 failed');
expect(false).assertTrue();
done();
}
});
} catch (error) {
console.info('FileAsset commitModify 005 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_FILEASSET_commitModify_callback_006
* @tc.name : commitModify
* @tc.desc : Modify mediaType
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_FILEASSET_commitModify_callback_006', 0, async function (done) {
try {
const fetchFileResult = await media.getFileAssets(imagesfetchOp);
const asset = await fetchFileResult.getFirstObject();
const id = asset.id;
const newMediaType = 'newMediaType';
asset.mediaType = newMediaType;
asset.commitModify(async (err) => {
if (err) {
expect(true).assertTrue();
done();
} else {
console.info('FileAsset commitModify 006 failed');
expect(false).assertTrue();
done();
}
});
} catch (error) {
console.info('FileAsset commitModify 006 passed');
expect(true).assertTrue();
done();
}
});
/** /**
* @tc.number : SUB_MEDIA_FILEASSET_isDirectory_callback_001 * @tc.number : SUB_MEDIA_FILEASSET_isDirectory_callback_001
* @tc.name : isDirectory * @tc.name : isDirectory
......
...@@ -206,64 +206,6 @@ export default function fileAssetPromise2Test(abilityContext){ ...@@ -206,64 +206,6 @@ export default function fileAssetPromise2Test(abilityContext){
} }
}); });
/**
* @tc.number : SUB_MEDIA_FILEASSET_commitModify_promise_005
* @tc.name : commitModify
* @tc.desc : Modify uri
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_FILEASSET_commitModify_promise_005', 0, async function (done) {
try {
const fetchFileResult = await media.getFileAssets(imagesfetchOp);
const asset = await fetchFileResult.getFirstObject();
const id = asset.id;
const newUri = 'newUri';
asset.uri = newUri;
await asset.commitModify();
console.info('FileAsset commitModify 005 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('FileAsset commitModify 005 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_FILEASSET_commitModify_promise_006
* @tc.name : commitModify
* @tc.desc : Modify mediaType
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_FILEASSET_commitModify_promise_006', 0, async function (done) {
try {
const fetchFileResult = await media.getFileAssets(imagesfetchOp);
const asset = await fetchFileResult.getFirstObject();
const id = asset.id;
const newMediaType = 'newMediaType';
asset.mediaType = newMediaType;
await asset.commitModify();
console.info('FileAsset commitModify 006 failed');
expect(false).assertTrue();
done();
} catch (error) {
console.info('FileAsset commitModify 006 passed');
expect(true).assertTrue();
done();
}
});
/** /**
* @tc.number : SUB_MEDIA_FILEASSET_isDirectory_promise_001 * @tc.number : SUB_MEDIA_FILEASSET_isDirectory_promise_001
* @tc.name : isDirectory * @tc.name : isDirectory
......
...@@ -180,6 +180,9 @@ export default function fileAssetTestCallbackTest(abilityContext){ ...@@ -180,6 +180,9 @@ export default function fileAssetTestCallbackTest(abilityContext){
let asset1; let asset1;
let fd; let fd;
let fd1; let fd1;
let assetProps = {
write: 4096,
}
try { try {
let type = mediaLibrary.MediaType.FILE; let type = mediaLibrary.MediaType.FILE;
let fetchOp = { let fetchOp = {
...@@ -238,113 +241,6 @@ export default function fileAssetTestCallbackTest(abilityContext){ ...@@ -238,113 +241,6 @@ export default function fileAssetTestCallbackTest(abilityContext){
//======================== FILE END ================================== //======================== FILE END ==================================
//======================== ALBUM BEGIN ==================================
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_04
* @tc.name : open('rw')
* @tc.desc : open -rw the type of ALBUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_04', 0, async function (done) {
let asset;
let fd;
try {
let type = mediaLibrary.MediaType.ALBUM;
let fetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selectionArgs: [type.toString()],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
const dataList = await fetchFileResult.getAllObject();
asset = dataList[0];
asset.open('rw', async (error, fd) => {
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_04 error:'
+ error);
expect(true).assertTrue();
if (isNum(fd)) {
asset.close(fd);
}
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_05
* @tc.name : open('r')
* @tc.desc : open -r the type of ALBUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_05', 0, async function (done) {
let asset;
let fd;
try {
let type = mediaLibrary.MediaType.ALBUM;
let fetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selectionArgs: [type.toString()],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
const dataList = await fetchFileResult.getAllObject();
asset = dataList[0];
asset.open('r', async (error, fd) => {
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_05 error:'
+ error);
expect(true).assertTrue();
if (isNum(fd)) {
asset.close(fd);
}
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_06
* @tc.name : open('w')
* @tc.desc : open -w the type of ALBUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_06', 0, async function (done) {
let asset;
let fd;
try {
let type = mediaLibrary.MediaType.ALBUM;
let fetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selectionArgs: [type.toString()],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
const dataList = await fetchFileResult.getAllObject();
asset = dataList[0];
asset.open('w', (error, fd) => {
expect(false).assertTrue();
});
} catch (error) {
console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_06 error:'
+ error);
expect(true).assertTrue();
if (isNum(fd)) {
asset.close(fd);
}
done();
}
});
//======================== ALBUM END ==================================
//======================== IMAGE BEGIN ================================== //======================== IMAGE BEGIN ==================================
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_07 * @tc.number : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_07
...@@ -700,6 +596,9 @@ export default function fileAssetTestCallbackTest(abilityContext){ ...@@ -700,6 +596,9 @@ export default function fileAssetTestCallbackTest(abilityContext){
let asset1; let asset1;
let fd; let fd;
let fd1; let fd1;
let assetProps = {
write: 4096,
}
try { try {
let type = mediaLibrary.MediaType.AUDIO; let type = mediaLibrary.MediaType.AUDIO;
let fetchOp = { let fetchOp = {
...@@ -915,6 +814,9 @@ export default function fileAssetTestCallbackTest(abilityContext){ ...@@ -915,6 +814,9 @@ export default function fileAssetTestCallbackTest(abilityContext){
let asset1; let asset1;
let fd; let fd;
let fd1; let fd1;
let assetProps = {
write: 4096,
}
try { try {
let type = mediaLibrary.MediaType.VIDEO; let type = mediaLibrary.MediaType.VIDEO;
let fetchOp = { let fetchOp = {
......
...@@ -186,106 +186,6 @@ export default function fileAssetTestPromiseTest(abilityContext){ ...@@ -186,106 +186,6 @@ export default function fileAssetTestPromiseTest(abilityContext){
//======================== FILE END ================================== //======================== FILE END ==================================
//======================== ALBUM BEGIN ==================================
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_04
* @tc.name : open('rw')
* @tc.desc : open -rw the type of ALBUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_04', 0, async function (done) {
let asset;
let fd;
try {
let type = mediaLibrary.MediaType.ALBUM;
let fetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selectionArgs: [type.toString()],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
const dataList = await fetchFileResult.getAllObject();
asset = dataList[0];
fd = await asset.open('rw');
done();
} catch (error) {
console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_03 error:' + error);
expect(true).assertTrue();
if (isNum(fd)) {
asset.close(fd);
}
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_05
* @tc.name : open('r')
* @tc.desc : open -r the type of ALBUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_05', 0, async function (done) {
let asset;
let fd;
try {
let type = mediaLibrary.MediaType.ALBUM;
let fetchOp = {
selections: fileKeyObj.MEDIA_TYPE + '= ?',
selectionArgs: [type.toString()],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
const dataList = await fetchFileResult.getAllObject();
asset = dataList[0];
fd = await asset.open('r');
done();
} catch (error) {
console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_05 error:' + error);
expect(true).assertTrue();
if (isNum(fd)) {
asset.close(fd);
}
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_05
* @tc.name : open('w')
* @tc.desc : open -w the type of ALBUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it('SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_06', 0, async function (done) {
let asset;
let fd;
try {
let type = mediaLibrary.MediaType.IMAGE;
let fetchOp = {
selections: fileKeyObj.RELATIVE_PATH + '= ? AND ' + fileKeyObj.MEDIA_TYPE + '= ?',
selectionArgs: ['Pictures/Dynamic02/', type.toString()],
};
let fetchFileResult = await media.getFileAssets(fetchOp);
const dataList = await fetchFileResult.getAllObject();
asset = dataList[0];
fd = await asset.open('w');
done();
} catch (error) {
console.info('MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_06 error:' + error);
expect(true).assertTrue();
if (isNum(fd)) {
asset.close(fd);
}
done();
}
});
//======================== ALBUM END ==================================
//======================== IMAGE BEGIN ================================== //======================== IMAGE BEGIN ==================================
/** /**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_07 * @tc.number : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_07
......
...@@ -17,13 +17,6 @@ import featureAbility from '@ohos.ability.featureAbility'; ...@@ -17,13 +17,6 @@ import featureAbility from '@ohos.ability.featureAbility';
import fileio from '@ohos.fileio'; import fileio from '@ohos.fileio';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
let fileKeyObj = mediaLibrary.FileKey; let fileKeyObj = mediaLibrary.FileKey;
let fetchOp = {
selections: fileKeyObj.PATH + ' LIKE ? ',
selectionArgs: ['/data/media/%'],
order: fileKeyObj.PATH,
};
// let directoryTypeObj = mediaLibrary.DirectoryType;
let DIR_CAMERA = mediaLibrary.DirectoryType.DIR_CAMERA; let DIR_CAMERA = mediaLibrary.DirectoryType.DIR_CAMERA;
let DIR_VIDEO = mediaLibrary.DirectoryType.DIR_VIDEO; let DIR_VIDEO = mediaLibrary.DirectoryType.DIR_VIDEO;
let DIR_IMAGE = mediaLibrary.DirectoryType.DIR_IMAGE; let DIR_IMAGE = mediaLibrary.DirectoryType.DIR_IMAGE;
...@@ -227,7 +220,7 @@ export default function mediaLibraryTestCallBackTest(abilityContext){ ...@@ -227,7 +220,7 @@ export default function mediaLibraryTestCallBackTest(abilityContext){
media.getFileAssets(imageRelativefetchOp, async (err, fetchFileResult) => { media.getFileAssets(imageRelativefetchOp, async (err, fetchFileResult) => {
let count = 1; let count = 1;
let type = 'image'; let type = 'image';
await checkFileAssetAttr(done, fetchFileResult, type, count) await checkFileAssetAttr(done, fetchFileResult, type, count, null)
done(); done();
}); });
} catch (error) { } catch (error) {
...@@ -250,7 +243,7 @@ export default function mediaLibraryTestCallBackTest(abilityContext){ ...@@ -250,7 +243,7 @@ export default function mediaLibraryTestCallBackTest(abilityContext){
media.getFileAssets(videoRelativefetchOp, async (err, fetchFileResult) => { media.getFileAssets(videoRelativefetchOp, async (err, fetchFileResult) => {
let count = 1; let count = 1;
let type = 'video'; let type = 'video';
await checkFileAssetAttr(done, fetchFileResult, type, count) await checkFileAssetAttr(done, fetchFileResult, type, count, null)
done(); done();
}); });
} catch (error) { } catch (error) {
...@@ -273,7 +266,7 @@ export default function mediaLibraryTestCallBackTest(abilityContext){ ...@@ -273,7 +266,7 @@ export default function mediaLibraryTestCallBackTest(abilityContext){
media.getFileAssets(audioRelativefetchOp, async (err, fetchFileResult) => { media.getFileAssets(audioRelativefetchOp, async (err, fetchFileResult) => {
let count = 1; let count = 1;
let type = 'audio'; let type = 'audio';
await checkFileAssetAttr(done, fetchFileResult, type, count) await checkFileAssetAttr(done, fetchFileResult, type, count, null)
done(); done();
}); });
} catch (error) { } catch (error) {
...@@ -296,7 +289,7 @@ export default function mediaLibraryTestCallBackTest(abilityContext){ ...@@ -296,7 +289,7 @@ export default function mediaLibraryTestCallBackTest(abilityContext){
media.getFileAssets(fileRelativefetchOp, async (err, fetchFileResult) => { media.getFileAssets(fileRelativefetchOp, async (err, fetchFileResult) => {
let count = 1; let count = 1;
let type = 'file'; let type = 'file';
await checkFileAssetAttr(done, fetchFileResult, type, count) await checkFileAssetAttr(done, fetchFileResult, type, count, null)
done(); done();
}); });
} catch (error) { } catch (error) {
......
...@@ -17,13 +17,6 @@ import featureAbility from '@ohos.ability.featureAbility'; ...@@ -17,13 +17,6 @@ import featureAbility from '@ohos.ability.featureAbility';
import fileio from '@ohos.fileio'; import fileio from '@ohos.fileio';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index'; import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'deccjsunit/index';
let fileKeyObj = mediaLibrary.FileKey; let fileKeyObj = mediaLibrary.FileKey;
let fetchOp = {
selections: fileKeyObj.PATH + ' LIKE ? ',
selectionArgs: ['/data/media/%'],
order: fileKeyObj.PATH,
};
// let directoryTypeObj = mediaLibrary.DirectoryType;
let DIR_CAMERA = mediaLibrary.DirectoryType.DIR_CAMERA; let DIR_CAMERA = mediaLibrary.DirectoryType.DIR_CAMERA;
let DIR_VIDEO = mediaLibrary.DirectoryType.DIR_VIDEO; let DIR_VIDEO = mediaLibrary.DirectoryType.DIR_VIDEO;
let DIR_IMAGE = mediaLibrary.DirectoryType.DIR_IMAGE; let DIR_IMAGE = mediaLibrary.DirectoryType.DIR_IMAGE;
...@@ -248,7 +241,7 @@ export default function mediaLibraryTestPromiseTest(abilityContext){ ...@@ -248,7 +241,7 @@ export default function mediaLibraryTestPromiseTest(abilityContext){
const fetchFileResult = await media.getFileAssets(imageRelativefetchOp); const fetchFileResult = await media.getFileAssets(imageRelativefetchOp);
let count = 1; let count = 1;
let type = 'image'; let type = 'image';
await checkFileAssetAttr(done, fetchFileResult, type, count) await checkFileAssetAttr(done, fetchFileResult, type, count, null)
done(); done();
} catch (error) { } catch (error) {
console.info(`MediaLibraryTest : getFileAssets 001 failed, error: ${error}`); console.info(`MediaLibraryTest : getFileAssets 001 failed, error: ${error}`);
...@@ -270,7 +263,7 @@ export default function mediaLibraryTestPromiseTest(abilityContext){ ...@@ -270,7 +263,7 @@ export default function mediaLibraryTestPromiseTest(abilityContext){
const fetchFileResult = await media.getFileAssets(videoRelativefetchOp); const fetchFileResult = await media.getFileAssets(videoRelativefetchOp);
let count = 1; let count = 1;
let type = 'video'; let type = 'video';
await checkFileAssetAttr(done, fetchFileResult, type, count) await checkFileAssetAttr(done, fetchFileResult, type, count, null)
done(); done();
} catch (error) { } catch (error) {
console.info(`MediaLibraryTest : getFileAssets 002 failed, error: ${error}`); console.info(`MediaLibraryTest : getFileAssets 002 failed, error: ${error}`);
...@@ -292,7 +285,7 @@ export default function mediaLibraryTestPromiseTest(abilityContext){ ...@@ -292,7 +285,7 @@ export default function mediaLibraryTestPromiseTest(abilityContext){
const fetchFileResult = await media.getFileAssets(audioRelativefetchOp); const fetchFileResult = await media.getFileAssets(audioRelativefetchOp);
let count = 1; let count = 1;
let type = 'audio'; let type = 'audio';
await checkFileAssetAttr(done, fetchFileResult, type, count) await checkFileAssetAttr(done, fetchFileResult, type, count, null)
done(); done();
} catch (error) { } catch (error) {
console.info(`MediaLibraryTest : getFileAssets 003 failed, error: ${error}`); console.info(`MediaLibraryTest : getFileAssets 003 failed, error: ${error}`);
...@@ -314,7 +307,7 @@ export default function mediaLibraryTestPromiseTest(abilityContext){ ...@@ -314,7 +307,7 @@ export default function mediaLibraryTestPromiseTest(abilityContext){
const fetchFileResult = await media.getFileAssets(fileRelativefetchOp); const fetchFileResult = await media.getFileAssets(fileRelativefetchOp);
let count = 1; let count = 1;
let type = 'file'; let type = 'file';
await checkFileAssetAttr(done, fetchFileResult, type, count) await checkFileAssetAttr(done, fetchFileResult, type, count, null)
done(); done();
} catch (error) { } catch (error) {
console.info(`MediaLibraryTest : getFileAssets 004 failed, error: ${error}`); console.info(`MediaLibraryTest : getFileAssets 004 failed, error: ${error}`);
......
...@@ -70,7 +70,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -70,7 +70,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
await asset.commitModify(); await asset.commitModify();
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 1000) }, 1000)
}) })
expect(conut > 0).assertTrue(); expect(conut > 0).assertTrue();
...@@ -104,7 +104,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -104,7 +104,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
await asset.commitModify(); await asset.commitModify();
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 1000) }, 1000)
}) })
expect(conut > 0).assertTrue(); expect(conut > 0).assertTrue();
...@@ -138,7 +138,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -138,7 +138,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
await asset.commitModify(); await asset.commitModify();
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 1000) }, 1000)
}) })
expect(conut > 0).assertTrue(); expect(conut > 0).assertTrue();
...@@ -172,7 +172,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -172,7 +172,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
await asset.commitModify(); await asset.commitModify();
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 1000) }, 1000)
}) })
expect(conut > 0).assertTrue(); expect(conut > 0).assertTrue();
...@@ -206,7 +206,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -206,7 +206,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
await asset.commitModify(); await asset.commitModify();
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 1000) }, 1000)
}) })
expect(conut == 0).assertTrue(); expect(conut == 0).assertTrue();
...@@ -242,7 +242,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -242,7 +242,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
await asset.commitModify(); await asset.commitModify();
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 1000) }, 1000)
}) })
expect(conut == 0).assertTrue(); expect(conut == 0).assertTrue();
...@@ -278,7 +278,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -278,7 +278,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
await asset.commitModify(); await asset.commitModify();
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 1000) }, 1000)
}) })
expect(conut == 0).assertTrue(); expect(conut == 0).assertTrue();
...@@ -309,7 +309,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -309,7 +309,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
}); });
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 300) }, 300)
}) })
const fetchFileResult = await media.getFileAssets(imagesfetchOp); const fetchFileResult = await media.getFileAssets(imagesfetchOp);
...@@ -318,13 +318,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -318,13 +318,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
media.off('imageChange'); media.off('imageChange');
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 600) }, 600)
}) })
await asset.commitModify(); await asset.commitModify();
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 1000) }, 1000)
}) })
console.info('MediaLibraryTest : off 001 passed'); console.info('MediaLibraryTest : off 001 passed');
...@@ -356,7 +356,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -356,7 +356,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
}); });
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 300) }, 300)
}) })
const fetchFileResult = await media.getFileAssets(videosfetchOp); const fetchFileResult = await media.getFileAssets(videosfetchOp);
...@@ -365,13 +365,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -365,13 +365,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
media.off('videoChange'); media.off('videoChange');
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 600) }, 600)
}) })
await asset.commitModify(); await asset.commitModify();
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 1000) }, 1000)
}) })
console.info('MediaLibraryTest : off 002 passed'); console.info('MediaLibraryTest : off 002 passed');
...@@ -403,7 +403,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -403,7 +403,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
}); });
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 300) }, 300)
}) })
const fetchFileResult = await media.getFileAssets(audiosfetchOp); const fetchFileResult = await media.getFileAssets(audiosfetchOp);
...@@ -412,13 +412,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -412,13 +412,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
media.off('audioChange'); media.off('audioChange');
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 600) }, 600)
}) })
await asset.commitModify(); await asset.commitModify();
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 1000) }, 1000)
}) })
console.info('MediaLibraryTest : off 003 passed'); console.info('MediaLibraryTest : off 003 passed');
...@@ -450,7 +450,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -450,7 +450,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
}); });
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 300) }, 300)
}) })
const fetchFileResult = await media.getFileAssets(videosfetchOp); const fetchFileResult = await media.getFileAssets(videosfetchOp);
...@@ -459,13 +459,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -459,13 +459,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
media.off('fileChange'); media.off('fileChange');
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 600) }, 600)
}) })
await asset.commitModify(); await asset.commitModify();
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 1000) }, 1000)
}) })
console.info('MediaLibraryTest : off 004 passed'); console.info('MediaLibraryTest : off 004 passed');
...@@ -497,7 +497,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -497,7 +497,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
}); });
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 300) }, 300)
}) })
const fetchFileResult = await media.getFileAssets(videosfetchOp); const fetchFileResult = await media.getFileAssets(videosfetchOp);
...@@ -506,13 +506,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -506,13 +506,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
media.off('albumChange'); media.off('albumChange');
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 600) }, 600)
}) })
await asset.commitModify(); await asset.commitModify();
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 1000) }, 1000)
}) })
console.info('MediaLibraryTest : off 005 passed'); console.info('MediaLibraryTest : off 005 passed');
...@@ -544,7 +544,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -544,7 +544,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
}); });
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 300) }, 300)
}) })
const fetchFileResult = await media.getFileAssets(videosfetchOp); const fetchFileResult = await media.getFileAssets(videosfetchOp);
...@@ -553,13 +553,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -553,13 +553,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
media.off('deviceChange'); media.off('deviceChange');
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 600) }, 600)
}) })
await asset.commitModify(); await asset.commitModify();
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 1000) }, 1000)
}) })
console.info('MediaLibraryTest : off 006 passed'); console.info('MediaLibraryTest : off 006 passed');
...@@ -591,7 +591,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -591,7 +591,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
}); });
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 300) }, 300)
}) })
...@@ -601,13 +601,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){ ...@@ -601,13 +601,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
asset.title = asset.title + 'remoteFileChange'; asset.title = asset.title + 'remoteFileChange';
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 600) }, 600)
}) })
await asset.commitModify(); await asset.commitModify();
await new Promise(res => { await new Promise(res => {
setTimeout(() => { setTimeout(() => {
res() res(true)
}, 1000) }, 1000)
}) })
console.info('MediaLibraryTest : off 007 passed'); console.info('MediaLibraryTest : off 007 passed');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册