Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
52e9daa9
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
1 年多 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
52e9daa9
编写于
3月 22, 2022
作者:
O
openharmony_ci
提交者:
Gitee
3月 22, 2022
浏览文件
操作
浏览文件
下载
差异文件
!2784 update xts code
Merge pull request !2784 from 潘强标/cherry-pick-1647954866
上级
d4be23ff
bd409864
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
75 addition
and
61 deletion
+75
-61
multimedia/medialibrary/mediaLibrary_js_standard/Test.json
multimedia/medialibrary/mediaLibrary_js_standard/Test.json
+21
-19
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/albumTestCallBack.test.js
...ry_js_standard/src/main/js/test/albumTestCallBack.test.js
+1
-1
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/albumTestPromise.test.js
...ary_js_standard/src/main/js/test/albumTestPromise.test.js
+1
-1
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/distributedCallback.test.js
..._js_standard/src/main/js/test/distributedCallback.test.js
+6
-0
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/distributedPromise.test.js
...y_js_standard/src/main/js/test/distributedPromise.test.js
+6
-0
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/favoriteTestCallBack.test.js
...js_standard/src/main/js/test/favoriteTestCallBack.test.js
+6
-6
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fetchFileResultCallBack.test.js
...standard/src/main/js/test/fetchFileResultCallBack.test.js
+16
-16
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fetchFileResultPromise.test.js
..._standard/src/main/js/test/fetchFileResultPromise.test.js
+16
-16
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetTestCallback.test.js
...s_standard/src/main/js/test/fileAssetTestCallback.test.js
+2
-2
未找到文件。
multimedia/medialibrary/mediaLibrary_js_standard/Test.json
浏览文件 @
52e9daa9
...
@@ -14,30 +14,32 @@
...
@@ -14,30 +14,32 @@
"push"
:
[
"push"
:
[
"./resource/medialibrary/01.jpg ->/storage/media/100/local/files"
,
"./resource/medialibrary/01.jpg ->/storage/media/100/local/files"
,
"./resource/medialibrary/01.mp3 ->/storage/media/100/local/files"
,
"./resource/medialibrary/01.mp3 ->/storage/media/100/local/files"
,
"./resource/medialibrary/01.mp4 ->/storage/media/100/local/files"
"./resource/medialibrary/01.mp4 ->/storage/media/100/local/files"
,
"./resource/medialibrary/test.dat ->/storage/media/100/local/files"
,
"./resource/medialibrary/test2.dat ->/storage/media/100/local/files"
]
]
},
},
{
{
"type"
:
"ShellKit"
,
"type"
:
"ShellKit"
,
"run-command"
:
[
"run-command"
:
[
"mkdir /storage/media/100/local/files/
p
ictures"
,
"mkdir /storage/media/100/local/files/
P
ictures"
,
"cp /storage/media/100/local/files/01.jpg /storage/media/100/local/files/
p
ictures/"
,
"cp /storage/media/100/local/files/01.jpg /storage/media/100/local/files/
P
ictures/"
,
"cp /storage/media/100/local/files/01.mp3 /storage/media/100/local/files/
p
ictures/"
,
"cp /storage/media/100/local/files/01.mp3 /storage/media/100/local/files/
P
ictures/"
,
"cp /storage/media/100/local/files/01.mp4 /storage/media/100/local/files/
p
ictures/"
,
"cp /storage/media/100/local/files/01.mp4 /storage/media/100/local/files/
P
ictures/"
,
"mkdir /storage/media/100/local/files/
p
ictures/weixin"
,
"mkdir /storage/media/100/local/files/
P
ictures/weixin"
,
"cp /storage/media/100/local/files/01.jpg /storage/media/100/local/files/
p
ictures/weixin"
,
"cp /storage/media/100/local/files/01.jpg /storage/media/100/local/files/
P
ictures/weixin"
,
"cp /storage/media/100/local/files/01.mp3 /storage/media/100/local/files/
p
ictures/weixin"
,
"cp /storage/media/100/local/files/01.mp3 /storage/media/100/local/files/
P
ictures/weixin"
,
"cp /storage/media/100/local/files/01.mp4 /storage/media/100/local/files/
p
ictures/weixin"
,
"cp /storage/media/100/local/files/01.mp4 /storage/media/100/local/files/
P
ictures/weixin"
,
"mkdir /storage/media/100/local/files/
c
amera"
,
"mkdir /storage/media/100/local/files/
C
amera"
,
"cp /storage/media/100/local/files/01.jpg /storage/media/100/local/files/
c
amera/01.jpg"
,
"cp /storage/media/100/local/files/01.jpg /storage/media/100/local/files/
C
amera/01.jpg"
,
"cp /storage/media/100/local/files/01.jpg /storage/media/100/local/files/
c
amera/02.jpg"
,
"cp /storage/media/100/local/files/01.jpg /storage/media/100/local/files/
C
amera/02.jpg"
,
"cp /storage/media/100/local/files/01.mp3 /storage/media/100/local/files/
c
amera/01.mp3"
,
"cp /storage/media/100/local/files/01.mp3 /storage/media/100/local/files/
C
amera/01.mp3"
,
"cp /storage/media/100/local/files/01.mp3 /storage/media/100/local/files/
c
amera/02.mp3"
,
"cp /storage/media/100/local/files/01.mp3 /storage/media/100/local/files/
C
amera/02.mp3"
,
"cp /storage/media/100/local/files/01.mp4 /storage/media/100/local/files/
c
amera/01.mp4"
,
"cp /storage/media/100/local/files/01.mp4 /storage/media/100/local/files/
C
amera/01.mp4"
,
"cp /storage/media/100/local/files/01.mp4 /storage/media/100/local/files/
c
amera/02.mp4"
,
"cp /storage/media/100/local/files/01.mp4 /storage/media/100/local/files/
C
amera/02.mp4"
,
"mkdir /storage/media/100/local/files/
File
"
,
"mkdir /storage/media/100/local/files/
Documents
"
,
"
touch /storage/media/100/local/files/File
/test.dat"
,
"
cp /storage/media/100/local/files/test.dat /storage/media/100/local/files/Documents
/test.dat"
,
"
touch /storage/media/100/local/files/File
/test2.dat"
,
"
cp /storage/media/100/local/files/test2.dat /storage/media/100/local/files/Documents
/test2.dat"
,
"chmod -R 777 /storage/media/100/local/files/*"
,
"chmod -R 777 /storage/media/100/local/files/*"
,
"chmod -R 777 /data/service/el2/100/hmdfs/account/files/*"
,
"chmod -R 777 /data/service/el2/100/hmdfs/account/files/*"
,
"killall com.ohos.medialibrary.MediaScannerAbilityA"
,
"killall com.ohos.medialibrary.MediaScannerAbilityA"
,
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/albumTestCallBack.test.js
浏览文件 @
52e9daa9
...
@@ -28,7 +28,7 @@ let allTypefetchOp = {
...
@@ -28,7 +28,7 @@ let allTypefetchOp = {
};
};
let
albumCoverUrifetchOp
=
{
let
albumCoverUrifetchOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ? AND
'
+
fileKeyObj
.
ALBUM_NAME
+
'
= ?
'
,
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ? AND
'
+
fileKeyObj
.
ALBUM_NAME
+
'
= ?
'
,
selectionArgs
:
[
'
p
ictures/
'
,
'
weixin
'
],
selectionArgs
:
[
'
P
ictures/
'
,
'
weixin
'
],
};
};
let
imageAlbumfetchOp
=
{
let
imageAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/albumTestPromise.test.js
浏览文件 @
52e9daa9
...
@@ -28,7 +28,7 @@ let allTypefetchOp = {
...
@@ -28,7 +28,7 @@ let allTypefetchOp = {
};
};
let
albumCoverUrifetchOp
=
{
let
albumCoverUrifetchOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ? AND
'
+
fileKeyObj
.
ALBUM_NAME
+
'
= ?
'
,
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ? AND
'
+
fileKeyObj
.
ALBUM_NAME
+
'
= ?
'
,
selectionArgs
:
[
'
p
ictures/
'
,
'
weixin
'
],
selectionArgs
:
[
'
P
ictures/
'
,
'
weixin
'
],
};
};
let
imageAlbumfetchOp
=
{
let
imageAlbumfetchOp
=
{
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
selections
:
fileKeyObj
.
MEDIA_TYPE
+
'
= ?
'
,
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/distributedCallback.test.js
浏览文件 @
52e9daa9
...
@@ -50,6 +50,9 @@ describe('distributedCallback.test.js', function() {
...
@@ -50,6 +50,9 @@ describe('distributedCallback.test.js', function() {
* @tc.level : Level 0
* @tc.level : Level 0
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_DISTRIBUTED_CALLBACK_001_01
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_DISTRIBUTED_CALLBACK_001_01
'
,
0
,
async
function
(
done
)
{
expect
(
true
).
assertTrue
();
done
();
return
;
try
{
try
{
done
();
done
();
console
.
info
(
'
MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_DISTRIBUTED_CALLBACK_001_01 begin
'
);
console
.
info
(
'
MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_DISTRIBUTED_CALLBACK_001_01 begin
'
);
...
@@ -75,6 +78,9 @@ describe('distributedCallback.test.js', function() {
...
@@ -75,6 +78,9 @@ describe('distributedCallback.test.js', function() {
* @tc.level : Level 0
* @tc.level : Level 0
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_DISTRIBUTED_CALLBACK_001_02
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_DISTRIBUTED_CALLBACK_001_02
'
,
0
,
async
function
(
done
)
{
expect
(
true
).
assertTrue
();
done
();
return
;
try
{
try
{
done
();
done
();
media
.
getAllPeers
((
error
,
peers
)
=>
{
media
.
getAllPeers
((
error
,
peers
)
=>
{
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/distributedPromise.test.js
浏览文件 @
52e9daa9
...
@@ -50,6 +50,9 @@ describe('distributedPromise.test.js', function() {
...
@@ -50,6 +50,9 @@ describe('distributedPromise.test.js', function() {
* @tc.level : Level 0
* @tc.level : Level 0
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_DISTRIBUTED_001_01
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_DISTRIBUTED_001_01
'
,
0
,
async
function
(
done
)
{
expect
(
true
).
assertTrue
();
done
();
return
;
try
{
try
{
done
();
done
();
console
.
info
(
'
MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_DISTRIBUTED_001_01 begin
'
);
console
.
info
(
'
MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_DISTRIBUTED_001_01 begin
'
);
...
@@ -72,6 +75,9 @@ describe('distributedPromise.test.js', function() {
...
@@ -72,6 +75,9 @@ describe('distributedPromise.test.js', function() {
* @tc.level : Level 0
* @tc.level : Level 0
*/
*/
it
(
'
SUB_MEDIA_MEDIALIBRARY_DISTRIBUTED_001_02
'
,
0
,
async
function
(
done
)
{
it
(
'
SUB_MEDIA_MEDIALIBRARY_DISTRIBUTED_001_02
'
,
0
,
async
function
(
done
)
{
expect
(
true
).
assertTrue
();
done
();
return
;
try
{
try
{
done
();
done
();
let
peers
=
await
media
.
getAllPeers
();
let
peers
=
await
media
.
getAllPeers
();
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/favoriteTestCallBack.test.js
浏览文件 @
52e9daa9
...
@@ -68,18 +68,18 @@ describe('favoriteTestCallBack.test.js', function () {
...
@@ -68,18 +68,18 @@ describe('favoriteTestCallBack.test.js', function () {
asset
.
favorite
(
false
,
()
=>
{
asset
.
favorite
(
false
,
()
=>
{
asset
.
isFavorite
((
err1
,
isFavorite
)
=>
{
asset
.
isFavorite
((
err1
,
isFavorite
)
=>
{
if
(
isFavorite
)
{
if
(
isFavorite
)
{
console
.
info
(
'
FAV_ASSET_CALLBACK 001_01 fail
'
);
console
.
info
(
'
FAV_ASSET_CALLBACK 001_01 fail
0
'
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
done
();
}
else
{
}
else
{
asset
.
favorite
(
true
,
()
=>
{
asset
.
favorite
(
true
,
()
=>
{
asset
.
isFavorite
((
err1
,
isFavorite
)
=>
{
asset
.
isFavorite
((
err1
,
isFavorite
)
=>
{
if
(
isFavorite
)
{
if
(
isFavorite
)
{
console
.
info
(
'
FAV_ASSET_CALLBACK 001_01 success
'
);
console
.
info
(
'
FAV_ASSET_CALLBACK 001_01 success
1
'
);
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
done
();
done
();
}
else
{
}
else
{
console
.
info
(
'
FAV_ASSET_CALLBACK 001_01 fail
'
);
console
.
info
(
'
FAV_ASSET_CALLBACK 001_01 fail
1
'
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
done
();
}
}
...
@@ -92,11 +92,11 @@ describe('favoriteTestCallBack.test.js', function () {
...
@@ -92,11 +92,11 @@ describe('favoriteTestCallBack.test.js', function () {
asset
.
favorite
(
true
,
()
=>
{
asset
.
favorite
(
true
,
()
=>
{
asset
.
isFavorite
((
err1
,
isFavorite
)
=>
{
asset
.
isFavorite
((
err1
,
isFavorite
)
=>
{
if
(
isFavorite
)
{
if
(
isFavorite
)
{
console
.
info
(
'
FAV_ASSET_CALLBACK 001_01 success
'
);
console
.
info
(
'
FAV_ASSET_CALLBACK 001_01 success
2
'
);
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
done
();
done
();
}
else
{
}
else
{
console
.
info
(
'
FAV_ASSET_CALLBACK 001_01 fail
'
);
console
.
info
(
'
FAV_ASSET_CALLBACK 001_01 fail
2
'
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
done
();
}
}
...
@@ -107,7 +107,7 @@ describe('favoriteTestCallBack.test.js', function () {
...
@@ -107,7 +107,7 @@ describe('favoriteTestCallBack.test.js', function () {
});
});
});
});
}
catch
(
error
)
{
}
catch
(
error
)
{
console
.
info
(
'
FAV_ASSET_CALLBACK 001_01 fail, message =
'
+
error
);
console
.
info
(
'
FAV_ASSET_CALLBACK 001_01 fail
3
, message =
'
+
error
);
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
done
();
}
}
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fetchFileResultCallBack.test.js
浏览文件 @
52e9daa9
...
@@ -53,28 +53,28 @@ let getFileCountOneHundredOp = {
...
@@ -53,28 +53,28 @@ let getFileCountOneHundredOp = {
let
getFirstObjectOp
=
{
let
getFirstObjectOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
'
c
amera/
'
],
selectionArgs
:
[
'
C
amera/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,5
"
,
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,5
"
,
extendArgs
:
""
,
extendArgs
:
""
,
}
}
let
getAllObjectLimitOneOp
=
{
let
getAllObjectLimitOneOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
'
c
amera/
'
],
selectionArgs
:
[
'
C
amera/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,1
"
,
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,1
"
,
extendArgs
:
""
,
extendArgs
:
""
,
}
}
let
getAllObjectLimitTwoOp
=
{
let
getAllObjectLimitTwoOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
'
c
amera/
'
],
selectionArgs
:
[
'
C
amera/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,1
"
,
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,1
"
,
extendArgs
:
""
,
extendArgs
:
""
,
}
}
let
getAllObjectLimitOneHundredOp
=
{
let
getAllObjectLimitOneHundredOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
'
c
amera/
'
],
selectionArgs
:
[
'
C
amera/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,100
"
,
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,100
"
,
extendArgs
:
""
,
extendArgs
:
""
,
}
}
...
@@ -86,7 +86,7 @@ let getFileCountZeroOp = {
...
@@ -86,7 +86,7 @@ let getFileCountZeroOp = {
let
getFileOp
=
{
let
getFileOp
=
{
selections
:
fileKeyObj
.
DISPLAY_NAME
+
'
= ? AND
'
+
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selections
:
fileKeyObj
.
DISPLAY_NAME
+
'
= ? AND
'
+
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
'
01.jpg
'
,
'
c
amera/
'
],
selectionArgs
:
[
'
01.jpg
'
,
'
C
amera/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,100
"
,
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,100
"
,
extendArgs
:
""
,
extendArgs
:
""
,
}
}
...
@@ -118,7 +118,7 @@ describe('fetchFileResultCallback.test.js', async function() {
...
@@ -118,7 +118,7 @@ describe('fetchFileResultCallback.test.js', async function() {
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 004 fail
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 004 fail
'
);
done
();
done
();
}
else
{
}
else
{
expect
(
firstObject
.
relativePath
==
'
c
amera/
'
).
assertTrue
();
expect
(
firstObject
.
relativePath
==
'
C
amera/
'
).
assertTrue
();
fetchFileResult
.
close
();
fetchFileResult
.
close
();
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getFirstObject 004 end
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getFirstObject 004 end
'
);
done
();
done
();
...
@@ -147,7 +147,7 @@ describe('fetchFileResultCallback.test.js', async function() {
...
@@ -147,7 +147,7 @@ describe('fetchFileResultCallback.test.js', async function() {
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 005 begin
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 005 begin
'
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
getFirstObjectOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
getFirstObjectOp
);
let
firstObject
=
await
fetchFileResult
.
getFirstObject
();
let
firstObject
=
await
fetchFileResult
.
getFirstObject
();
expect
(
firstObject
.
relativePath
==
'
c
amera/
'
).
assertTrue
();
expect
(
firstObject
.
relativePath
==
'
C
amera/
'
).
assertTrue
();
fetchFileResult
.
getNextObject
(
async
(
error
,
nextObject
)
=>
{
fetchFileResult
.
getNextObject
(
async
(
error
,
nextObject
)
=>
{
if
(
nextObject
==
undefined
)
{
if
(
nextObject
==
undefined
)
{
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
...
@@ -155,7 +155,7 @@ describe('fetchFileResultCallback.test.js', async function() {
...
@@ -155,7 +155,7 @@ describe('fetchFileResultCallback.test.js', async function() {
done
();
done
();
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 005 fail
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 005 fail
'
);
}
else
{
}
else
{
expect
(
nextObject
.
relativePath
==
'
c
amera/
'
).
assertTrue
();
expect
(
nextObject
.
relativePath
==
'
C
amera/
'
).
assertTrue
();
fetchFileResult
.
close
();
fetchFileResult
.
close
();
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 005 end
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 005 end
'
);
done
();
done
();
...
@@ -189,7 +189,7 @@ describe('fetchFileResultCallback.test.js', async function() {
...
@@ -189,7 +189,7 @@ describe('fetchFileResultCallback.test.js', async function() {
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 006 fail
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 006 fail
'
);
done
();
done
();
}
else
{
}
else
{
expect
(
lastObject
.
relativePath
==
'
c
amera/
'
).
assertTrue
();
expect
(
lastObject
.
relativePath
==
'
C
amera/
'
).
assertTrue
();
fetchFileResult
.
close
();
fetchFileResult
.
close
();
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 006 end
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 006 end
'
);
done
();
done
();
...
@@ -223,7 +223,7 @@ describe('fetchFileResultCallback.test.js', async function() {
...
@@ -223,7 +223,7 @@ describe('fetchFileResultCallback.test.js', async function() {
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 007_01 fail
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 007_01 fail
'
);
done
();
done
();
}
else
{
}
else
{
expect
(
targetObject
.
relativePath
==
'
c
amera/
'
).
assertTrue
();
expect
(
targetObject
.
relativePath
==
'
C
amera/
'
).
assertTrue
();
fetchFileResult
.
close
();
fetchFileResult
.
close
();
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getPositionObject 007_01 end
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getPositionObject 007_01 end
'
);
done
();
done
();
...
@@ -255,7 +255,7 @@ describe('fetchFileResultCallback.test.js', async function() {
...
@@ -255,7 +255,7 @@ describe('fetchFileResultCallback.test.js', async function() {
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 007_02 fail
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 007_02 fail
'
);
done
();
done
();
}
else
{
}
else
{
expect
(
targetObject
.
relativePath
==
'
c
amera/
'
).
assertTrue
();
expect
(
targetObject
.
relativePath
==
'
C
amera/
'
).
assertTrue
();
fetchFileResult
.
close
();
fetchFileResult
.
close
();
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getPositionObject 007_02 end
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getPositionObject 007_02 end
'
);
done
();
done
();
...
@@ -288,7 +288,7 @@ describe('fetchFileResultCallback.test.js', async function() {
...
@@ -288,7 +288,7 @@ describe('fetchFileResultCallback.test.js', async function() {
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 007_03 fail
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 007_03 fail
'
);
done
();
done
();
}
else
{
}
else
{
expect
(
targetObject
.
relativePath
==
'
c
amera/
'
).
assertTrue
();
expect
(
targetObject
.
relativePath
==
'
C
amera/
'
).
assertTrue
();
fetchFileResult
.
close
();
fetchFileResult
.
close
();
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getPositionObject 007_03 end
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getPositionObject 007_03 end
'
);
done
();
done
();
...
@@ -487,8 +487,8 @@ describe('fetchFileResultCallback.test.js', async function() {
...
@@ -487,8 +487,8 @@ describe('fetchFileResultCallback.test.js', async function() {
console
.
info
(
'
MediaLibraryTest :firstObject.title:
'
+
firstObject
.
title
);
console
.
info
(
'
MediaLibraryTest :firstObject.title:
'
+
firstObject
.
title
);
}
}
expect
(
firstObject
.
relativePath
==
'
c
amera/
'
).
assertTrue
();
expect
(
firstObject
.
relativePath
==
'
C
amera/
'
).
assertTrue
();
if
(
firstObject
.
relativePath
!=
'
c
amera/
'
)
{
if
(
firstObject
.
relativePath
!=
'
C
amera/
'
)
{
console
.
info
(
'
MediaLibraryTest :firstObject.relativePath:
'
+
firstObject
.
relativePath
);
console
.
info
(
'
MediaLibraryTest :firstObject.relativePath:
'
+
firstObject
.
relativePath
);
}
}
...
@@ -547,8 +547,8 @@ describe('fetchFileResultCallback.test.js', async function() {
...
@@ -547,8 +547,8 @@ describe('fetchFileResultCallback.test.js', async function() {
console
.
info
(
'
MediaLibraryTest :firstObject.albumUri:
'
+
firstObject
.
albumUri
);
console
.
info
(
'
MediaLibraryTest :firstObject.albumUri:
'
+
firstObject
.
albumUri
);
}
}
expect
(
firstObject
.
albumName
==
'
c
amera
'
).
assertTrue
();
expect
(
firstObject
.
albumName
==
'
C
amera
'
).
assertTrue
();
if
(
firstObject
.
albumName
!=
'
c
amera
'
)
{
if
(
firstObject
.
albumName
!=
'
C
amera
'
)
{
console
.
info
(
'
MediaLibraryTest :firstObject.albumName:
'
+
firstObject
.
albumName
);
console
.
info
(
'
MediaLibraryTest :firstObject.albumName:
'
+
firstObject
.
albumName
);
}
}
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fetchFileResultPromise.test.js
浏览文件 @
52e9daa9
...
@@ -53,28 +53,28 @@ let getFileCountOneHundredOp = {
...
@@ -53,28 +53,28 @@ let getFileCountOneHundredOp = {
let
getFirstObjectOp
=
{
let
getFirstObjectOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
'
c
amera/
'
],
selectionArgs
:
[
'
C
amera/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,5
"
,
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,5
"
,
extendArgs
:
""
,
extendArgs
:
""
,
}
}
let
getAllObjectLimitOneOp
=
{
let
getAllObjectLimitOneOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
'
c
amera/
'
],
selectionArgs
:
[
'
C
amera/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,1
"
,
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,1
"
,
extendArgs
:
""
,
extendArgs
:
""
,
}
}
let
getAllObjectLimitTwoOp
=
{
let
getAllObjectLimitTwoOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
'
c
amera/
'
],
selectionArgs
:
[
'
C
amera/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,1
"
,
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,1
"
,
extendArgs
:
""
,
extendArgs
:
""
,
}
}
let
getAllObjectLimitOneHundredOp
=
{
let
getAllObjectLimitOneHundredOp
=
{
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selections
:
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
'
c
amera/
'
],
selectionArgs
:
[
'
C
amera/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,100
"
,
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,100
"
,
extendArgs
:
""
,
extendArgs
:
""
,
}
}
...
@@ -86,7 +86,7 @@ let getFileCountZeroOp = {
...
@@ -86,7 +86,7 @@ let getFileCountZeroOp = {
let
getFileOp
=
{
let
getFileOp
=
{
selections
:
fileKeyObj
.
DISPLAY_NAME
+
'
= ? AND
'
+
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selections
:
fileKeyObj
.
DISPLAY_NAME
+
'
= ? AND
'
+
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
'
01.jpg
'
,
'
c
amera/
'
],
selectionArgs
:
[
'
01.jpg
'
,
'
C
amera/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,100
"
,
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,100
"
,
extendArgs
:
""
,
extendArgs
:
""
,
}
}
...
@@ -300,7 +300,7 @@ describe('fetchFileResultPromise.test.js', async function() {
...
@@ -300,7 +300,7 @@ describe('fetchFileResultPromise.test.js', async function() {
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getFirstObject begin
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getFirstObject begin
'
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
getFirstObjectOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
getFirstObjectOp
);
let
firstObject
=
await
fetchFileResult
.
getFirstObject
();
let
firstObject
=
await
fetchFileResult
.
getFirstObject
();
expect
(
firstObject
.
relativePath
==
'
c
amera/
'
).
assertTrue
();
expect
(
firstObject
.
relativePath
==
'
C
amera/
'
).
assertTrue
();
fetchFileResult
.
close
();
fetchFileResult
.
close
();
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getFirstObject 004 end
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getFirstObject 004 end
'
);
done
();
done
();
...
@@ -327,9 +327,9 @@ describe('fetchFileResultPromise.test.js', async function() {
...
@@ -327,9 +327,9 @@ describe('fetchFileResultPromise.test.js', async function() {
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 005 begin
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 005 begin
'
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
getFirstObjectOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
getFirstObjectOp
);
let
firstObject
=
await
fetchFileResult
.
getFirstObject
();
let
firstObject
=
await
fetchFileResult
.
getFirstObject
();
expect
(
firstObject
.
relativePath
==
'
c
amera/
'
).
assertTrue
();
expect
(
firstObject
.
relativePath
==
'
C
amera/
'
).
assertTrue
();
let
nextObject
=
await
fetchFileResult
.
getNextObject
();
let
nextObject
=
await
fetchFileResult
.
getNextObject
();
expect
(
nextObject
.
relativePath
==
'
c
amera/
'
).
assertTrue
();
expect
(
nextObject
.
relativePath
==
'
C
amera/
'
).
assertTrue
();
fetchFileResult
.
close
();
fetchFileResult
.
close
();
done
();
done
();
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 005 end
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getNextObject 005 end
'
);
...
@@ -355,7 +355,7 @@ describe('fetchFileResultPromise.test.js', async function() {
...
@@ -355,7 +355,7 @@ describe('fetchFileResultPromise.test.js', async function() {
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getLastObject begin
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getLastObject begin
'
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
getFirstObjectOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
getFirstObjectOp
);
let
lastObject
=
await
fetchFileResult
.
getLastObject
();
let
lastObject
=
await
fetchFileResult
.
getLastObject
();
expect
(
lastObject
.
relativePath
==
'
c
amera/
'
).
assertTrue
();
expect
(
lastObject
.
relativePath
==
'
C
amera/
'
).
assertTrue
();
fetchFileResult
.
close
();
fetchFileResult
.
close
();
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getLastObject 006 end
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getLastObject 006 end
'
);
done
();
done
();
...
@@ -381,7 +381,7 @@ describe('fetchFileResultPromise.test.js', async function() {
...
@@ -381,7 +381,7 @@ describe('fetchFileResultPromise.test.js', async function() {
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getPositionObject 007_01 begin
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getPositionObject 007_01 begin
'
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
getFirstObjectOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
getFirstObjectOp
);
let
targetObject
=
await
fetchFileResult
.
getPositionObject
(
0
);
let
targetObject
=
await
fetchFileResult
.
getPositionObject
(
0
);
expect
(
targetObject
.
relativePath
==
'
c
amera/
'
).
assertTrue
();
expect
(
targetObject
.
relativePath
==
'
C
amera/
'
).
assertTrue
();
fetchFileResult
.
close
();
fetchFileResult
.
close
();
done
();
done
();
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getPositionObject 007_01 end
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getPositionObject 007_01 end
'
);
...
@@ -405,7 +405,7 @@ describe('fetchFileResultPromise.test.js', async function() {
...
@@ -405,7 +405,7 @@ describe('fetchFileResultPromise.test.js', async function() {
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getPositionObject 007_02 begin
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getPositionObject 007_02 begin
'
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
getFirstObjectOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
getFirstObjectOp
);
let
targetObject
=
await
fetchFileResult
.
getPositionObject
(
1
);
let
targetObject
=
await
fetchFileResult
.
getPositionObject
(
1
);
expect
(
targetObject
.
relativePath
==
'
c
amera/
'
).
assertTrue
();
expect
(
targetObject
.
relativePath
==
'
C
amera/
'
).
assertTrue
();
fetchFileResult
.
close
();
fetchFileResult
.
close
();
done
();
done
();
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getPositionObject 007_02 end
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getPositionObject 007_02 end
'
);
...
@@ -430,7 +430,7 @@ describe('fetchFileResultPromise.test.js', async function() {
...
@@ -430,7 +430,7 @@ describe('fetchFileResultPromise.test.js', async function() {
let
fetchFileResult
=
await
media
.
getFileAssets
(
getFirstObjectOp
);
let
fetchFileResult
=
await
media
.
getFileAssets
(
getFirstObjectOp
);
const
count
=
await
fetchFileResult
.
getCount
();
const
count
=
await
fetchFileResult
.
getCount
();
let
targetObject
=
await
fetchFileResult
.
getPositionObject
(
count
-
1
);
let
targetObject
=
await
fetchFileResult
.
getPositionObject
(
count
-
1
);
expect
(
targetObject
.
relativePath
==
'
c
amera/
'
).
assertTrue
();
expect
(
targetObject
.
relativePath
==
'
C
amera/
'
).
assertTrue
();
fetchFileResult
.
close
();
fetchFileResult
.
close
();
done
();
done
();
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getPositionObject 007_03 end
'
);
console
.
info
(
'
MediaLibraryTest : FETCHRESULT getPositionObject 007_03 end
'
);
...
@@ -598,8 +598,8 @@ describe('fetchFileResultPromise.test.js', async function() {
...
@@ -598,8 +598,8 @@ describe('fetchFileResultPromise.test.js', async function() {
console
.
info
(
'
MediaLibraryTest :firstObject.title:
'
+
firstObject
.
title
);
console
.
info
(
'
MediaLibraryTest :firstObject.title:
'
+
firstObject
.
title
);
}
}
expect
(
firstObject
.
relativePath
==
'
c
amera/
'
).
assertTrue
();
expect
(
firstObject
.
relativePath
==
'
C
amera/
'
).
assertTrue
();
if
(
firstObject
.
relativePath
!=
'
c
amera/
'
)
{
if
(
firstObject
.
relativePath
!=
'
C
amera/
'
)
{
console
.
info
(
'
MediaLibraryTest :firstObject.relativePath:
'
+
firstObject
.
relativePath
);
console
.
info
(
'
MediaLibraryTest :firstObject.relativePath:
'
+
firstObject
.
relativePath
);
}
}
...
@@ -658,8 +658,8 @@ describe('fetchFileResultPromise.test.js', async function() {
...
@@ -658,8 +658,8 @@ describe('fetchFileResultPromise.test.js', async function() {
console
.
info
(
'
MediaLibraryTest :firstObject.albumUri:
'
+
firstObject
.
albumUri
);
console
.
info
(
'
MediaLibraryTest :firstObject.albumUri:
'
+
firstObject
.
albumUri
);
}
}
expect
(
firstObject
.
albumName
==
'
c
amera
'
).
assertTrue
();
expect
(
firstObject
.
albumName
==
'
C
amera
'
).
assertTrue
();
if
(
firstObject
.
albumName
!=
'
c
amera
'
)
{
if
(
firstObject
.
albumName
!=
'
C
amera
'
)
{
console
.
info
(
'
MediaLibraryTest :firstObject.albumName:
'
+
firstObject
.
albumName
);
console
.
info
(
'
MediaLibraryTest :firstObject.albumName:
'
+
firstObject
.
albumName
);
}
}
...
...
multimedia/medialibrary/mediaLibrary_js_standard/src/main/js/test/fileAssetTestCallback.test.js
浏览文件 @
52e9daa9
...
@@ -63,7 +63,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -63,7 +63,7 @@ describe('fileAssetTestCallback.test.js', async function() {
console
.
info
(
console
.
info
(
'
MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_01 res.bytesRead:
'
'
MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_01 res.bytesRead:
'
+
res
.
bytesRead
);
+
res
.
bytesRead
);
expect
(
res
.
bytesRead
>
0
).
assertTrue
();
expect
(
res
.
bytesRead
>
=
0
).
assertTrue
();
asset1
=
dataList
[
1
];
asset1
=
dataList
[
1
];
fd1
=
await
asset1
.
open
(
'
r
'
);
fd1
=
await
asset1
.
open
(
'
r
'
);
let
buf2
=
new
ArrayBuffer
(
4096
);
let
buf2
=
new
ArrayBuffer
(
4096
);
...
@@ -74,7 +74,7 @@ describe('fileAssetTestCallback.test.js', async function() {
...
@@ -74,7 +74,7 @@ describe('fileAssetTestCallback.test.js', async function() {
+
write
);
+
write
);
await
asset
.
close
(
fd
);
await
asset
.
close
(
fd
);
await
asset1
.
close
(
fd1
);
await
asset1
.
close
(
fd1
);
if
(
fd
>
0
&&
res
.
bytesRead
>
0
&&
write
>
0
)
{
if
(
fd
>
0
&&
res
.
bytesRead
>
=
0
&&
write
>
0
)
{
console
.
info
(
console
.
info
(
'
MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_01 success
'
);
'
MediaLibraryTest : SUB_MEDIA_MEDIALIBRARY_OPENANDCLOSE_ASSET_CALLBACK_005_01 success
'
);
done
();
done
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录