Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
0f7b47fa
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
10 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
提交
0f7b47fa
编写于
6月 14, 2022
作者:
L
lxq
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
<liuxueqi3@huawei.com>
Signed-off-by:
N
lxq
<
liuxueqi3@huawei.com
>
上级
1b448192
变更
26
隐藏空白更改
内联
并排
Showing
26 changed file
with
339 addition
and
340 deletion
+339
-340
multimedia/image/image_js_standard/Test.json
multimedia/image/image_js_standard/Test.json
+0
-1
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/FileAssetGetThumbnailCallBack.test.js
...rd/src/main/js/test/FileAssetGetThumbnailCallBack.test.js
+7
-7
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/FileAssetGetThumbnailPromise.test.js
...ard/src/main/js/test/FileAssetGetThumbnailPromise.test.js
+6
-6
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/albumGetFileAssetsCallback.test.js
...ndard/src/main/js/test/albumGetFileAssetsCallback.test.js
+15
-15
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/albumGetFileAssetsPromise.test.js
...andard/src/main/js/test/albumGetFileAssetsPromise.test.js
+14
-14
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/albumTestCallBack.test.js
...ry_js_standard/src/main/js/test/albumTestCallBack.test.js
+14
-14
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/albumTestPromise.test.js
...ary_js_standard/src/main/js/test/albumTestPromise.test.js
+15
-15
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/favoriteTestCallBack.test.js
...js_standard/src/main/js/test/favoriteTestCallBack.test.js
+5
-5
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/favoriteTestPromise.test.js
..._js_standard/src/main/js/test/favoriteTestPromise.test.js
+4
-4
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/favtrashTestCallBack.test.js
...js_standard/src/main/js/test/favtrashTestCallBack.test.js
+1
-1
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fetchFileResultCallBack.test.js
...standard/src/main/js/test/fetchFileResultCallBack.test.js
+29
-29
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fetchFileResultPromise.test.js
..._standard/src/main/js/test/fetchFileResultPromise.test.js
+28
-28
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAsset2.test.js
...iaLibrary_js_standard/src/main/js/test/fileAsset2.test.js
+8
-8
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetCallBack2.test.js
...y_js_standard/src/main/js/test/fileAssetCallBack2.test.js
+21
-21
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetPromise2.test.js
...ry_js_standard/src/main/js/test/fileAssetPromise2.test.js
+8
-8
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetTestCallback.test.js
...s_standard/src/main/js/test/fileAssetTestCallback.test.js
+19
-19
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetTestPromise.test.js
...js_standard/src/main/js/test/fileAssetTestPromise.test.js
+20
-20
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetUriTestCallBack.test.js
...tandard/src/main/js/test/fileAssetUriTestCallBack.test.js
+2
-2
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetUriTestPromiese.test.js
...tandard/src/main/js/test/fileAssetUriTestPromiese.test.js
+3
-3
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileTestCallBack.test.js
...ary_js_standard/src/main/js/test/fileTestCallBack.test.js
+22
-22
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileTestPromise.test.js
...rary_js_standard/src/main/js/test/fileTestPromise.test.js
+23
-23
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/filekeyTestCallBack.test.js
..._js_standard/src/main/js/test/filekeyTestCallBack.test.js
+4
-4
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/filekeyTestPromise.test.js
...y_js_standard/src/main/js/test/filekeyTestPromise.test.js
+5
-5
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/mediaLibraryTestCallBack.test.js
...tandard/src/main/js/test/mediaLibraryTestCallBack.test.js
+23
-23
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/mediaLibraryTestPromise.test.js
...standard/src/main/js/test/mediaLibraryTestPromise.test.js
+38
-38
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/mediaLibraryTestPromiseOnOff.test.js
...ard/src/main/js/test/mediaLibraryTestPromiseOnOff.test.js
+5
-5
未找到文件。
multimedia/image/image_js_standard/Test.json
浏览文件 @
0f7b47fa
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"mkdir /data/accounts/account_0/appdata/image"
,
"mkdir /data/accounts/account_0/appdata/image"
,
"chmod -R 666 /data/media/*"
,
"chmod -R 666 /data/accounts/account_0/appdata/image/*"
"chmod -R 666 /data/accounts/account_0/appdata/image/*"
],
],
"teardown-command"
:[
"teardown-command"
:[
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/FileAssetGetThumbnailCallBack.test.js
浏览文件 @
0f7b47fa
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
image
from
'
@ohos.multimedia.image
'
;
import
image
from
'
@ohos.multimedia.image
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
...
@@ -29,19 +29,19 @@ describe('FileAssetGetThumbnailPromise.test.js', function () {
...
@@ -29,19 +29,19 @@ describe('FileAssetGetThumbnailPromise.test.js', function () {
let
videoType
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
videoType
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
imageFetchOp
=
{
let
imageFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
=?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
=?
'
,
selectionArgs
:
[
imagetype
.
toString
()],
selectionArgs
:
[
imagetype
.
toString
()],
order
:
fileKeyObj
.
DATE_ADDED
,
order
:
mediaLibrary
.
FileKey
.
DATE_ADDED
,
};
};
let
videoFetchOp
=
{
let
videoFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
=?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
=?
'
,
selectionArgs
:
[
videoType
.
toString
()],
selectionArgs
:
[
videoType
.
toString
()],
order
:
fileKeyObj
.
DATE_ADDED
,
order
:
mediaLibrary
.
FileKey
.
DATE_ADDED
,
};
};
let
audioFetchOp
=
{
let
audioFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
=?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
=?
'
,
selectionArgs
:
[
audioType
.
toString
()],
selectionArgs
:
[
audioType
.
toString
()],
order
:
fileKeyObj
.
DATE_ADDED
,
order
:
mediaLibrary
.
FileKey
.
DATE_ADDED
,
};
};
beforeAll
(
function
()
{});
beforeAll
(
function
()
{});
beforeEach
(
function
()
{});
beforeEach
(
function
()
{});
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/FileAssetGetThumbnailPromise.test.js
浏览文件 @
0f7b47fa
...
@@ -29,19 +29,19 @@ describe('FileAssetGetThumbnailPromise.test.js', function () {
...
@@ -29,19 +29,19 @@ describe('FileAssetGetThumbnailPromise.test.js', function () {
let
videoType
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
videoType
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
imageFetchOp
=
{
let
imageFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
=?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
=?
'
,
selectionArgs
:
[
imagetype
.
toString
()],
selectionArgs
:
[
imagetype
.
toString
()],
order
:
fileKeyObj
.
DATE_ADDED
,
order
:
mediaLibrary
.
FileKey
.
DATE_ADDED
,
};
};
let
videoFetchOp
=
{
let
videoFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
=?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
=?
'
,
selectionArgs
:
[
videoType
.
toString
()],
selectionArgs
:
[
videoType
.
toString
()],
order
:
fileKeyObj
.
DATE_ADDED
,
order
:
mediaLibrary
.
FileKey
.
DATE_ADDED
,
};
};
let
audioFetchOp
=
{
let
audioFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
=?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
=?
'
,
selectionArgs
:
[
audioType
.
toString
()],
selectionArgs
:
[
audioType
.
toString
()],
order
:
fileKeyObj
.
DATE_ADDED
,
order
:
mediaLibrary
.
FileKey
.
DATE_ADDED
,
};
};
beforeAll
(
function
()
{});
beforeAll
(
function
()
{});
beforeEach
(
function
()
{});
beforeEach
(
function
()
{});
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/albumGetFileAssetsCallback.test.js
浏览文件 @
0f7b47fa
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
...
@@ -77,7 +77,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
...
@@ -77,7 +77,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_02
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_02
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
imageAlbumfetchOp
=
{
let
imageAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
()
],
selectionArgs
:
[
imageType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,3
'
,
order
:
'
date_added DESC LIMIT 0,3
'
,
};
};
...
@@ -110,7 +110,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
...
@@ -110,7 +110,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_03
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_03
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
audioAlbumfetchOp
=
{
let
audioAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
audioType
.
toString
()
],
selectionArgs
:
[
audioType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,3
'
,
order
:
'
date_added DESC LIMIT 0,3
'
,
};
};
...
@@ -142,7 +142,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
...
@@ -142,7 +142,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_04
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_04
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
videoAlbumfetchOp
=
{
let
videoAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
()
],
selectionArgs
:
[
videoType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,3
'
,
order
:
'
date_added DESC LIMIT 0,3
'
,
};
};
...
@@ -174,7 +174,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
...
@@ -174,7 +174,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_05
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_05
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
imageAndVideoAlbumfetchOp
=
{
let
imageAndVideoAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
(),
videoType
.
toString
()
],
selectionArgs
:
[
imageType
.
toString
(),
videoType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,3
'
,
order
:
'
date_added DESC LIMIT 0,3
'
,
};
};
...
@@ -206,7 +206,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
...
@@ -206,7 +206,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_06
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_06
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
imageAndAudioAlbumfetchOp
=
{
let
imageAndAudioAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
(),
audioType
.
toString
()
],
selectionArgs
:
[
imageType
.
toString
(),
audioType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,3
'
,
order
:
'
date_added DESC LIMIT 0,3
'
,
};
};
...
@@ -238,7 +238,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
...
@@ -238,7 +238,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_07
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_07
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
videoAndAudioAlbumfetchOp
=
{
let
videoAndAudioAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
(),
audioType
.
toString
()
],
selectionArgs
:
[
videoType
.
toString
(),
audioType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,3
'
,
order
:
'
date_added DESC LIMIT 0,3
'
,
};
};
...
@@ -270,8 +270,8 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
...
@@ -270,8 +270,8 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_08
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_08
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
imgAndVideoAndAudioAlbumfetchOp
=
{
let
imgAndVideoAndAudioAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
'
= ? or
'
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
(),
videoType
.
toString
(),
audioType
.
toString
()
],
selectionArgs
:
[
imageType
.
toString
(),
videoType
.
toString
(),
audioType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,3
'
,
order
:
'
date_added DESC LIMIT 0,3
'
,
};
};
...
@@ -303,7 +303,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
...
@@ -303,7 +303,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_09
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_09
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
albumfetchOpOne
=
{
let
albumfetchOpOne
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
()
],
selectionArgs
:
[
imageType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,1
'
,
order
:
'
date_added DESC LIMIT 0,1
'
,
};
};
...
@@ -335,7 +335,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
...
@@ -335,7 +335,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_10
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_10
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
albumfetchOpOne
=
{
let
albumfetchOpOne
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
audioType
.
toString
()
],
selectionArgs
:
[
audioType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,1
'
,
order
:
'
date_added DESC LIMIT 0,1
'
,
};
};
...
@@ -367,7 +367,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
...
@@ -367,7 +367,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_11
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_11
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
albumfetchOpOne
=
{
let
albumfetchOpOne
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
()
],
selectionArgs
:
[
videoType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,1
'
,
order
:
'
date_added DESC LIMIT 0,1
'
,
};
};
...
@@ -399,7 +399,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
...
@@ -399,7 +399,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_12
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_12
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
albumfetchOpNone
=
{
let
albumfetchOpNone
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? AND date_added < 0
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? AND date_added < 0
'
,
selectionArgs
:
[
imageType
.
toString
()
],
selectionArgs
:
[
imageType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,1
'
,
order
:
'
date_added DESC LIMIT 0,1
'
,
};
};
...
@@ -436,7 +436,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
...
@@ -436,7 +436,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_13
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_13
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
albumfetchOpNone
=
{
let
albumfetchOpNone
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? AND date_added < 0
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? AND date_added < 0
'
,
selectionArgs
:
[
audioType
.
toString
()
],
selectionArgs
:
[
audioType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,1
'
,
order
:
'
date_added DESC LIMIT 0,1
'
,
};
};
...
@@ -473,7 +473,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
...
@@ -473,7 +473,7 @@ describe('albumGetFileAssetsCallback.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_14
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_CALLBACK_001_14
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
albumfetchOpNone
=
{
let
albumfetchOpNone
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? AND date_added < 0
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? AND date_added < 0
'
,
selectionArgs
:
[
videoType
.
toString
()
],
selectionArgs
:
[
videoType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,1
'
,
order
:
'
date_added DESC LIMIT 0,1
'
,
};
};
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/albumGetFileAssetsPromise.test.js
浏览文件 @
0f7b47fa
...
@@ -70,7 +70,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
...
@@ -70,7 +70,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_02
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_02
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
imageAlbumfetchOp
=
{
let
imageAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
()
],
selectionArgs
:
[
imageType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,3
'
,
order
:
'
date_added DESC LIMIT 0,3
'
,
};
};
...
@@ -96,7 +96,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
...
@@ -96,7 +96,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_03
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_03
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
audioAlbumfetchOp
=
{
let
audioAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
audioType
.
toString
()
],
selectionArgs
:
[
audioType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,3
'
,
order
:
'
date_added DESC LIMIT 0,3
'
,
};
};
...
@@ -122,7 +122,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
...
@@ -122,7 +122,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_04
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_04
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
videoAlbumfetchOp
=
{
let
videoAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
()
],
selectionArgs
:
[
videoType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,3
'
,
order
:
'
date_added DESC LIMIT 0,3
'
,
};
};
...
@@ -148,7 +148,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
...
@@ -148,7 +148,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_05
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_05
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
imageAndVideoAlbumfetchOp
=
{
let
imageAndVideoAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
(),
videoType
.
toString
()
],
selectionArgs
:
[
imageType
.
toString
(),
videoType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,3
'
,
order
:
'
date_added DESC LIMIT 0,3
'
,
};
};
...
@@ -174,7 +174,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
...
@@ -174,7 +174,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_06
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_06
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
imageAndAudioAlbumfetchOp
=
{
let
imageAndAudioAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
(),
audioType
.
toString
()
],
selectionArgs
:
[
imageType
.
toString
(),
audioType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,3
'
,
order
:
'
date_added DESC LIMIT 0,3
'
,
};
};
...
@@ -200,7 +200,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
...
@@ -200,7 +200,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_07
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_07
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
videoAndAudioAlbumfetchOp
=
{
let
videoAndAudioAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
(),
audioType
.
toString
()
],
selectionArgs
:
[
videoType
.
toString
(),
audioType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,3
'
,
order
:
'
date_added DESC LIMIT 0,3
'
,
};
};
...
@@ -226,8 +226,8 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
...
@@ -226,8 +226,8 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_08
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_08
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
imgAndVideoAndAudioAlbumfetchOp
=
{
let
imgAndVideoAndAudioAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
'
= ? or
'
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
(),
videoType
.
toString
(),
audioType
.
toString
()
],
selectionArgs
:
[
imageType
.
toString
(),
videoType
.
toString
(),
audioType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,3
'
,
order
:
'
date_added DESC LIMIT 0,3
'
,
};
};
...
@@ -253,7 +253,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
...
@@ -253,7 +253,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_09
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_09
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
albumfetchOpOne
=
{
let
albumfetchOpOne
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
()
],
selectionArgs
:
[
imageType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,1
'
,
order
:
'
date_added DESC LIMIT 0,1
'
,
};
};
...
@@ -279,7 +279,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
...
@@ -279,7 +279,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_10
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_10
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
albumfetchOpOne
=
{
let
albumfetchOpOne
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
audioType
.
toString
()
],
selectionArgs
:
[
audioType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,1
'
,
order
:
'
date_added DESC LIMIT 0,1
'
,
};
};
...
@@ -305,7 +305,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
...
@@ -305,7 +305,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_11
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_11
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
albumfetchOpOne
=
{
let
albumfetchOpOne
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
()
],
selectionArgs
:
[
videoType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,1
'
,
order
:
'
date_added DESC LIMIT 0,1
'
,
};
};
...
@@ -331,7 +331,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
...
@@ -331,7 +331,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_12
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_12
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
albumfetchOpNone
=
{
let
albumfetchOpNone
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? AND date_added < 0
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? AND date_added < 0
'
,
selectionArgs
:
[
imageType
.
toString
()
],
selectionArgs
:
[
imageType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,1
'
,
order
:
'
date_added DESC LIMIT 0,1
'
,
};
};
...
@@ -359,7 +359,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
...
@@ -359,7 +359,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_13
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_13
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
albumfetchOpNone
=
{
let
albumfetchOpNone
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? AND date_added < 0
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? AND date_added < 0
'
,
selectionArgs
:
[
audioType
.
toString
()
],
selectionArgs
:
[
audioType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,1
'
,
order
:
'
date_added DESC LIMIT 0,1
'
,
};
};
...
@@ -387,7 +387,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
...
@@ -387,7 +387,7 @@ describe('albumGetFileAssetsPromise.test.js', async function() {
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_14
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_ALBUM_GET_ASSETS_PROMISE_001_14
'
,
0
,
async
function
(
done
)
{
try
{
try
{
let
albumfetchOpNone
=
{
let
albumfetchOpNone
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? AND date_added < 0
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? AND date_added < 0
'
,
selectionArgs
:
[
videoType
.
toString
()
],
selectionArgs
:
[
videoType
.
toString
()
],
order
:
'
date_added DESC LIMIT 0,1
'
,
order
:
'
date_added DESC LIMIT 0,1
'
,
};
};
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/albumTestCallBack.test.js
浏览文件 @
0f7b47fa
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
...
@@ -27,35 +27,35 @@ let allTypefetchOp = {
...
@@ -27,35 +27,35 @@ let allTypefetchOp = {
selectionArgs
:
[],
selectionArgs
:
[],
};
};
let
albumDeletefetchOp
=
{
let
albumDeletefetchOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ? AND
'
+
fileKeyObj
.
ALBUM_NAME
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
RELATIVE_PATH
+
'
= ? AND
'
+
mediaLibrary
.
FileKey
.
ALBUM_NAME
+
'
= ?
'
,
selectionArgs
:
[
'
Pictures/
'
,
'
DeleteAlbumCallback
'
],
selectionArgs
:
[
'
Pictures/
'
,
'
DeleteAlbumCallback
'
],
};
};
let
albumCoverUrifetchOp
=
{
let
albumCoverUrifetchOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ? AND
'
+
fileKeyObj
.
ALBUM_NAME
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
RELATIVE_PATH
+
'
= ? AND
'
+
mediaLibrary
.
FileKey
.
ALBUM_NAME
+
'
= ?
'
,
selectionArgs
:
[
'
Pictures/
'
,
'
weixin
'
],
selectionArgs
:
[
'
Pictures/
'
,
'
weixin
'
],
};
};
let
imageAlbumfetchOp
=
{
let
imageAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
()],
};
};
let
videoAlbumfetchOp
=
{
let
videoAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
()],
selectionArgs
:
[
videoType
.
toString
()],
};
};
let
audioAlbumfetchOp
=
{
let
audioAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
audioType
.
toString
()],
selectionArgs
:
[
audioType
.
toString
()],
};
};
let
imageAndVideoAlbumfetchOp
=
{
let
imageAndVideoAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
(),
videoType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
(),
videoType
.
toString
()],
};
};
let
imageAndAudioAlbumfetchOp
=
{
let
imageAndAudioAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
(),
audioType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
(),
audioType
.
toString
()],
};
};
let
videoAndAudioAlbumfetchOp
=
{
let
videoAndAudioAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
(),
audioType
.
toString
()],
selectionArgs
:
[
videoType
.
toString
(),
audioType
.
toString
()],
};
};
function
printAlbumMessage
(
testNum
,
album
)
{
function
printAlbumMessage
(
testNum
,
album
)
{
...
@@ -476,7 +476,7 @@ describe('albumTestCallBack.test.js', async function () {
...
@@ -476,7 +476,7 @@ describe('albumTestCallBack.test.js', async function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_06
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_CALLBACK_002_06
'
,
0
,
async
function
(
done
)
{
let
fileHasArgsfetchOp3
=
{
let
fileHasArgsfetchOp3
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
'
666
'
],
selectionArgs
:
[
'
666
'
],
};
};
try
{
try
{
...
@@ -803,7 +803,7 @@ describe('albumTestCallBack.test.js', async function () {
...
@@ -803,7 +803,7 @@ describe('albumTestCallBack.test.js', async function () {
selectionArgs
:
[],
selectionArgs
:
[],
order
:
'
date_added DESC LIMIT 0,1
'
,
order
:
'
date_added DESC LIMIT 0,1
'
,
};
};
media
.
getAlbums
(
albumCoverUrifetchOp
,
async
(
err
,
albumList
)
=>
{
media
.
getAlbums
(
albumCoverUrifetchOp
,
async
(
err
,
albumList
)
=>
{
if
(
albumList
==
undefined
)
{
if
(
albumList
==
undefined
)
{
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
done
();
...
@@ -821,7 +821,7 @@ describe('albumTestCallBack.test.js', async function () {
...
@@ -821,7 +821,7 @@ describe('albumTestCallBack.test.js', async function () {
console
.
info
(
'
ALBUM_CALLBACK getAlbum 004_01 asset.uri =
'
+
asset
.
uri
);
console
.
info
(
'
ALBUM_CALLBACK getAlbum 004_01 asset.uri =
'
+
asset
.
uri
);
expect
(
asset
.
uri
==
album
.
coverUri
).
assertTrue
();
expect
(
asset
.
uri
==
album
.
coverUri
).
assertTrue
();
done
();
done
();
}
}
}
}
});
});
}
catch
(
error
)
{
}
catch
(
error
)
{
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/albumTestPromise.test.js
浏览文件 @
0f7b47fa
...
@@ -27,35 +27,35 @@ let allTypefetchOp = {
...
@@ -27,35 +27,35 @@ let allTypefetchOp = {
selectionArgs
:
[],
selectionArgs
:
[],
};
};
let
albumDeletefetchOp
=
{
let
albumDeletefetchOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ? AND
'
+
fileKeyObj
.
ALBUM_NAME
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
RELATIVE_PATH
+
'
= ? AND
'
+
mediaLibrary
.
FileKey
.
ALBUM_NAME
+
'
= ?
'
,
selectionArgs
:
[
'
Pictures/
'
,
'
DeleteAlbumPro
'
],
selectionArgs
:
[
'
Pictures/
'
,
'
DeleteAlbumPro
'
],
};
};
let
albumCoverUrifetchOp
=
{
let
albumCoverUrifetchOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ? AND
'
+
fileKeyObj
.
ALBUM_NAME
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
RELATIVE_PATH
+
'
= ? AND
'
+
mediaLibrary
.
FileKey
.
ALBUM_NAME
+
'
= ?
'
,
selectionArgs
:
[
'
Pictures/
'
,
'
weixin
'
],
selectionArgs
:
[
'
Pictures/
'
,
'
weixin
'
],
};
};
let
imageAlbumfetchOp
=
{
let
imageAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
()],
};
};
let
videoAlbumfetchOp
=
{
let
videoAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
()],
selectionArgs
:
[
videoType
.
toString
()],
};
};
let
audioAlbumfetchOp
=
{
let
audioAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
audioType
.
toString
()],
selectionArgs
:
[
audioType
.
toString
()],
};
};
let
imageAndVideoAlbumfetchOp
=
{
let
imageAndVideoAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
(),
videoType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
(),
videoType
.
toString
()],
};
};
let
imageAndAudioAlbumfetchOp
=
{
let
imageAndAudioAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
(),
audioType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
(),
audioType
.
toString
()],
};
};
let
videoAndAudioAlbumfetchOp
=
{
let
videoAndAudioAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
(),
audioType
.
toString
()],
selectionArgs
:
[
videoType
.
toString
(),
audioType
.
toString
()],
};
};
function
printAlbumMessage
(
testNum
,
album
)
{
function
printAlbumMessage
(
testNum
,
album
)
{
...
@@ -85,10 +85,10 @@ function checkAlbumAttr(done, album) {
...
@@ -85,10 +85,10 @@ function checkAlbumAttr(done, album) {
describe
(
'
albumTestPromise.test.js
'
,
async
function
()
{
describe
(
'
albumTestPromise.test.js
'
,
async
function
()
{
var
context
=
featureAbility
.
getContext
();
var
context
=
featureAbility
.
getContext
();
var
media
=
mediaLibrary
.
getMediaLibrary
(
context
);
var
media
=
mediaLibrary
.
getMediaLibrary
(
context
);
beforeAll
(
function
()
{});
beforeAll
(
function
()
{
});
beforeEach
(
function
()
{});
beforeEach
(
function
()
{
});
afterEach
(
function
()
{});
afterEach
(
function
()
{
});
afterAll
(
function
()
{});
afterAll
(
function
()
{
});
// ------------------------------ 001 test start -------------------------
// ------------------------------ 001 test start -------------------------
/**
/**
...
@@ -394,7 +394,7 @@ describe('albumTestPromise.test.js', async function () {
...
@@ -394,7 +394,7 @@ describe('albumTestPromise.test.js', async function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_06
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_GETALBUMASSETS_PROMISE_002_06
'
,
0
,
async
function
(
done
)
{
let
fileHasArgsfetchOp3
=
{
let
fileHasArgsfetchOp3
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
'
666
'
],
selectionArgs
:
[
'
666
'
],
};
};
try
{
try
{
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/favoriteTestCallBack.test.js
浏览文件 @
0f7b47fa
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
...
@@ -23,19 +23,19 @@ const imageType = mediaLibrary.MediaType.IMAGE;
...
@@ -23,19 +23,19 @@ const imageType = mediaLibrary.MediaType.IMAGE;
const
videoType
=
mediaLibrary
.
MediaType
.
VIDEO
;
const
videoType
=
mediaLibrary
.
MediaType
.
VIDEO
;
const
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
const
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
const
fileFetchOp
=
{
const
fileFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()],
selectionArgs
:
[
fileType
.
toString
()],
};
};
const
imageFetchOp
=
{
const
imageFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
()],
};
};
const
videoFetchOp
=
{
const
videoFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
()],
selectionArgs
:
[
videoType
.
toString
()],
};
};
const
audioFetchOp
=
{
const
audioFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
audioType
.
toString
()],
selectionArgs
:
[
audioType
.
toString
()],
};
};
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/favoriteTestPromise.test.js
浏览文件 @
0f7b47fa
...
@@ -23,19 +23,19 @@ const imageType = mediaLibrary.MediaType.IMAGE;
...
@@ -23,19 +23,19 @@ const imageType = mediaLibrary.MediaType.IMAGE;
const
videoType
=
mediaLibrary
.
MediaType
.
VIDEO
;
const
videoType
=
mediaLibrary
.
MediaType
.
VIDEO
;
const
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
const
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
const
fileFetchOp
=
{
const
fileFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()],
selectionArgs
:
[
fileType
.
toString
()],
};
};
const
imageFetchOp
=
{
const
imageFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
()],
};
};
const
videoFetchOp
=
{
const
videoFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
()],
selectionArgs
:
[
videoType
.
toString
()],
};
};
const
audioFetchOp
=
{
const
audioFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
audioType
.
toString
()],
selectionArgs
:
[
audioType
.
toString
()],
};
};
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/favtrashTestCallBack.test.js
浏览文件 @
0f7b47fa
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fetchFileResultCallBack.test.js
浏览文件 @
0f7b47fa
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
...
@@ -24,71 +24,71 @@ let videoType = mediaLibrary.MediaType.VIDEO;
...
@@ -24,71 +24,71 @@ let videoType = mediaLibrary.MediaType.VIDEO;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
getFileCountOneOp
=
{
let
getFileCountOneOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()
],
selectionArgs
:
[
fileType
.
toString
()
],
order
:
fileKeyObj
.
DATE_ADDED
+
"
DESC LIMIT 0,1
"
,
order
:
mediaLibrary
.
FileKey
.
DATE_ADDED
+
"
DESC LIMIT 0,1
"
,
extendArgs
:
""
,
};
};
let
getFileCountTwoOp
=
{
let
getFileCountTwoOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()
],
selectionArgs
:
[
fileType
.
toString
()
],
order
:
fileKeyObj
.
DATE_ADDED
+
"
DESC LIMIT 0,2
"
,
order
:
mediaLibrary
.
FileKey
.
DATE_ADDED
+
"
DESC LIMIT 0,2
"
,
extendArgs
:
""
,
};
};
let
getFileCountTenOp
=
{
let
getFileCountTenOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()
],
selectionArgs
:
[
fileType
.
toString
()
],
order
:
fileKeyObj
.
DATE_ADDED
+
"
DESC LIMIT 0,10
"
,
order
:
mediaLibrary
.
FileKey
.
DATE_ADDED
+
"
DESC LIMIT 0,10
"
,
extendArgs
:
""
,
};
};
let
getFileCountOneHundredOp
=
{
let
getFileCountOneHundredOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()
],
selectionArgs
:
[
fileType
.
toString
()
],
order
:
fileKeyObj
.
DATE_ADDED
+
"
DESC LIMIT 0,100
"
,
order
:
mediaLibrary
.
FileKey
.
DATE_ADDED
+
"
DESC LIMIT 0,100
"
,
extendArgs
:
""
,
};
};
let
getFirstObjectOp
=
{
let
getFirstObjectOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
'
Camera/
'
],
selectionArgs
:
[
'
Camera/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,5
"
,
order
:
mediaLibrary
.
FileKey
.
ID
+
"
DESC LIMIT 0,5
"
,
extendArgs
:
""
,
}
}
let
getAllObjectLimitOneOp
=
{
let
getAllObjectLimitOneOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
'
Camera/
'
],
selectionArgs
:
[
'
Camera/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,1
"
,
order
:
mediaLibrary
.
FileKey
.
ID
+
"
DESC LIMIT 0,1
"
,
extendArgs
:
""
,
}
}
let
getAllObjectLimitTwoOp
=
{
let
getAllObjectLimitTwoOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
'
Camera/
'
],
selectionArgs
:
[
'
Camera/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,1
"
,
order
:
mediaLibrary
.
FileKey
.
ID
+
"
DESC LIMIT 0,1
"
,
extendArgs
:
""
,
}
}
let
getAllObjectLimitOneHundredOp
=
{
let
getAllObjectLimitOneHundredOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
'
Camera/
'
],
selectionArgs
:
[
'
Camera/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,100
"
,
order
:
mediaLibrary
.
FileKey
.
ID
+
"
DESC LIMIT 0,100
"
,
extendArgs
:
""
,
}
}
let
getFileCountZeroOp
=
{
let
getFileCountZeroOp
=
{
selections
:
fileKeyObj
.
DISPLAY_NAME
+
'
=?
'
,
selections
:
mediaLibrary
.
FileKey
.
DISPLAY_NAME
+
'
=?
'
,
selectionArgs
:
[
'
The world has kissed my soul with its pain, asking for its return in songs.
'
],
selectionArgs
:
[
'
The world has kissed my soul with its pain, asking for its return in songs.
'
],
};
};
let
getFileOp
=
{
let
getFileOp
=
{
selections
:
fileKeyObj
.
DISPLAY_NAME
+
'
= ? AND
'
+
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
DISPLAY_NAME
+
'
= ? AND
'
+
mediaLibrary
.
FileKey
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
'
01.jpg
'
,
'
Camera/
'
],
selectionArgs
:
[
'
01.jpg
'
,
'
Camera/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,100
"
,
order
:
mediaLibrary
.
FileKey
.
ID
+
"
DESC LIMIT 0,100
"
,
extendArgs
:
""
,
}
}
describe
(
'
fetchFileResultCallback.test.js
'
,
async
function
()
{
describe
(
'
fetchFileResultCallback.test.js
'
,
async
function
()
{
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fetchFileResultPromise.test.js
浏览文件 @
0f7b47fa
...
@@ -24,71 +24,71 @@ let videoType = mediaLibrary.MediaType.VIDEO;
...
@@ -24,71 +24,71 @@ let videoType = mediaLibrary.MediaType.VIDEO;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
getFileCountOneOp
=
{
let
getFileCountOneOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()
],
selectionArgs
:
[
fileType
.
toString
()
],
order
:
fileKeyObj
.
DATE_ADDED
+
"
DESC LIMIT 0,1
"
,
order
:
mediaLibrary
.
FileKey
.
DATE_ADDED
+
"
DESC LIMIT 0,1
"
,
extendArgs
:
""
,
};
};
let
getFileCountTwoOp
=
{
let
getFileCountTwoOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()
],
selectionArgs
:
[
fileType
.
toString
()
],
order
:
fileKeyObj
.
DATE_ADDED
+
"
DESC LIMIT 0,2
"
,
order
:
mediaLibrary
.
FileKey
.
DATE_ADDED
+
"
DESC LIMIT 0,2
"
,
extendArgs
:
""
,
};
};
let
getFileCountTenOp
=
{
let
getFileCountTenOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()
],
selectionArgs
:
[
fileType
.
toString
()
],
order
:
fileKeyObj
.
DATE_ADDED
+
"
DESC LIMIT 0,10
"
,
order
:
mediaLibrary
.
FileKey
.
DATE_ADDED
+
"
DESC LIMIT 0,10
"
,
extendArgs
:
""
,
};
};
let
getFileCountOneHundredOp
=
{
let
getFileCountOneHundredOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()
],
selectionArgs
:
[
fileType
.
toString
()
],
order
:
fileKeyObj
.
DATE_ADDED
+
"
DESC LIMIT 0,100
"
,
order
:
mediaLibrary
.
FileKey
.
DATE_ADDED
+
"
DESC LIMIT 0,100
"
,
extendArgs
:
""
,
};
};
let
getFirstObjectOp
=
{
let
getFirstObjectOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
'
Camera/
'
],
selectionArgs
:
[
'
Camera/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,5
"
,
order
:
mediaLibrary
.
FileKey
.
ID
+
"
DESC LIMIT 0,5
"
,
extendArgs
:
""
,
}
}
let
getAllObjectLimitOneOp
=
{
let
getAllObjectLimitOneOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
'
Camera/
'
],
selectionArgs
:
[
'
Camera/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,1
"
,
order
:
mediaLibrary
.
FileKey
.
ID
+
"
DESC LIMIT 0,1
"
,
extendArgs
:
""
,
}
}
let
getAllObjectLimitTwoOp
=
{
let
getAllObjectLimitTwoOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
'
Camera/
'
],
selectionArgs
:
[
'
Camera/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,1
"
,
order
:
mediaLibrary
.
FileKey
.
ID
+
"
DESC LIMIT 0,1
"
,
extendArgs
:
""
,
}
}
let
getAllObjectLimitOneHundredOp
=
{
let
getAllObjectLimitOneHundredOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
'
Camera/
'
],
selectionArgs
:
[
'
Camera/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,100
"
,
order
:
mediaLibrary
.
FileKey
.
ID
+
"
DESC LIMIT 0,100
"
,
extendArgs
:
""
,
}
}
let
getFileCountZeroOp
=
{
let
getFileCountZeroOp
=
{
selections
:
fileKeyObj
.
DISPLAY_NAME
+
'
=?
'
,
selections
:
mediaLibrary
.
FileKey
.
DISPLAY_NAME
+
'
=?
'
,
selectionArgs
:
[
'
The world has kissed my soul with its pain, asking for its return in songs.
'
],
selectionArgs
:
[
'
The world has kissed my soul with its pain, asking for its return in songs.
'
],
};
};
let
getFileOp
=
{
let
getFileOp
=
{
selections
:
fileKeyObj
.
DISPLAY_NAME
+
'
= ? AND
'
+
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
DISPLAY_NAME
+
'
= ? AND
'
+
mediaLibrary
.
FileKey
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
'
01.jpg
'
,
'
Camera/
'
],
selectionArgs
:
[
'
01.jpg
'
,
'
Camera/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,100
"
,
order
:
mediaLibrary
.
FileKey
.
ID
+
"
DESC LIMIT 0,100
"
,
extendArgs
:
""
,
}
}
describe
(
'
fetchFileResultPromise.test.js
'
,
async
function
()
{
describe
(
'
fetchFileResultPromise.test.js
'
,
async
function
()
{
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAsset2.test.js
浏览文件 @
0f7b47fa
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
...
@@ -47,16 +47,16 @@ describe('fileAsset2.test.js', async function () {
...
@@ -47,16 +47,16 @@ describe('fileAsset2.test.js', async function () {
let
videoType
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
videoType
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
imagesfetchOp
=
{
let
imagesfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
()],
};
};
let
videosfetchOp
=
{
let
videosfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
()],
selectionArgs
:
[
videoType
.
toString
()],
};
};
let
audiosfetchOp
=
{
let
audiosfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
audioType
.
toString
()],
selectionArgs
:
[
audioType
.
toString
()],
};
};
...
@@ -66,10 +66,10 @@ describe('fileAsset2.test.js', async function () {
...
@@ -66,10 +66,10 @@ describe('fileAsset2.test.js', async function () {
};
};
const
context
=
featureAbility
.
getContext
();
const
context
=
featureAbility
.
getContext
();
const
media
=
mediaLibrary
.
getMediaLibrary
(
context
);
const
media
=
mediaLibrary
.
getMediaLibrary
(
context
);
beforeAll
(
function
()
{});
beforeAll
(
function
()
{
});
beforeEach
(
function
()
{});
beforeEach
(
function
()
{
});
afterEach
(
function
()
{});
afterEach
(
function
()
{
});
afterAll
(
function
()
{});
afterAll
(
function
()
{
});
/**
/**
* @tc.number : SUB_MEDIA_FILEASSET_commitModify_promise_001
* @tc.number : SUB_MEDIA_FILEASSET_commitModify_promise_001
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetCallBack2.test.js
浏览文件 @
0f7b47fa
...
@@ -47,16 +47,16 @@ describe('fileAssetCallBack2.test.js', async function () {
...
@@ -47,16 +47,16 @@ describe('fileAssetCallBack2.test.js', async function () {
let
videoType
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
videoType
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
imagesfetchOp
=
{
let
imagesfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
()],
};
};
let
videosfetchOp
=
{
let
videosfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
()],
selectionArgs
:
[
videoType
.
toString
()],
};
};
let
audiosfetchOp
=
{
let
audiosfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
audioType
.
toString
()],
selectionArgs
:
[
audioType
.
toString
()],
};
};
...
@@ -66,10 +66,10 @@ describe('fileAssetCallBack2.test.js', async function () {
...
@@ -66,10 +66,10 @@ describe('fileAssetCallBack2.test.js', async function () {
};
};
const
context
=
featureAbility
.
getContext
();
const
context
=
featureAbility
.
getContext
();
const
media
=
mediaLibrary
.
getMediaLibrary
(
context
);
const
media
=
mediaLibrary
.
getMediaLibrary
(
context
);
beforeAll
(
function
()
{});
beforeAll
(
function
()
{
});
beforeEach
(
function
()
{});
beforeEach
(
function
()
{
});
afterEach
(
function
()
{});
afterEach
(
function
()
{
});
afterAll
(
function
()
{});
afterAll
(
function
()
{
});
/**
/**
* @tc.number : SUB_MEDIA_FILEASSET_commitModify_callback_001
* @tc.number : SUB_MEDIA_FILEASSET_commitModify_callback_001
...
@@ -86,7 +86,7 @@ describe('fileAssetCallBack2.test.js', async function () {
...
@@ -86,7 +86,7 @@ describe('fileAssetCallBack2.test.js', async function () {
const
newName
=
'
newName
'
;
const
newName
=
'
newName
'
;
asset
.
displayName
=
newName
;
asset
.
displayName
=
newName
;
const
id
=
asset
.
id
;
const
id
=
asset
.
id
;
asset
.
commitModify
(
async
()
=>
{
asset
.
commitModify
(
async
()
=>
{
const
fetchFileResult2
=
await
media
.
getFileAssets
(
imagesfetchOp
);
const
fetchFileResult2
=
await
media
.
getFileAssets
(
imagesfetchOp
);
const
dataList
=
await
fetchFileResult2
.
getAllObject
();
const
dataList
=
await
fetchFileResult2
.
getAllObject
();
let
passed
=
false
;
let
passed
=
false
;
...
@@ -101,7 +101,7 @@ describe('fileAssetCallBack2.test.js', async function () {
...
@@ -101,7 +101,7 @@ describe('fileAssetCallBack2.test.js', async function () {
done
();
done
();
});
});
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
info
(
'
FileAsset commitModify 001 failed, message =
'
+
error
);
console
.
info
(
'
FileAsset commitModify 001 failed, message =
'
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -247,9 +247,9 @@ describe('fileAssetCallBack2.test.js', async function () {
...
@@ -247,9 +247,9 @@ describe('fileAssetCallBack2.test.js', async function () {
asset
.
uri
=
newUri
;
asset
.
uri
=
newUri
;
asset
.
commitModify
(
async
(
err
)
=>
{
asset
.
commitModify
(
async
(
err
)
=>
{
if
(
err
)
{
if
(
err
)
{
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
done
();
done
();
}
else
{
}
else
{
console
.
info
(
'
FileAsset commitModify 005 failed
'
);
console
.
info
(
'
FileAsset commitModify 005 failed
'
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -257,7 +257,7 @@ describe('fileAssetCallBack2.test.js', async function () {
...
@@ -257,7 +257,7 @@ describe('fileAssetCallBack2.test.js', async function () {
}
}
});
});
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
info
(
'
FileAsset commitModify 005 passed
'
);
console
.
info
(
'
FileAsset commitModify 005 passed
'
);
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
...
@@ -283,7 +283,7 @@ describe('fileAssetCallBack2.test.js', async function () {
...
@@ -283,7 +283,7 @@ describe('fileAssetCallBack2.test.js', async function () {
asset
.
mediaType
=
newMediaType
;
asset
.
mediaType
=
newMediaType
;
asset
.
commitModify
(
async
(
err
)
=>
{
asset
.
commitModify
(
async
(
err
)
=>
{
if
(
err
)
{
if
(
err
)
{
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
done
();
done
();
}
else
{
}
else
{
...
@@ -312,7 +312,7 @@ describe('fileAssetCallBack2.test.js', async function () {
...
@@ -312,7 +312,7 @@ describe('fileAssetCallBack2.test.js', async function () {
const
fetchFileResult
=
await
media
.
getFileAssets
(
imagesfetchOp
);
const
fetchFileResult
=
await
media
.
getFileAssets
(
imagesfetchOp
);
const
asset
=
await
fetchFileResult
.
getFirstObject
();
const
asset
=
await
fetchFileResult
.
getFirstObject
();
asset
.
isDirectory
((
err
,
isDir
)
=>
{
asset
.
isDirectory
((
err
,
isDir
)
=>
{
if
(
isDir
==
undefined
)
{
if
(
isDir
==
undefined
)
{
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
done
();
}
else
{
}
else
{
...
@@ -339,7 +339,7 @@ describe('fileAssetCallBack2.test.js', async function () {
...
@@ -339,7 +339,7 @@ describe('fileAssetCallBack2.test.js', async function () {
try
{
try
{
const
fetchFileResult
=
await
media
.
getFileAssets
(
imagesfetchOp
);
const
fetchFileResult
=
await
media
.
getFileAssets
(
imagesfetchOp
);
fetchFileResult
.
getFirstObject
((
err
,
asset
)
=>
{
fetchFileResult
.
getFirstObject
((
err
,
asset
)
=>
{
if
(
asset
==
undefined
)
{
if
(
asset
==
undefined
)
{
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
done
();
}
else
{
}
else
{
...
@@ -366,7 +366,7 @@ describe('fileAssetCallBack2.test.js', async function () {
...
@@ -366,7 +366,7 @@ describe('fileAssetCallBack2.test.js', async function () {
try
{
try
{
const
fetchFileResult
=
await
media
.
getFileAssets
(
videosfetchOp
);
const
fetchFileResult
=
await
media
.
getFileAssets
(
videosfetchOp
);
fetchFileResult
.
getFirstObject
((
err
,
asset
)
=>
{
fetchFileResult
.
getFirstObject
((
err
,
asset
)
=>
{
if
(
asset
==
undefined
)
{
if
(
asset
==
undefined
)
{
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
done
();
}
else
{
}
else
{
...
@@ -392,8 +392,8 @@ describe('fileAssetCallBack2.test.js', async function () {
...
@@ -392,8 +392,8 @@ describe('fileAssetCallBack2.test.js', async function () {
it
(
'
SUB_MEDIA_FILEASSET_checkAttr_callback_003
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_FILEASSET_checkAttr_callback_003
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
fetchFileResult
=
await
media
.
getFileAssets
(
audiosfetchOp
);
const
fetchFileResult
=
await
media
.
getFileAssets
(
audiosfetchOp
);
fetchFileResult
.
getFirstObject
((
err
,
asset
)
=>
{
fetchFileResult
.
getFirstObject
((
err
,
asset
)
=>
{
if
(
asset
==
undefined
)
{
if
(
asset
==
undefined
)
{
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
done
();
}
else
{
}
else
{
...
@@ -421,8 +421,8 @@ describe('fileAssetCallBack2.test.js', async function () {
...
@@ -421,8 +421,8 @@ describe('fileAssetCallBack2.test.js', async function () {
const
albumList
=
await
media
.
getAlbums
(
allTypefetchOp
);
const
albumList
=
await
media
.
getAlbums
(
allTypefetchOp
);
const
album
=
albumList
[
0
];
const
album
=
albumList
[
0
];
const
fetchFileResult
=
await
album
.
getFileAssets
(
allTypefetchOp
);
const
fetchFileResult
=
await
album
.
getFileAssets
(
allTypefetchOp
);
fetchFileResult
.
getFirstObject
((
err
,
asset
)
=>
{
fetchFileResult
.
getFirstObject
((
err
,
asset
)
=>
{
if
(
asset
==
undefined
)
{
if
(
asset
==
undefined
)
{
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
done
();
}
else
{
}
else
{
...
@@ -430,7 +430,7 @@ describe('fileAssetCallBack2.test.js', async function () {
...
@@ -430,7 +430,7 @@ describe('fileAssetCallBack2.test.js', async function () {
checkAttrs
(
done
,
asset
,
'
004
'
);
checkAttrs
(
done
,
asset
,
'
004
'
);
}
}
});
});
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
info
(
'
FileAsset checkAttr 003 failed, message =
'
+
error
);
console
.
info
(
'
FileAsset checkAttr 003 failed, message =
'
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetPromise2.test.js
浏览文件 @
0f7b47fa
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
...
@@ -47,16 +47,16 @@ describe('fileAssetPromise2.test.js', async function () {
...
@@ -47,16 +47,16 @@ describe('fileAssetPromise2.test.js', async function () {
let
videoType
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
videoType
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
imagesfetchOp
=
{
let
imagesfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
()],
};
};
let
videosfetchOp
=
{
let
videosfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
()],
selectionArgs
:
[
videoType
.
toString
()],
};
};
let
audiosfetchOp
=
{
let
audiosfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
audioType
.
toString
()],
selectionArgs
:
[
audioType
.
toString
()],
};
};
...
@@ -66,10 +66,10 @@ describe('fileAssetPromise2.test.js', async function () {
...
@@ -66,10 +66,10 @@ describe('fileAssetPromise2.test.js', async function () {
};
};
const
context
=
featureAbility
.
getContext
();
const
context
=
featureAbility
.
getContext
();
const
media
=
mediaLibrary
.
getMediaLibrary
(
context
);
const
media
=
mediaLibrary
.
getMediaLibrary
(
context
);
beforeAll
(
function
()
{});
beforeAll
(
function
()
{
});
beforeEach
(
function
()
{});
beforeEach
(
function
()
{
});
afterEach
(
function
()
{});
afterEach
(
function
()
{
});
afterAll
(
function
()
{});
afterAll
(
function
()
{
});
/**
/**
* @tc.number : SUB_MEDIA_FILEASSET_commitModify_promise_001
* @tc.number : SUB_MEDIA_FILEASSET_commitModify_promise_001
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetTestCallback.test.js
浏览文件 @
0f7b47fa
...
@@ -42,7 +42,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -42,7 +42,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try
{
try
{
let
fileType
=
mediaLibrary
.
MediaType
.
FILE
;
let
fileType
=
mediaLibrary
.
MediaType
.
FILE
;
let
fileFetchOp
=
{
let
fileFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()
],
selectionArgs
:
[
fileType
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fileFetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fileFetchOp
);
...
@@ -109,7 +109,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -109,7 +109,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
FILE
;
let
type
=
mediaLibrary
.
MediaType
.
FILE
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -173,7 +173,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -173,7 +173,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
FILE
;
let
type
=
mediaLibrary
.
MediaType
.
FILE
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -243,7 +243,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -243,7 +243,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
ALBUM
;
let
type
=
mediaLibrary
.
MediaType
.
ALBUM
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -278,7 +278,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -278,7 +278,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
ALBUM
;
let
type
=
mediaLibrary
.
MediaType
.
ALBUM
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -313,7 +313,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -313,7 +313,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
ALBUM
;
let
type
=
mediaLibrary
.
MediaType
.
ALBUM
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -352,7 +352,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -352,7 +352,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try
{
try
{
let
fileType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
fileType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
fileFetchOp
=
{
let
fileFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()
],
selectionArgs
:
[
fileType
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fileFetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fileFetchOp
);
...
@@ -412,7 +412,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -412,7 +412,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
type
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -472,7 +472,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -472,7 +472,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
type
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -545,7 +545,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -545,7 +545,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try
{
try
{
let
fileType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
fileType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
fileFetchOp
=
{
let
fileFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()
],
selectionArgs
:
[
fileType
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fileFetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fileFetchOp
);
...
@@ -606,7 +606,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -606,7 +606,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
type
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -673,7 +673,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -673,7 +673,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
type
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -746,7 +746,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -746,7 +746,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try
{
try
{
let
fileType
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
fileType
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
fileFetchOp
=
{
let
fileFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()
],
selectionArgs
:
[
fileType
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fileFetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fileFetchOp
);
...
@@ -815,7 +815,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -815,7 +815,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
type
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -880,7 +880,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -880,7 +880,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
type
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -952,7 +952,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -952,7 +952,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
FILE
;
let
type
=
mediaLibrary
.
MediaType
.
FILE
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -1000,7 +1000,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -1000,7 +1000,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
type
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -1048,7 +1048,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -1048,7 +1048,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
type
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -1096,7 +1096,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -1096,7 +1096,7 @@ describe('fileAssetTestCallback.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
type
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetTestPromise.test.js
浏览文件 @
0f7b47fa
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
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
'
;
...
@@ -42,7 +42,7 @@ describe('fileAssetTestPromise.test.js', async function() {
...
@@ -42,7 +42,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try
{
try
{
let
fileType
=
mediaLibrary
.
MediaType
.
FILE
;
let
fileType
=
mediaLibrary
.
MediaType
.
FILE
;
let
fileFetchOp
=
{
let
fileFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()
],
selectionArgs
:
[
fileType
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fileFetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fileFetchOp
);
...
@@ -95,7 +95,7 @@ describe('fileAssetTestPromise.test.js', async function() {
...
@@ -95,7 +95,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
FILE
;
let
type
=
mediaLibrary
.
MediaType
.
FILE
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -136,7 +136,7 @@ describe('fileAssetTestPromise.test.js', async function() {
...
@@ -136,7 +136,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
FILE
;
let
type
=
mediaLibrary
.
MediaType
.
FILE
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -180,7 +180,7 @@ describe('fileAssetTestPromise.test.js', async function() {
...
@@ -180,7 +180,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
ALBUM
;
let
type
=
mediaLibrary
.
MediaType
.
ALBUM
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -212,7 +212,7 @@ describe('fileAssetTestPromise.test.js', async function() {
...
@@ -212,7 +212,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
ALBUM
;
let
type
=
mediaLibrary
.
MediaType
.
ALBUM
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -244,7 +244,7 @@ describe('fileAssetTestPromise.test.js', async function() {
...
@@ -244,7 +244,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
ALBUM
;
let
type
=
mediaLibrary
.
MediaType
.
ALBUM
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -281,7 +281,7 @@ describe('fileAssetTestPromise.test.js', async function() {
...
@@ -281,7 +281,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try
{
try
{
let
fileType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
fileType
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
fileFetchOp
=
{
let
fileFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()
],
selectionArgs
:
[
fileType
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fileFetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fileFetchOp
);
...
@@ -332,7 +332,7 @@ describe('fileAssetTestPromise.test.js', async function() {
...
@@ -332,7 +332,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
type
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -373,7 +373,7 @@ describe('fileAssetTestPromise.test.js', async function() {
...
@@ -373,7 +373,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
type
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -419,7 +419,7 @@ describe('fileAssetTestPromise.test.js', async function() {
...
@@ -419,7 +419,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try
{
try
{
let
fileType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
fileType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
fileFetchOp
=
{
let
fileFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()
],
selectionArgs
:
[
fileType
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fileFetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fileFetchOp
);
...
@@ -470,7 +470,7 @@ describe('fileAssetTestPromise.test.js', async function() {
...
@@ -470,7 +470,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
type
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -511,7 +511,7 @@ describe('fileAssetTestPromise.test.js', async function() {
...
@@ -511,7 +511,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
type
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -557,7 +557,7 @@ describe('fileAssetTestPromise.test.js', async function() {
...
@@ -557,7 +557,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try
{
try
{
let
fileType
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
fileType
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
fileFetchOp
=
{
let
fileFetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()
],
selectionArgs
:
[
fileType
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fileFetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fileFetchOp
);
...
@@ -616,7 +616,7 @@ describe('fileAssetTestPromise.test.js', async function() {
...
@@ -616,7 +616,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
type
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -660,7 +660,7 @@ describe('fileAssetTestPromise.test.js', async function() {
...
@@ -660,7 +660,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
type
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -709,7 +709,7 @@ describe('fileAssetTestPromise.test.js', async function() {
...
@@ -709,7 +709,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
FILE
;
let
type
=
mediaLibrary
.
MediaType
.
FILE
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -753,7 +753,7 @@ describe('fileAssetTestPromise.test.js', async function() {
...
@@ -753,7 +753,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
type
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -797,7 +797,7 @@ describe('fileAssetTestPromise.test.js', async function() {
...
@@ -797,7 +797,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
type
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -841,7 +841,7 @@ describe('fileAssetTestPromise.test.js', async function() {
...
@@ -841,7 +841,7 @@ describe('fileAssetTestPromise.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
type
=
mediaLibrary
.
MediaType
.
VIDEO
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetUriTestCallBack.test.js
浏览文件 @
0f7b47fa
...
@@ -41,7 +41,7 @@ describe('fileAssetUriTestCallback.test.js', async function() {
...
@@ -41,7 +41,7 @@ describe('fileAssetUriTestCallback.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
type
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
const
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
const
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -57,7 +57,7 @@ describe('fileAssetUriTestCallback.test.js', async function() {
...
@@ -57,7 +57,7 @@ describe('fileAssetUriTestCallback.test.js', async function() {
let
serchfetchOp
=
{
let
serchfetchOp
=
{
uri
:
serachUri
.
toString
(),
uri
:
serachUri
.
toString
(),
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()],
selectionArgs
:
[
type
.
toString
()],
};
};
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetUriTestPromiese.test.js
浏览文件 @
0f7b47fa
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
import
featureAbility
from
'
@ohos.ability.featureAbility
'
import
fileio
from
'
@ohos.fileio
'
;
import
fileio
from
'
@ohos.fileio
'
;
import
{
describe
,
it
,
expect
}
from
'
deccjsunit/index
'
;
import
{
describe
,
it
,
expect
}
from
'
deccjsunit/index
'
;
...
@@ -41,7 +41,7 @@ describe('fileAssetUriTestPromise.test.js', async function() {
...
@@ -41,7 +41,7 @@ describe('fileAssetUriTestPromise.test.js', async function() {
try
{
try
{
let
type
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
type
=
mediaLibrary
.
MediaType
.
IMAGE
;
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
const
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
const
fetchFileResult
=
await
media
.
getFileAssets
(
fetchOp
);
...
@@ -56,7 +56,7 @@ describe('fileAssetUriTestPromise.test.js', async function() {
...
@@ -56,7 +56,7 @@ describe('fileAssetUriTestPromise.test.js', async function() {
let
serchfetchOp
=
{
let
serchfetchOp
=
{
uri
:
serachUri
.
toString
(),
uri
:
serachUri
.
toString
(),
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
type
.
toString
()
],
selectionArgs
:
[
type
.
toString
()
],
};
};
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileTestCallBack.test.js
浏览文件 @
0f7b47fa
...
@@ -25,19 +25,19 @@ let videoType = mediaLibrary.MediaType.VIDEO;
...
@@ -25,19 +25,19 @@ let videoType = mediaLibrary.MediaType.VIDEO;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
imagesfetchOp
=
{
let
imagesfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
()],
};
};
let
videosfetchOp
=
{
let
videosfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
()],
selectionArgs
:
[
videoType
.
toString
()],
};
};
let
audiosfetchOp
=
{
let
audiosfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
audioType
.
toString
()],
selectionArgs
:
[
audioType
.
toString
()],
};
};
let
filesfetchOp
=
{
let
filesfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()],
selectionArgs
:
[
fileType
.
toString
()],
};
};
...
@@ -138,7 +138,7 @@ describe('fileTestCallBack.test.js', function () {
...
@@ -138,7 +138,7 @@ describe('fileTestCallBack.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_001_02
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_001_02
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
...
@@ -159,7 +159,7 @@ describe('fileTestCallBack.test.js', function () {
...
@@ -159,7 +159,7 @@ describe('fileTestCallBack.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_001_03
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_001_03
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
relativePath
==
path
).
assertTrue
();
expect
(
asset
.
relativePath
==
path
).
assertTrue
();
...
@@ -185,7 +185,7 @@ describe('fileTestCallBack.test.js', function () {
...
@@ -185,7 +185,7 @@ describe('fileTestCallBack.test.js', function () {
asset
.
title
=
`title_
${
new
Date
().
getTime
()}
`
;
asset
.
title
=
`title_
${
new
Date
().
getTime
()}
`
;
asset
.
commitModify
(
async
()
=>
{
asset
.
commitModify
(
async
()
=>
{
const
id
=
asset
.
id
;
const
id
=
asset
.
id
;
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
newAssets
=
await
media
.
getFileAssets
(
idOP
);
const
newAssets
=
await
media
.
getFileAssets
(
idOP
);
const
newdataList
=
await
newAssets
.
getAllObject
();
const
newdataList
=
await
newAssets
.
getAllObject
();
const
newAsset
=
newdataList
[
0
];
const
newAsset
=
newdataList
[
0
];
...
@@ -225,7 +225,7 @@ describe('fileTestCallBack.test.js', function () {
...
@@ -225,7 +225,7 @@ describe('fileTestCallBack.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_001_08
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_001_08
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
mediaType
==
mediaType
).
assertTrue
();
expect
(
asset
.
mediaType
==
mediaType
).
assertTrue
();
...
@@ -245,7 +245,7 @@ describe('fileTestCallBack.test.js', function () {
...
@@ -245,7 +245,7 @@ describe('fileTestCallBack.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_001_11
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_001_11
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
orientation
==
orientation
).
assertTrue
();
expect
(
asset
.
orientation
==
orientation
).
assertTrue
();
...
@@ -319,7 +319,7 @@ describe('fileTestCallBack.test.js', function () {
...
@@ -319,7 +319,7 @@ describe('fileTestCallBack.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_002_02
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_002_02
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
...
@@ -340,7 +340,7 @@ describe('fileTestCallBack.test.js', function () {
...
@@ -340,7 +340,7 @@ describe('fileTestCallBack.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_002_03
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_002_03
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
...
@@ -367,7 +367,7 @@ describe('fileTestCallBack.test.js', function () {
...
@@ -367,7 +367,7 @@ describe('fileTestCallBack.test.js', function () {
asset
.
title
=
`title_
${
new
Date
().
getTime
()}
`
;
asset
.
title
=
`title_
${
new
Date
().
getTime
()}
`
;
asset
.
commitModify
(
async
()
=>
{
asset
.
commitModify
(
async
()
=>
{
const
id
=
asset
.
id
;
const
id
=
asset
.
id
;
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
newAssets
=
await
media
.
getFileAssets
(
idOP
);
const
newAssets
=
await
media
.
getFileAssets
(
idOP
);
const
newdataList
=
await
newAssets
.
getAllObject
();
const
newdataList
=
await
newAssets
.
getAllObject
();
const
newAsset
=
newdataList
[
0
];
const
newAsset
=
newdataList
[
0
];
...
@@ -407,7 +407,7 @@ describe('fileTestCallBack.test.js', function () {
...
@@ -407,7 +407,7 @@ describe('fileTestCallBack.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_002_08
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_002_08
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
mediaType
==
mediaType
).
assertTrue
();
expect
(
asset
.
mediaType
==
mediaType
).
assertTrue
();
...
@@ -427,7 +427,7 @@ describe('fileTestCallBack.test.js', function () {
...
@@ -427,7 +427,7 @@ describe('fileTestCallBack.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_002_11
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_002_11
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
orientation
==
orientation
).
assertTrue
();
expect
(
asset
.
orientation
==
orientation
).
assertTrue
();
...
@@ -495,7 +495,7 @@ describe('fileTestCallBack.test.js', function () {
...
@@ -495,7 +495,7 @@ describe('fileTestCallBack.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_003_02
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_003_02
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
displayName
==
displayName
).
assertTrue
();
expect
(
asset
.
displayName
==
displayName
).
assertTrue
();
...
@@ -516,7 +516,7 @@ describe('fileTestCallBack.test.js', function () {
...
@@ -516,7 +516,7 @@ describe('fileTestCallBack.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_003_03
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_003_03
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
relativePath
==
path
).
assertTrue
();
expect
(
asset
.
relativePath
==
path
).
assertTrue
();
...
@@ -542,7 +542,7 @@ describe('fileTestCallBack.test.js', function () {
...
@@ -542,7 +542,7 @@ describe('fileTestCallBack.test.js', function () {
asset
.
title
=
`title_
${
new
Date
().
getTime
()}
`
;
asset
.
title
=
`title_
${
new
Date
().
getTime
()}
`
;
asset
.
commitModify
(
async
()
=>
{
asset
.
commitModify
(
async
()
=>
{
const
id
=
asset
.
id
;
const
id
=
asset
.
id
;
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
newAssets
=
await
media
.
getFileAssets
(
idOP
);
const
newAssets
=
await
media
.
getFileAssets
(
idOP
);
const
newdataList
=
await
newAssets
.
getAllObject
();
const
newdataList
=
await
newAssets
.
getAllObject
();
const
newAsset
=
newdataList
[
0
];
const
newAsset
=
newdataList
[
0
];
...
@@ -582,7 +582,7 @@ describe('fileTestCallBack.test.js', function () {
...
@@ -582,7 +582,7 @@ describe('fileTestCallBack.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_003_08
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_003_08
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
mediaType
==
mediaType
).
assertTrue
();
expect
(
asset
.
mediaType
==
mediaType
).
assertTrue
();
...
@@ -650,7 +650,7 @@ describe('fileTestCallBack.test.js', function () {
...
@@ -650,7 +650,7 @@ describe('fileTestCallBack.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_004_02
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_004_02
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
displayName
==
displayName
).
assertTrue
();
expect
(
asset
.
displayName
==
displayName
).
assertTrue
();
...
@@ -670,7 +670,7 @@ describe('fileTestCallBack.test.js', function () {
...
@@ -670,7 +670,7 @@ describe('fileTestCallBack.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_004_03
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_004_03
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
relativePath
==
path
).
assertTrue
();
expect
(
asset
.
relativePath
==
path
).
assertTrue
();
...
@@ -696,7 +696,7 @@ describe('fileTestCallBack.test.js', function () {
...
@@ -696,7 +696,7 @@ describe('fileTestCallBack.test.js', function () {
asset
.
title
=
`title_
${
new
Date
().
getTime
()}
`
;
asset
.
title
=
`title_
${
new
Date
().
getTime
()}
`
;
asset
.
commitModify
(
async
()
=>
{
asset
.
commitModify
(
async
()
=>
{
const
id
=
asset
.
id
;
const
id
=
asset
.
id
;
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
newAssets
=
await
media
.
getFileAssets
(
idOP
);
const
newAssets
=
await
media
.
getFileAssets
(
idOP
);
const
newdataList
=
await
newAssets
.
getAllObject
();
const
newdataList
=
await
newAssets
.
getAllObject
();
const
newAsset
=
newdataList
[
0
];
const
newAsset
=
newdataList
[
0
];
...
@@ -736,7 +736,7 @@ describe('fileTestCallBack.test.js', function () {
...
@@ -736,7 +736,7 @@ describe('fileTestCallBack.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_004_08
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_CALLBACK_004_08
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
mediaType
==
mediaType
).
assertTrue
();
expect
(
asset
.
mediaType
==
mediaType
).
assertTrue
();
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileTestPromise.test.js
浏览文件 @
0f7b47fa
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
fileio
from
'
@ohos.fileio
'
;
import
fileio
from
'
@ohos.fileio
'
;
...
@@ -25,19 +25,19 @@ let videoType = mediaLibrary.MediaType.VIDEO;
...
@@ -25,19 +25,19 @@ let videoType = mediaLibrary.MediaType.VIDEO;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
imagesfetchOp
=
{
let
imagesfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
()],
};
};
let
videosfetchOp
=
{
let
videosfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
()],
selectionArgs
:
[
videoType
.
toString
()],
};
};
let
audiosfetchOp
=
{
let
audiosfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
audioType
.
toString
()],
selectionArgs
:
[
audioType
.
toString
()],
};
};
let
filesfetchOp
=
{
let
filesfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()],
selectionArgs
:
[
fileType
.
toString
()],
};
};
...
@@ -131,7 +131,7 @@ describe('fileTestPromise.test.js', function () {
...
@@ -131,7 +131,7 @@ describe('fileTestPromise.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_001_02
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_001_02
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
...
@@ -152,7 +152,7 @@ describe('fileTestPromise.test.js', function () {
...
@@ -152,7 +152,7 @@ describe('fileTestPromise.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_001_03
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_001_03
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
relativePath
==
path
).
assertTrue
();
expect
(
asset
.
relativePath
==
path
).
assertTrue
();
...
@@ -178,7 +178,7 @@ describe('fileTestPromise.test.js', function () {
...
@@ -178,7 +178,7 @@ describe('fileTestPromise.test.js', function () {
asset
.
title
=
`title_
${
new
Date
().
getTime
()}
`
;
asset
.
title
=
`title_
${
new
Date
().
getTime
()}
`
;
await
asset
.
commitModify
();
await
asset
.
commitModify
();
const
id
=
asset
.
id
;
const
id
=
asset
.
id
;
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
newAssets
=
await
media
.
getFileAssets
(
idOP
);
const
newAssets
=
await
media
.
getFileAssets
(
idOP
);
const
newdataList
=
await
newAssets
.
getAllObject
();
const
newdataList
=
await
newAssets
.
getAllObject
();
const
newAsset
=
newdataList
[
0
];
const
newAsset
=
newdataList
[
0
];
...
@@ -217,7 +217,7 @@ describe('fileTestPromise.test.js', function () {
...
@@ -217,7 +217,7 @@ describe('fileTestPromise.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_001_08
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_001_08
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
mediaType
==
mediaType
).
assertTrue
();
expect
(
asset
.
mediaType
==
mediaType
).
assertTrue
();
...
@@ -237,7 +237,7 @@ describe('fileTestPromise.test.js', function () {
...
@@ -237,7 +237,7 @@ describe('fileTestPromise.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_001_11
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_001_11
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
orientation
==
orientation
).
assertTrue
();
expect
(
asset
.
orientation
==
orientation
).
assertTrue
();
...
@@ -304,7 +304,7 @@ describe('fileTestPromise.test.js', function () {
...
@@ -304,7 +304,7 @@ describe('fileTestPromise.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_002_02
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_002_02
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
...
@@ -325,7 +325,7 @@ describe('fileTestPromise.test.js', function () {
...
@@ -325,7 +325,7 @@ describe('fileTestPromise.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_002_03
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_002_03
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
...
@@ -352,7 +352,7 @@ describe('fileTestPromise.test.js', function () {
...
@@ -352,7 +352,7 @@ describe('fileTestPromise.test.js', function () {
asset
.
title
=
`title_
${
new
Date
().
getTime
()}
`
;
asset
.
title
=
`title_
${
new
Date
().
getTime
()}
`
;
await
asset
.
commitModify
();
await
asset
.
commitModify
();
const
id
=
asset
.
id
;
const
id
=
asset
.
id
;
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
newAssets
=
await
media
.
getFileAssets
(
idOP
);
const
newAssets
=
await
media
.
getFileAssets
(
idOP
);
const
newdataList
=
await
newAssets
.
getAllObject
();
const
newdataList
=
await
newAssets
.
getAllObject
();
const
newAsset
=
newdataList
[
0
];
const
newAsset
=
newdataList
[
0
];
...
@@ -391,7 +391,7 @@ describe('fileTestPromise.test.js', function () {
...
@@ -391,7 +391,7 @@ describe('fileTestPromise.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_002_08
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_002_08
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
mediaType
==
mediaType
).
assertTrue
();
expect
(
asset
.
mediaType
==
mediaType
).
assertTrue
();
...
@@ -411,7 +411,7 @@ describe('fileTestPromise.test.js', function () {
...
@@ -411,7 +411,7 @@ describe('fileTestPromise.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_002_11
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_002_11
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
orientation
==
orientation
).
assertTrue
();
expect
(
asset
.
orientation
==
orientation
).
assertTrue
();
...
@@ -476,7 +476,7 @@ describe('fileTestPromise.test.js', function () {
...
@@ -476,7 +476,7 @@ describe('fileTestPromise.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_003_02
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_003_02
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
displayName
==
displayName
).
assertTrue
();
expect
(
asset
.
displayName
==
displayName
).
assertTrue
();
...
@@ -497,7 +497,7 @@ describe('fileTestPromise.test.js', function () {
...
@@ -497,7 +497,7 @@ describe('fileTestPromise.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_003_03
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_003_03
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
relativePath
==
path
).
assertTrue
();
expect
(
asset
.
relativePath
==
path
).
assertTrue
();
...
@@ -524,7 +524,7 @@ describe('fileTestPromise.test.js', function () {
...
@@ -524,7 +524,7 @@ describe('fileTestPromise.test.js', function () {
await
asset
.
commitModify
();
await
asset
.
commitModify
();
const
id
=
asset
.
id
;
const
id
=
asset
.
id
;
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
newAssets
=
await
media
.
getFileAssets
(
idOP
);
const
newAssets
=
await
media
.
getFileAssets
(
idOP
);
const
newdataList
=
await
newAssets
.
getAllObject
();
const
newdataList
=
await
newAssets
.
getAllObject
();
const
newAsset
=
newdataList
[
0
];
const
newAsset
=
newdataList
[
0
];
...
@@ -563,7 +563,7 @@ describe('fileTestPromise.test.js', function () {
...
@@ -563,7 +563,7 @@ describe('fileTestPromise.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_003_08
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_003_08
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
mediaType
==
mediaType
).
assertTrue
();
expect
(
asset
.
mediaType
==
mediaType
).
assertTrue
();
...
@@ -629,7 +629,7 @@ describe('fileTestPromise.test.js', function () {
...
@@ -629,7 +629,7 @@ describe('fileTestPromise.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_004_02
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_004_02
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
displayName
==
displayName
).
assertTrue
();
expect
(
asset
.
displayName
==
displayName
).
assertTrue
();
...
@@ -649,7 +649,7 @@ describe('fileTestPromise.test.js', function () {
...
@@ -649,7 +649,7 @@ describe('fileTestPromise.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_004_03
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_004_03
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
relativePath
==
path
).
assertTrue
();
expect
(
asset
.
relativePath
==
path
).
assertTrue
();
...
@@ -675,7 +675,7 @@ describe('fileTestPromise.test.js', function () {
...
@@ -675,7 +675,7 @@ describe('fileTestPromise.test.js', function () {
asset
.
title
=
`title_
${
new
Date
().
getTime
()}
`
;
asset
.
title
=
`title_
${
new
Date
().
getTime
()}
`
;
await
asset
.
commitModify
();
await
asset
.
commitModify
();
const
id
=
asset
.
id
;
const
id
=
asset
.
id
;
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
newAssets
=
await
media
.
getFileAssets
(
idOP
);
const
newAssets
=
await
media
.
getFileAssets
(
idOP
);
const
newdataList
=
await
newAssets
.
getAllObject
();
const
newdataList
=
await
newAssets
.
getAllObject
();
const
newAsset
=
newdataList
[
0
];
const
newAsset
=
newdataList
[
0
];
...
@@ -714,7 +714,7 @@ describe('fileTestPromise.test.js', function () {
...
@@ -714,7 +714,7 @@ describe('fileTestPromise.test.js', function () {
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_004_08
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_CREATEASSET_PROMISE_004_08
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
idOP
=
{
selections
:
fileKeyObj
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
idOP
=
{
selections
:
mediaLibrary
.
FileKey
.
ID
+
'
= ?
'
,
selectionArgs
:
[
''
+
id
]
};
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
fileAssets
=
await
media
.
getFileAssets
(
idOP
);
const
asset
=
await
fileAssets
.
getFirstObject
();
const
asset
=
await
fileAssets
.
getFirstObject
();
expect
(
asset
.
mediaType
==
mediaType
).
assertTrue
();
expect
(
asset
.
mediaType
==
mediaType
).
assertTrue
();
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/filekeyTestCallBack.test.js
浏览文件 @
0f7b47fa
...
@@ -25,17 +25,17 @@ let videoType = mediaLibrary.MediaType.VIDEO;
...
@@ -25,17 +25,17 @@ let videoType = mediaLibrary.MediaType.VIDEO;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
imagesfetchOp
=
{
let
imagesfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
()],
};
};
let
videosfetchOp
=
{
let
videosfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
()],
selectionArgs
:
[
videoType
.
toString
()],
};
};
let
audiosfetchOp
=
{
let
audiosfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
audioType
.
toString
()],
selectionArgs
:
[
audioType
.
toString
()],
};
};
let
allsfetchOp
=
{
let
allsfetchOp
=
{
...
@@ -72,7 +72,7 @@ async function getFileAssetsBy(done, type) {
...
@@ -72,7 +72,7 @@ async function getFileAssetsBy(done, type) {
const
fetchFileResult
=
await
media
.
getFileAssets
(
assetOp
);
const
fetchFileResult
=
await
media
.
getFileAssets
(
assetOp
);
const
asset
=
await
fetchFileResult
.
getFirstObject
();
const
asset
=
await
fetchFileResult
.
getFirstObject
();
let
Op
=
{
let
Op
=
{
selections
:
fileKeyObj
[
filekeys
[
type
]]
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
[
filekeys
[
type
]]
+
'
= ?
'
,
selectionArgs
:
[
asset
[
type
]
+
''
],
selectionArgs
:
[
asset
[
type
]
+
''
],
};
};
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/filekeyTestPromise.test.js
浏览文件 @
0f7b47fa
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* limitations under the License.
* limitations under the License.
*/
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
;
...
@@ -25,17 +25,17 @@ let videoType = mediaLibrary.MediaType.VIDEO;
...
@@ -25,17 +25,17 @@ let videoType = mediaLibrary.MediaType.VIDEO;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
audioType
=
mediaLibrary
.
MediaType
.
AUDIO
;
let
imagesfetchOp
=
{
let
imagesfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
()],
};
};
let
videosfetchOp
=
{
let
videosfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
()],
selectionArgs
:
[
videoType
.
toString
()],
};
};
let
audiosfetchOp
=
{
let
audiosfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
audioType
.
toString
()],
selectionArgs
:
[
audioType
.
toString
()],
};
};
let
allsfetchOp
=
{
let
allsfetchOp
=
{
...
@@ -72,7 +72,7 @@ async function getFileAssetsBy(done, type) {
...
@@ -72,7 +72,7 @@ async function getFileAssetsBy(done, type) {
const
fetchFileResult
=
await
media
.
getFileAssets
(
assetOp
);
const
fetchFileResult
=
await
media
.
getFileAssets
(
assetOp
);
const
asset
=
await
fetchFileResult
.
getFirstObject
();
const
asset
=
await
fetchFileResult
.
getFirstObject
();
let
Op
=
{
let
Op
=
{
selections
:
fileKeyObj
[
filekeys
[
type
]]
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
[
filekeys
[
type
]]
+
'
= ?
'
,
selectionArgs
:
[
asset
[
type
]
+
''
],
selectionArgs
:
[
asset
[
type
]
+
''
],
};
};
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/mediaLibraryTestCallBack.test.js
浏览文件 @
0f7b47fa
...
@@ -18,9 +18,9 @@ import fileio from '@ohos.fileio';
...
@@ -18,9 +18,9 @@ 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
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
PATH
+
'
LIKE ?
'
,
selections
:
mediaLibrary
.
FileKey
.
PATH
+
'
LIKE ?
'
,
selectionArgs
:
[
'
/data/media/%
'
],
selectionArgs
:
[
'
/data/media/%
'
],
order
:
fileKeyObj
.
PATH
,
order
:
mediaLibrary
.
FileKey
.
PATH
,
};
};
// let directoryTypeObj = mediaLibrary.DirectoryType;
// let directoryTypeObj = mediaLibrary.DirectoryType;
...
@@ -36,45 +36,45 @@ let audioType = mediaLibrary.MediaType.AUDIO;
...
@@ -36,45 +36,45 @@ let audioType = mediaLibrary.MediaType.AUDIO;
let
fileType
=
mediaLibrary
.
MediaType
.
FILE
;
let
fileType
=
mediaLibrary
.
MediaType
.
FILE
;
let
imagesfetchOp
=
{
let
imagesfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
()],
};
};
let
videosfetchOp
=
{
let
videosfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
()],
selectionArgs
:
[
videoType
.
toString
()],
};
};
let
audiosfetchOp
=
{
let
audiosfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
audioType
.
toString
()],
selectionArgs
:
[
audioType
.
toString
()],
};
};
let
filesfetchOp
=
{
let
filesfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()],
selectionArgs
:
[
fileType
.
toString
()],
};
};
let
imageAndVideofetchOp
=
{
let
imageAndVideofetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
(),
videoType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
(),
videoType
.
toString
()],
};
};
let
imageAndVideoAndfilefetchOp
=
{
let
imageAndVideoAndfilefetchOp
=
{
selections
:
selections
:
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
(),
videoType
.
toString
(),
fileType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
(),
videoType
.
toString
(),
fileType
.
toString
()],
};
};
let
imageAndVideoAndfileAndAudiofetchOp
=
{
let
imageAndVideoAndfileAndAudiofetchOp
=
{
selections
:
selections
:
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
'
= ?
'
,
selectionArgs
:
[
selectionArgs
:
[
imageType
.
toString
(),
imageType
.
toString
(),
...
@@ -267,7 +267,7 @@ describe('mediaLibraryTestCallBack.test.js', function () {
...
@@ -267,7 +267,7 @@ describe('mediaLibraryTestCallBack.test.js', function () {
*/
*/
it
(
'
SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETFILEASSETS_008
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETFILEASSETS_008
'
,
0
,
async
function
(
done
)
{
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
abc= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
abc= ?
'
,
selectionArgs
:
[
'
abc
'
],
selectionArgs
:
[
'
abc
'
],
};
};
try
{
try
{
...
@@ -292,7 +292,7 @@ describe('mediaLibraryTestCallBack.test.js', function () {
...
@@ -292,7 +292,7 @@ describe('mediaLibraryTestCallBack.test.js', function () {
*/
*/
it
(
'
SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETFILEASSETS_009
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETFILEASSETS_009
'
,
0
,
async
function
(
done
)
{
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
abc= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
abc= ? or
'
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
'
abc
'
,
audioType
.
toString
()],
selectionArgs
:
[
'
abc
'
,
audioType
.
toString
()],
};
};
try
{
try
{
...
@@ -318,11 +318,11 @@ describe('mediaLibraryTestCallBack.test.js', function () {
...
@@ -318,11 +318,11 @@ describe('mediaLibraryTestCallBack.test.js', function () {
it
(
'
SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETFILEASSETS_010
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETFILEASSETS_010
'
,
0
,
async
function
(
done
)
{
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
selections
:
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
abc= ? or
'
+
'
abc= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
'
= ?
'
,
selectionArgs
:
[
'
abc
'
,
videoType
.
toString
(),
fileType
.
toString
()],
selectionArgs
:
[
'
abc
'
,
videoType
.
toString
(),
fileType
.
toString
()],
};
};
...
@@ -349,13 +349,13 @@ describe('mediaLibraryTestCallBack.test.js', function () {
...
@@ -349,13 +349,13 @@ describe('mediaLibraryTestCallBack.test.js', function () {
it
(
'
SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETFILEASSETS_011
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB__MEDIA_MIDIALIBRARY_CALLBACK_GETFILEASSETS_011
'
,
0
,
async
function
(
done
)
{
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
selections
:
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
abc= ? or
'
+
'
abc= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
'
= ?
'
,
selectionArgs
:
[
'
abc
'
,
videoType
.
toString
(),
fileType
.
toString
(),
audioType
.
toString
()],
selectionArgs
:
[
'
abc
'
,
videoType
.
toString
(),
fileType
.
toString
(),
audioType
.
toString
()],
};
};
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/mediaLibraryTestPromise.test.js
浏览文件 @
0f7b47fa
...
@@ -12,15 +12,15 @@
...
@@ -12,15 +12,15 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
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
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
PATH
+
'
LIKE ?
'
,
selections
:
mediaLibrary
.
FileKey
.
PATH
+
'
LIKE ?
'
,
selectionArgs
:
[
'
/data/media/%
'
],
selectionArgs
:
[
'
/data/media/%
'
],
order
:
fileKeyObj
.
PATH
,
order
:
mediaLibrary
.
FileKey
.
PATH
,
};
};
// let directoryTypeObj = mediaLibrary.DirectoryType;
// let directoryTypeObj = mediaLibrary.DirectoryType;
...
@@ -36,45 +36,45 @@ let audioType = mediaLibrary.MediaType.AUDIO;
...
@@ -36,45 +36,45 @@ let audioType = mediaLibrary.MediaType.AUDIO;
let
fileType
=
mediaLibrary
.
MediaType
.
FILE
;
let
fileType
=
mediaLibrary
.
MediaType
.
FILE
;
let
imagesfetchOp
=
{
let
imagesfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
()],
};
};
let
videosfetchOp
=
{
let
videosfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
()],
selectionArgs
:
[
videoType
.
toString
()],
};
};
let
audiosfetchOp
=
{
let
audiosfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
audioType
.
toString
()],
selectionArgs
:
[
audioType
.
toString
()],
};
};
let
filesfetchOp
=
{
let
filesfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()],
selectionArgs
:
[
fileType
.
toString
()],
};
};
let
imageAndVideofetchOp
=
{
let
imageAndVideofetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
(),
videoType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
(),
videoType
.
toString
()],
};
};
let
imageAndVideoAndfilefetchOp
=
{
let
imageAndVideoAndfilefetchOp
=
{
selections
:
selections
:
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
(),
videoType
.
toString
(),
fileType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
(),
videoType
.
toString
(),
fileType
.
toString
()],
};
};
let
imageAndVideoAndfileAndAudiofetchOp
=
{
let
imageAndVideoAndfileAndAudiofetchOp
=
{
selections
:
selections
:
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
'
= ?
'
,
selectionArgs
:
[
selectionArgs
:
[
imageType
.
toString
(),
imageType
.
toString
(),
...
@@ -100,10 +100,10 @@ describe('mediaLibraryTestPromise.test.js', function () {
...
@@ -100,10 +100,10 @@ describe('mediaLibraryTestPromise.test.js', function () {
const
context
=
featureAbility
.
getContext
();
const
context
=
featureAbility
.
getContext
();
const
media
=
mediaLibrary
.
getMediaLibrary
(
context
);
const
media
=
mediaLibrary
.
getMediaLibrary
(
context
);
beforeAll
(
function
()
{});
beforeAll
(
function
()
{
});
beforeEach
(
function
()
{});
beforeEach
(
function
()
{
});
afterEach
(
function
()
{});
afterEach
(
function
()
{
});
afterAll
(
function
()
{});
afterAll
(
function
()
{
});
var
timestamp
=
new
Date
().
getTime
();
var
timestamp
=
new
Date
().
getTime
();
var
jpgName
=
timestamp
+
'
.jpg
'
;
var
jpgName
=
timestamp
+
'
.jpg
'
;
...
@@ -280,7 +280,7 @@ describe('mediaLibraryTestPromise.test.js', function () {
...
@@ -280,7 +280,7 @@ describe('mediaLibraryTestPromise.test.js', function () {
*/
*/
it
(
'
SUB__MEDIA_MIDIALIBRARY_PROMISE_GETFILEASSETS_008
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB__MEDIA_MIDIALIBRARY_PROMISE_GETFILEASSETS_008
'
,
0
,
async
function
(
done
)
{
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
abc= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
abc= ?
'
,
selectionArgs
:
[
'
abc
'
],
selectionArgs
:
[
'
abc
'
],
};
};
try
{
try
{
...
@@ -305,7 +305,7 @@ describe('mediaLibraryTestPromise.test.js', function () {
...
@@ -305,7 +305,7 @@ describe('mediaLibraryTestPromise.test.js', function () {
*/
*/
it
(
'
SUB__MEDIA_MIDIALIBRARY_PROMISE_GETFILEASSETS_009
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB__MEDIA_MIDIALIBRARY_PROMISE_GETFILEASSETS_009
'
,
0
,
async
function
(
done
)
{
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
abc= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
abc= ? or
'
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
'
abc
'
,
audioType
.
toString
()],
selectionArgs
:
[
'
abc
'
,
audioType
.
toString
()],
};
};
try
{
try
{
...
@@ -331,11 +331,11 @@ describe('mediaLibraryTestPromise.test.js', function () {
...
@@ -331,11 +331,11 @@ describe('mediaLibraryTestPromise.test.js', function () {
it
(
'
SUB__MEDIA_MIDIALIBRARY_PROMISE_GETFILEASSETS_010
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB__MEDIA_MIDIALIBRARY_PROMISE_GETFILEASSETS_010
'
,
0
,
async
function
(
done
)
{
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
selections
:
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
abc= ? or
'
+
'
abc= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
'
= ?
'
,
selectionArgs
:
[
'
abc
'
,
videoType
.
toString
(),
fileType
.
toString
()],
selectionArgs
:
[
'
abc
'
,
videoType
.
toString
(),
fileType
.
toString
()],
};
};
...
@@ -362,13 +362,13 @@ describe('mediaLibraryTestPromise.test.js', function () {
...
@@ -362,13 +362,13 @@ describe('mediaLibraryTestPromise.test.js', function () {
it
(
'
SUB__MEDIA_MIDIALIBRARY_PROMISE_GETFILEASSETS_011
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB__MEDIA_MIDIALIBRARY_PROMISE_GETFILEASSETS_011
'
,
0
,
async
function
(
done
)
{
let
fetchOp
=
{
let
fetchOp
=
{
selections
:
selections
:
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
abc= ? or
'
+
'
abc= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ? or
'
+
'
= ? or
'
+
fileKeyObj
.
MEDIA_TYPE
+
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
'
= ?
'
,
selectionArgs
:
[
'
abc
'
,
videoType
.
toString
(),
fileType
.
toString
(),
audioType
.
toString
()],
selectionArgs
:
[
'
abc
'
,
videoType
.
toString
(),
fileType
.
toString
(),
audioType
.
toString
()],
};
};
...
@@ -769,18 +769,18 @@ describe('mediaLibraryTestPromise.test.js', function () {
...
@@ -769,18 +769,18 @@ describe('mediaLibraryTestPromise.test.js', function () {
}
}
});
});
/**
/**
* @tc.number : SUB__MEDIA_MIDIALIBRARY_PROMISE_CREATEASSET_001
* @tc.number : SUB__MEDIA_MIDIALIBRARY_PROMISE_CREATEASSET_001
* @tc.name : createAsset
* @tc.name : createAsset
* @tc.desc : Create File Asset image (does not exist)
* @tc.desc : Create File Asset image (does not exist)
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.type : Function
* @tc.level : Level 0
* @tc.level : Level 0
*/
*/
it
(
'
SUB__MEDIA_MIDIALIBRARY_PROMISE_CREATEASSET_009
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB__MEDIA_MIDIALIBRARY_PROMISE_CREATEASSET_009
'
,
0
,
async
function
(
done
)
{
try
{
try
{
const
path
=
await
media
.
getPublicDirectory
(
mediaLibrary
.
DirectoryType
.
DIR_IMAGE
);
const
path
=
await
media
.
getPublicDirectory
(
mediaLibrary
.
DirectoryType
.
DIR_IMAGE
);
const
filePath
=
path
+
"
image/
"
;
const
filePath
=
path
+
"
image/
"
;
const
fileAssets
=
await
media
.
getFileAssets
(
videosfetchOp
);
const
fileAssets
=
await
media
.
getFileAssets
(
videosfetchOp
);
const
dataList
=
await
fileAssets
.
getAllObject
();
const
dataList
=
await
fileAssets
.
getAllObject
();
const
asset1
=
dataList
[
0
];
const
asset1
=
dataList
[
0
];
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/mediaLibraryTestPromiseOnOff.test.js
浏览文件 @
0f7b47fa
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
import
mediaLibrary
from
'
@ohos.multimedia.media
l
ibrary
'
;
import
mediaLibrary
from
'
@ohos.multimedia.media
L
ibrary
'
;
import
featureAbility
from
'
@ohos.ability.featureAbility
'
;
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
'
;
...
@@ -31,19 +31,19 @@ describe('mediaLibraryTestPromiseOnOff.test.js', async function () {
...
@@ -31,19 +31,19 @@ describe('mediaLibraryTestPromiseOnOff.test.js', async function () {
let
fileType
=
mediaLibrary
.
MediaType
.
FILE
;
let
fileType
=
mediaLibrary
.
MediaType
.
FILE
;
let
imagesfetchOp
=
{
let
imagesfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
imageType
.
toString
()],
selectionArgs
:
[
imageType
.
toString
()],
};
};
let
videosfetchOp
=
{
let
videosfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
videoType
.
toString
()],
selectionArgs
:
[
videoType
.
toString
()],
};
};
let
audiosfetchOp
=
{
let
audiosfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
audioType
.
toString
()],
selectionArgs
:
[
audioType
.
toString
()],
};
};
let
filesfetchOp
=
{
let
filesfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
mediaLibrary
.
FileKey
.
MEDIA_TYPE
+
'
= ?
'
,
selectionArgs
:
[
fileType
.
toString
()],
selectionArgs
:
[
fileType
.
toString
()],
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录