Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
4ca18047
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
大约 1 年 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
4ca18047
编写于
7月 11, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 11, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4233 Fix build ERRORs
Merge pull request !4233 from 张代曰/build_errors
上级
aeeb3cbe
89e153e3
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
57 addition
and
2022 deletion
+57
-2022
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/albumTestCallBack.test.ets
...andard/entry/src/main/ets/test/albumTestCallBack.test.ets
+2
-266
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/albumTestPromise.test.ets
...tandard/entry/src/main/ets/test/albumTestPromise.test.ets
+2
-225
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/favoriteTestCallBack.test.ets
...ard/entry/src/main/ets/test/favoriteTestCallBack.test.ets
+0
-660
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/favoriteTestPromise.test.ets
...dard/entry/src/main/ets/test/favoriteTestPromise.test.ets
+1
-481
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/fetchFileResultCallBack.test.ets
.../entry/src/main/ets/test/fetchFileResultCallBack.test.ets
+7
-4
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/fetchFileResultPromise.test.ets
...d/entry/src/main/ets/test/fetchFileResultPromise.test.ets
+0
-1
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/fileAssetCallBack2.test.ets
...ndard/entry/src/main/ets/test/fileAssetCallBack2.test.ets
+0
-70
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/fileAssetPromise2.test.ets
...andard/entry/src/main/ets/test/fileAssetPromise2.test.ets
+0
-58
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/fileAssetTestCallback.test.ets
...rd/entry/src/main/ets/test/fileAssetTestCallback.test.ets
+9
-107
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/fileAssetTestPromise.test.ets
...ard/entry/src/main/ets/test/fileAssetTestPromise.test.ets
+0
-100
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/mediaLibraryTestCallBack.test.ets
...entry/src/main/ets/test/mediaLibraryTestCallBack.test.ets
+4
-11
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/mediaLibraryTestPromise.test.ets
.../entry/src/main/ets/test/mediaLibraryTestPromise.test.ets
+4
-11
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/mediaLibraryTestPromiseOnOff.test.ets
...y/src/main/ets/test/mediaLibraryTestPromiseOnOff.test.ets
+28
-28
未找到文件。
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/albumTestCallBack.test.ets
浏览文件 @
4ca18047
...
...
@@ -354,147 +354,6 @@ export default function albumTestCallBackTest(abilityContext){
// ------------------------------ 001 test end -------------------------
// ------------------------------ 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.name : album.getFileAssets
...
...
@@ -685,9 +544,9 @@ export default function albumTestCallBackTest(abilityContext){
const albumId = album.albumId;
console.info('ALBUM_CALLBACK Modify 003_03 album.albumName(old) = ' + album.albumName);
let newName =
true
;
let newName =
""
;
for (var i = 0; i < 1200; i++) {
newName +=
'i'
;
newName +=
i.toString()
;
}
album.albumName = newName;
...
...
@@ -712,83 +571,6 @@ export default function albumTestCallBackTest(abilityContext){
}
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 -------------------------
// ------------------------------ 004 test start -------------------------
...
...
@@ -835,52 +617,6 @@ export default function albumTestCallBackTest(abilityContext){
}
});
// ------------------------------ 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 -------------------------
});
}
...
...
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/albumTestPromise.test.ets
浏览文件 @
4ca18047
...
...
@@ -313,111 +313,6 @@ export default function albumTestPromiseTest(abilityContext){
// ------------------------------ 001 test end -------------------------
// ------------------------------ 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.name : album.getFileAssets
...
...
@@ -581,9 +476,9 @@ export default function albumTestPromiseTest(abilityContext){
const albumId = album.albumId;
console.info('ALBUM_PROMISE Modify 003_04 album.albumName(old) = ' + album.albumName);
let newName =
true
;
let newName =
""
;
for (var i = 0; i < 1200; i++) {
newName +=
'i'
;
newName +=
i.toString()
;
}
album.albumName = newName;
...
...
@@ -603,76 +498,6 @@ export default function albumTestPromiseTest(abilityContext){
}
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 -------------------------
// ------------------------------ 004 test start -------------------------
...
...
@@ -713,54 +538,6 @@ export default function albumTestPromiseTest(abilityContext){
}
});
// ------------------------------ 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 -------------------------
});
}
...
...
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/favoriteTestCallBack.test.ets
浏览文件 @
4ca18047
...
...
@@ -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.name : isFavorite
...
...
@@ -542,171 +377,6 @@ export default function favoriteTestCallBackTest(abilityContext) {
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_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_CALLBACK_002_03', 0, async function (done) {
try {
media.getFileAssets(imageFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
try {
asset.favorite('true', () => {
console.info('FAV_ASSET_CALLBACK 002_03 fail');
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 002_03 passed');
expect(true).assertTrue();
done();
}
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 002_03 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_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_CALLBACK_002_04', 0, async function (done) {
try {
media.getFileAssets(imageFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
try {
asset.favorite('false', () => {
console.info('FAV_ASSET_CALLBACK 002_04 fail');
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 002_04 passed');
expect(true).assertTrue();
done();
}
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 002_04 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_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_CALLBACK_002_05', 0, async function (done) {
try {
media.getFileAssets(imageFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
try {
asset.favorite('fav', () => {
console.info('FAV_ASSET_CALLBACK 002_05 fail');
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 002_05 passed');
expect(true).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) {
console.info('FAV_ASSET_CALLBACK 002_06 passed');
expect(true).assertTrue();
done();
}
});
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 002_06 passed');
expect(true).assertTrue();
done();
}
});
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_FAV_ASSET_CALLBACK_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_CALLBACK_002_07', 0, async function (done) {
try {
media.getFileAssets(imageFetchOp, (error, fileAssets) => {
fileAssets.getAllObject((error, dataList) => {
const asset = dataList[0];
try {
asset.favorite(() => {
console.info('FAV_ASSET_CALLBACK 002_07 fail');
expect(false).assertTrue();
done();
});
} catch (error) {
console.info('FAV_ASSET_CALLBACK 002_07 passed');
expect(true).assertTrue();
done();
}
});
});
} 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
...
...
@@ -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.name : isFavorite
...
...
@@ -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.name : isFavorite
...
...
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/favoriteTestPromise.test.ets
浏览文件 @
4ca18047
...
...
@@ -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.name : isFavorite
...
...
@@ -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.name : isFavorite
...
...
@@ -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.name : isFavorite
...
...
@@ -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.name : isFavorite
...
...
@@ -1115,4 +635,4 @@ export default function favoriteTestPromiseTest(abilityContext) {
});
// ------------------------------ audio type end ------------------------
});
}
\ No newline at end of file
}
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/fetchFileResultCallBack.test.ets
浏览文件 @
4ca18047
...
...
@@ -381,7 +381,8 @@ export default function fetchFileResultCallBackTest(abilityContext) {
console.info('MediaLibraryTest : FETCHRESULT getNextObject 008_01 fail');
done();
} 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');
done();
}
...
...
@@ -412,7 +413,8 @@ export default function fetchFileResultCallBackTest(abilityContext) {
console.info('MediaLibraryTest : FETCHRESULT getNextObject 008_01 fail');
done();
} 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:'
+ targetObjects.length);
console.info('MediaLibraryTest : FETCHRESULT getAllObject 008_02 end');
...
...
@@ -445,7 +447,8 @@ export default function fetchFileResultCallBackTest(abilityContext) {
console.info('MediaLibraryTest : FETCHRESULT getNextObject 008_03 fail');
done();
} 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');
done();
}
...
...
@@ -591,4 +594,4 @@ export default function fetchFileResultCallBackTest(abilityContext) {
}
});
});
}
\ No newline at end of file
}
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/fetchFileResultPromise.test.ets
浏览文件 @
4ca18047
...
...
@@ -270,7 +270,6 @@ export default function fetchFileResultPromiseTest(abilityContext){
let targetObject = await fetchFileResult.getPositionObject(0);
expect(false).assertTrue();
console.info('MediaLibraryTest : FETCHRESULT close getPositionObject 003 failed');
s
done();
} catch {
console.info('MediaLibraryTest : FETCHRESULT close 003 closed');
...
...
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/fileAssetCallBack2.test.ets
浏览文件 @
4ca18047
...
...
@@ -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.name : isDirectory
...
...
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/fileAssetPromise2.test.ets
浏览文件 @
4ca18047
...
...
@@ -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.name : isDirectory
...
...
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/fileAssetTestCallback.test.ets
浏览文件 @
4ca18047
...
...
@@ -180,6 +180,9 @@ export default function fileAssetTestCallbackTest(abilityContext){
let asset1;
let fd;
let fd1;
let assetProps = {
write: 4096,
}
try {
let type = mediaLibrary.MediaType.FILE;
let fetchOp = {
...
...
@@ -238,113 +241,6 @@ export default function fileAssetTestCallbackTest(abilityContext){
//======================== 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 ==================================
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_07
...
...
@@ -700,6 +596,9 @@ export default function fileAssetTestCallbackTest(abilityContext){
let asset1;
let fd;
let fd1;
let assetProps = {
write: 4096,
}
try {
let type = mediaLibrary.MediaType.AUDIO;
let fetchOp = {
...
...
@@ -915,6 +814,9 @@ export default function fileAssetTestCallbackTest(abilityContext){
let asset1;
let fd;
let fd1;
let assetProps = {
write: 4096,
}
try {
let type = mediaLibrary.MediaType.VIDEO;
let fetchOp = {
...
...
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/fileAssetTestPromise.test.ets
浏览文件 @
4ca18047
...
...
@@ -186,106 +186,6 @@ export default function fileAssetTestPromiseTest(abilityContext){
//======================== 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 ==================================
/**
* @tc.number : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_PROMISE_005_07
...
...
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/mediaLibraryTestCallBack.test.ets
浏览文件 @
4ca18047
...
...
@@ -17,13 +17,6 @@ import featureAbility from '@ohos.ability.featureAbility';
import
fileio
from
'@ohos.fileio'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'deccjsunit/index'
;
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_VIDEO
=
mediaLibrary
.
DirectoryType
.
DIR_VIDEO
;
let
DIR_IMAGE
=
mediaLibrary
.
DirectoryType
.
DIR_IMAGE
;
...
...
@@ -227,7 +220,7 @@ export default function mediaLibraryTestCallBackTest(abilityContext){
media
.
getFileAssets
(
imageRelativefetchOp
,
async
(
err
,
fetchFileResult
)
=>
{
let
count
=
1
;
let
type
=
'image'
;
await
checkFileAssetAttr
(
done
,
fetchFileResult
,
type
,
count
)
await
checkFileAssetAttr
(
done
,
fetchFileResult
,
type
,
count
,
null
)
done
();
});
}
catch
(
error
)
{
...
...
@@ -250,7 +243,7 @@ export default function mediaLibraryTestCallBackTest(abilityContext){
media
.
getFileAssets
(
videoRelativefetchOp
,
async
(
err
,
fetchFileResult
)
=>
{
let
count
=
1
;
let
type
=
'video'
;
await
checkFileAssetAttr
(
done
,
fetchFileResult
,
type
,
count
)
await
checkFileAssetAttr
(
done
,
fetchFileResult
,
type
,
count
,
null
)
done
();
});
}
catch
(
error
)
{
...
...
@@ -273,7 +266,7 @@ export default function mediaLibraryTestCallBackTest(abilityContext){
media
.
getFileAssets
(
audioRelativefetchOp
,
async
(
err
,
fetchFileResult
)
=>
{
let
count
=
1
;
let
type
=
'audio'
;
await
checkFileAssetAttr
(
done
,
fetchFileResult
,
type
,
count
)
await
checkFileAssetAttr
(
done
,
fetchFileResult
,
type
,
count
,
null
)
done
();
});
}
catch
(
error
)
{
...
...
@@ -296,7 +289,7 @@ export default function mediaLibraryTestCallBackTest(abilityContext){
media
.
getFileAssets
(
fileRelativefetchOp
,
async
(
err
,
fetchFileResult
)
=>
{
let
count
=
1
;
let
type
=
'file'
;
await
checkFileAssetAttr
(
done
,
fetchFileResult
,
type
,
count
)
await
checkFileAssetAttr
(
done
,
fetchFileResult
,
type
,
count
,
null
)
done
();
});
}
catch
(
error
)
{
...
...
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/mediaLibraryTestPromise.test.ets
浏览文件 @
4ca18047
...
...
@@ -17,13 +17,6 @@ import featureAbility from '@ohos.ability.featureAbility';
import
fileio
from
'@ohos.fileio'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'deccjsunit/index'
;
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_VIDEO
=
mediaLibrary
.
DirectoryType
.
DIR_VIDEO
;
let
DIR_IMAGE
=
mediaLibrary
.
DirectoryType
.
DIR_IMAGE
;
...
...
@@ -248,7 +241,7 @@ export default function mediaLibraryTestPromiseTest(abilityContext){
const
fetchFileResult
=
await
media
.
getFileAssets
(
imageRelativefetchOp
);
let
count
=
1
;
let
type
=
'image'
;
await
checkFileAssetAttr
(
done
,
fetchFileResult
,
type
,
count
)
await
checkFileAssetAttr
(
done
,
fetchFileResult
,
type
,
count
,
null
)
done
();
}
catch
(
error
)
{
console
.
info
(
`MediaLibraryTest : getFileAssets 001 failed, error: ${error}`
);
...
...
@@ -270,7 +263,7 @@ export default function mediaLibraryTestPromiseTest(abilityContext){
const
fetchFileResult
=
await
media
.
getFileAssets
(
videoRelativefetchOp
);
let
count
=
1
;
let
type
=
'video'
;
await
checkFileAssetAttr
(
done
,
fetchFileResult
,
type
,
count
)
await
checkFileAssetAttr
(
done
,
fetchFileResult
,
type
,
count
,
null
)
done
();
}
catch
(
error
)
{
console
.
info
(
`MediaLibraryTest : getFileAssets 002 failed, error: ${error}`
);
...
...
@@ -292,7 +285,7 @@ export default function mediaLibraryTestPromiseTest(abilityContext){
const
fetchFileResult
=
await
media
.
getFileAssets
(
audioRelativefetchOp
);
let
count
=
1
;
let
type
=
'audio'
;
await
checkFileAssetAttr
(
done
,
fetchFileResult
,
type
,
count
)
await
checkFileAssetAttr
(
done
,
fetchFileResult
,
type
,
count
,
null
)
done
();
}
catch
(
error
)
{
console
.
info
(
`MediaLibraryTest : getFileAssets 003 failed, error: ${error}`
);
...
...
@@ -314,7 +307,7 @@ export default function mediaLibraryTestPromiseTest(abilityContext){
const
fetchFileResult
=
await
media
.
getFileAssets
(
fileRelativefetchOp
);
let
count
=
1
;
let
type
=
'file'
;
await
checkFileAssetAttr
(
done
,
fetchFileResult
,
type
,
count
)
await
checkFileAssetAttr
(
done
,
fetchFileResult
,
type
,
count
,
null
)
done
();
}
catch
(
error
)
{
console
.
info
(
`MediaLibraryTest : getFileAssets 004 failed, error: ${error}`
);
...
...
multimedia/medialibrary/mediaLibrary_js_standard/entry/src/main/ets/test/mediaLibraryTestPromiseOnOff.test.ets
浏览文件 @
4ca18047
...
...
@@ -70,7 +70,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
await asset.commitModify();
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 1000)
})
expect(conut > 0).assertTrue();
...
...
@@ -104,7 +104,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
await asset.commitModify();
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 1000)
})
expect(conut > 0).assertTrue();
...
...
@@ -138,7 +138,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
await asset.commitModify();
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 1000)
})
expect(conut > 0).assertTrue();
...
...
@@ -172,7 +172,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
await asset.commitModify();
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 1000)
})
expect(conut > 0).assertTrue();
...
...
@@ -206,7 +206,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
await asset.commitModify();
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 1000)
})
expect(conut == 0).assertTrue();
...
...
@@ -242,7 +242,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
await asset.commitModify();
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 1000)
})
expect(conut == 0).assertTrue();
...
...
@@ -278,7 +278,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
await asset.commitModify();
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 1000)
})
expect(conut == 0).assertTrue();
...
...
@@ -309,7 +309,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
});
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 300)
})
const fetchFileResult = await media.getFileAssets(imagesfetchOp);
...
...
@@ -318,13 +318,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
media.off('imageChange');
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 600)
})
await asset.commitModify();
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 1000)
})
console.info('MediaLibraryTest : off 001 passed');
...
...
@@ -356,7 +356,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
});
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 300)
})
const fetchFileResult = await media.getFileAssets(videosfetchOp);
...
...
@@ -365,13 +365,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
media.off('videoChange');
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 600)
})
await asset.commitModify();
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 1000)
})
console.info('MediaLibraryTest : off 002 passed');
...
...
@@ -403,7 +403,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
});
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 300)
})
const fetchFileResult = await media.getFileAssets(audiosfetchOp);
...
...
@@ -412,13 +412,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
media.off('audioChange');
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 600)
})
await asset.commitModify();
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 1000)
})
console.info('MediaLibraryTest : off 003 passed');
...
...
@@ -450,7 +450,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
});
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 300)
})
const fetchFileResult = await media.getFileAssets(videosfetchOp);
...
...
@@ -459,13 +459,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
media.off('fileChange');
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 600)
})
await asset.commitModify();
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 1000)
})
console.info('MediaLibraryTest : off 004 passed');
...
...
@@ -497,7 +497,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
});
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 300)
})
const fetchFileResult = await media.getFileAssets(videosfetchOp);
...
...
@@ -506,13 +506,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
media.off('albumChange');
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 600)
})
await asset.commitModify();
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 1000)
})
console.info('MediaLibraryTest : off 005 passed');
...
...
@@ -544,7 +544,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
});
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 300)
})
const fetchFileResult = await media.getFileAssets(videosfetchOp);
...
...
@@ -553,13 +553,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
media.off('deviceChange');
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 600)
})
await asset.commitModify();
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 1000)
})
console.info('MediaLibraryTest : off 006 passed');
...
...
@@ -591,7 +591,7 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
});
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 300)
})
...
...
@@ -601,13 +601,13 @@ export default function mediaLibraryTestPromiseOnOffTest(abilityContext){
asset.title = asset.title + 'remoteFileChange';
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 600)
})
await asset.commitModify();
await new Promise(res => {
setTimeout(() => {
res()
res(
true
)
}, 1000)
})
console.info('MediaLibraryTest : off 007 passed');
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录