未验证 提交 4ca18047 编写于 作者: O openharmony_ci 提交者: Gitee

!4233 Fix build ERRORs

Merge pull request !4233 from 张代曰/build_errors
...@@ -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 -------------------------
}); });
} }
......
...@@ -381,7 +381,8 @@ export default function fetchFileResultCallBackTest(abilityContext) { ...@@ -381,7 +381,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();
} }
...@@ -412,7 +413,8 @@ export default function fetchFileResultCallBackTest(abilityContext) { ...@@ -412,7 +413,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');
...@@ -445,7 +447,8 @@ export default function fetchFileResultCallBackTest(abilityContext) { ...@@ -445,7 +447,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();
} }
...@@ -591,4 +594,4 @@ export default function fetchFileResultCallBackTest(abilityContext) { ...@@ -591,4 +594,4 @@ export default function fetchFileResultCallBackTest(abilityContext) {
} }
}); });
}); });
} }
\ No newline at end of file
...@@ -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.
先完成此消息的编辑!
想要评论请 注册