Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
be53dcaa
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看板
未验证
提交
be53dcaa
编写于
8月 18, 2023
作者:
O
openharmony_ci
提交者:
Gitee
8月 18, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9728 add xts test for getPhotoIndex
Merge pull request !9728 from shenshensun/xts_getPhotoIndex
上级
a8966c6e
230787e0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
800 addition
and
1 deletion
+800
-1
multimedia/photoAccess/photoAccessSystem/Test.json
multimedia/photoAccess/photoAccessSystem/Test.json
+39
-1
multimedia/photoAccess/photoAccessSystem/entry/src/main/ets/test/List.test.ets
...s/photoAccessSystem/entry/src/main/ets/test/List.test.ets
+2
-0
multimedia/photoAccess/photoAccessSystem/entry/src/main/ets/test/getPhotoIndex.ets
...otoAccessSystem/entry/src/main/ets/test/getPhotoIndex.ets
+759
-0
未找到文件。
multimedia/photoAccess/photoAccessSystem/Test.json
浏览文件 @
be53dcaa
...
...
@@ -145,6 +145,28 @@
"mediatool send /storage/media/100/local/temp/userCommentPro03.jpg"
,
"mediatool send /storage/media/100/local/temp/userCommentPro04.jpg"
,
"mediatool send /storage/media/100/local/temp/getExif.jpg"
,
"cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/getPhotoIndex01.jpg"
,
"cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/getPhotoIndex02.jpg"
,
"cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/getPhotoIndex03.jpg"
,
"cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/Screenshots/screenshotsIndex01.jpg"
,
"cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/Screenshots/screenshotsIndex02.jpg"
,
"cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/Screenshots/screenshotsIndex03.jpg"
,
"cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Camera/cameraIndex01.jpg"
,
"cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Camera/cameraIndex02.jpg"
,
"cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Camera/cameraIndex03.jpg"
,
"cp /storage/media/100/local/temp/01.mp4 /storage/media/100/local/files/Videos/videoIndex01.mp4"
,
"cp /storage/media/100/local/temp/01.mp4 /storage/media/100/local/files/Videos/videoIndex02.mp4"
,
"cp /storage/media/100/local/temp/01.mp4 /storage/media/100/local/files/Videos/videoIndex03.mp4"
,
"cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/favoriteIndex01.jpg"
,
"cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/favoriteIndex02.jpg"
,
"cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/favoriteIndex03.jpg"
,
"cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/trashIndex01.jpg"
,
"cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/trashIndex02.jpg"
,
"cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/trashIndex03.jpg"
,
"cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/hiddenIndex01.jpg"
,
"cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/hiddenIndex02.jpg"
,
"cp /storage/media/100/local/temp/01.jpg /storage/media/100/local/files/Pictures/hiddenIndex03.jpg"
,
"chmod -R 777 /storage/media/100/local/files/*"
,
"hilog -p off"
,
"hilog -Q pidoff"
,
...
...
@@ -154,7 +176,23 @@
"sleep 5"
],
"teardown-command"
:
[
"power-shell setmode 600"
"power-shell setmode 600"
,
"rm -rf /storage/media/100/local/files/Audios/*"
,
"rm -rf /storage/media/100/local/files/Audios/.*"
,
"rm -rf /storage/media/100/local/files/Camera/*"
,
"rm -rf /storage/media/100/local/files/Camera/.*"
,
"rm -rf /storage/media/100/local/files/Documents/*"
,
"rm -rf /storage/media/100/local/files/Documents/.*"
,
"rm -rf /storage/media/100/local/files/Download/*"
,
"rm -rf /storage/media/100/local/files/Download/.*"
,
"rm -rf /storage/media/100/local/files/Pictures/*"
,
"rm -rf /storage/media/100/local/files/Pictures/.*"
,
"rm -rf /storage/media/100/local/files/Videos/*"
,
"rm -rf /storage/media/100/local/files/Videos/.*"
,
"sleep 5"
,
"rm -rf /data/app/el2/100/database/com.ohos.medialibrary.medialibrarydata/*"
,
"kill -9 `pidof com.ohos.medialibrary.medialibrarydata`"
,
"scanner"
]
},
{
...
...
multimedia/photoAccess/photoAccessSystem/entry/src/main/ets/test/List.test.ets
浏览文件 @
be53dcaa
...
...
@@ -27,6 +27,7 @@ import setFavoriteTest from './setFavorite'
import setHiddenTest from './setHidden'
import trashAssetsTest from './deleteAssets'
import setUserCommentTest from './setUserComment'
import getPhotoIndexTest from './getPhotoIndex'
export default function testsuite () {
deleteAssetsTest()
...
...
@@ -43,4 +44,5 @@ export default function testsuite () {
setHiddenTest()
trashAssetsTest()
setUserCommentTest()
getPhotoIndexTest()
}
multimedia/photoAccess/photoAccessSystem/entry/src/main/ets/test/getPhotoIndex.ets
0 → 100644
浏览文件 @
be53dcaa
/*
* Copyright (C) 2023 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
photoAccessHelper
from
'@ohos.file.photoAccessHelper'
import
dataSharePredicates
from
'@ohos.data.dataSharePredicates'
;
import
{
describe
,
it
,
expect
,
beforeAll
}
from
'deccjsunit/index'
import
{
photoKeys
,
fetchAllOption
,
photoFetchOption
,
getFileAsset
,
albumType
,
albumSubtype
,
}
from
'../../../../../../common'
export
default
function
getPhotoIndexTest
()
{
describe
(
'getPhotoIndexTest'
,
function
()
{
const
helper
=
photoAccessHelper
.
getPhotoAccessHelper
(
globalThis
.
abilityContext
);
async
function
setIndexFavorite
()
{
try
{
let
fetchOps
=
photoFetchOption
(
"setIndexFavorite"
,
photoKeys
.
DISPLAY_NAME
,
'favoriteIndex01.jpg'
);
let
asset
=
await
getFileAsset
(
"setIndexFavorite"
,
fetchOps
);
await
asset
.
setFavorite
(
true
);
fetchOps
=
photoFetchOption
(
"setIndexFavorite"
,
photoKeys
.
DISPLAY_NAME
,
'favoriteIndex02.jpg'
);
asset
=
await
getFileAsset
(
"setIndexFavorite"
,
fetchOps
);
await
asset
.
setFavorite
(
true
);
fetchOps
=
photoFetchOption
(
"setIndexFavorite"
,
photoKeys
.
DISPLAY_NAME
,
'favoriteIndex03.jpg'
);
asset
=
await
getFileAsset
(
"setIndexFavorite"
,
fetchOps
);
await
asset
.
setFavorite
(
true
);
}
catch
(
error
){
console
.
info
(
`setIndexFavorite setFavorite; error: ${error}`
);
}
}
async
function
setIndexHidden
()
{
try
{
let
fetchOps
=
photoFetchOption
(
"setIndexHidden"
,
photoKeys
.
DISPLAY_NAME
,
'hiddenIndex01.jpg'
);
let
asset
=
await
getFileAsset
(
"setIndexHidden"
,
fetchOps
);
await
asset
.
setHidden
(
true
);
fetchOps
=
photoFetchOption
(
"setIndexHidden"
,
photoKeys
.
DISPLAY_NAME
,
'hiddenIndex02.jpg'
);
asset
=
await
getFileAsset
(
"setIndexHidden"
,
fetchOps
);
await
asset
.
setHidden
(
true
);
fetchOps
=
photoFetchOption
(
"setIndexHidden"
,
photoKeys
.
DISPLAY_NAME
,
'hiddenIndex03.jpg'
);
asset
=
await
getFileAsset
(
"setIndexHidden"
,
fetchOps
);
await
asset
.
setHidden
(
true
);
}
catch
(
error
){
console
.
info
(
`setIndexHidden setHidden; error: ${error}`
);
}
}
async
function
setIndexTrash
()
{
try
{
let
fetchOps
=
photoFetchOption
(
"setIndexTrash"
,
photoKeys
.
DISPLAY_NAME
,
'trashIndex01.jpg'
);
let
asset
=
await
getFileAsset
(
"setIndexTrash"
,
fetchOps
);
await
helper
.
deleteAssets
([
asset
.
uri
]);
fetchOps
=
photoFetchOption
(
"setIndexTrash"
,
photoKeys
.
DISPLAY_NAME
,
'trashIndex02.jpg'
);
asset
=
await
getFileAsset
(
"setIndexTrash"
,
fetchOps
);
await
helper
.
deleteAssets
([
asset
.
uri
]);
fetchOps
=
photoFetchOption
(
"setIndexTrash"
,
photoKeys
.
DISPLAY_NAME
,
'trashIndex03.jpg'
);
asset
=
await
getFileAsset
(
"setIndexTrash"
,
fetchOps
);
await
helper
.
deleteAssets
([
asset
.
uri
]);
}
catch
(
error
){
console
.
info
(
`"setIndexTrash deleteAssets; error: ${error}`
);
}
}
beforeAll
(
async
function
(){
console
.
info
(
"beforeAll case"
);
await
setIndexFavorite
();
await
setIndexHidden
();
await
setIndexTrash
();
});
async
function
getPhotoIndexTestCallBack
(
done
,
testNum
,
albumSubType
,
fetchOpForGetIndex
)
{
let
expectIndex
=
1
;
try
{
let
fetchOp
=
fetchAllOption
();
let
albumFetchResult
=
await
helper
.
getAlbums
(
albumType
.
SYSTEM
,
albumSubType
,
fetchOp
);
if
(
albumFetchResult
==
undefined
)
{
console
.
info
(
`${testNum} getAlbums failed`
);
expect
(
false
)
.
assertTrue
();
}
let
album
=
await
albumFetchResult
.
getFirstObject
();
if
(
album
==
undefined
)
{
console
.
info
(
`${testNum} album getFirstObject failed`
);
expect
(
false
)
.
assertTrue
();
}
console
.
info
(
'album.uri is : '
+
album
.
albumUri
);
let
photoFetchResult
=
await
album
.
getAssets
(
fetchOpForGetIndex
);
if
(
photoFetchResult
==
undefined
)
{
console
.
info
(
`${testNum} album getAssets failed`
);
expect
(
false
)
.
assertTrue
();
}
let
photoAsset
=
await
photoFetchResult
.
getObjectByPosition
(
expectIndex
);
if
(
photoAsset
==
undefined
)
{
console
.
info
(
`${testNum} getObjectByPosition failed`
);
expect
(
false
)
.
assertTrue
();
}
helper
.
getPhotoIndex
(
photoAsset
.
uri
,
album
.
albumUri
,
fetchOpForGetIndex
,
(
err
,
index
)
=>
{
try
{
if
(
err
!==
undefined
)
{
console
.
info
(
`${testNum} getPhotoIndex failed; err: ${err}`
);
expect
(
false
)
.
assertTrue
();
}
else
{
expect
(
index
)
.
assertEqual
(
expectIndex
+
1
);
}
}
catch
(
error
)
{
console
.
info
(
`${testNum} getPhotoIndex failed; error: ${error}`
);
}
done
();
})
}
catch
(
error
)
{
console
.
info
(
`${testNum} getPhotoIndex failed; error: ${error}`
);
expect
(
false
)
.
assertTrue
();
done
();
}
}
async
function
getPhotoIndexTestCallBack1
(
done
,
testNum
,
fetchOpForGetIndex
)
{
let
expectIndex
=
1
;
try
{
let
fetchResult
=
await
helper
.
getAssets
(
fetchOpForGetIndex
);
if
(
fetchResult
==
undefined
)
{
console
.
info
(
`${testNum} album getAssets failed`
);
expect
(
false
)
.
assertTrue
();
}
let
photoAsset
=
await
fetchResult
.
getObjectByPosition
(
expectIndex
);
if
(
photoAsset
==
undefined
)
{
console
.
info
(
`${testNum} getObjectByPosition failed`
);
expect
(
false
)
.
assertTrue
();
}
helper
.
getPhotoIndex
(
photoAsset
.
uri
,
""
,
fetchOpForGetIndex
,
(
err
,
index
)
=>
{
try
{
if
(
err
!==
undefined
)
{
console
.
info
(
`${testNum} getPhotoIndex failed; err: ${err}`
);
expect
(
false
)
.
assertTrue
();
}
else
{
expect
(
index
)
.
assertEqual
(
expectIndex
+
1
);
}
}
catch
(
error
)
{
console
.
info
(
`${testNum} getPhotoIndex failed; error: ${error}`
);
}
done
();
})
}
catch
(
error
)
{
console
.
info
(
`${testNum} getPhotoIndex failed; error: ${error}`
);
expect
(
false
)
.
assertTrue
();
done
();
}
}
async
function
getPhotoIndexTestAbnormalCallBack
(
done
,
testNum
,
fetchOpForGetIndex
)
{
let
expectIndex
=
1
;
try
{
let
fetchResult
=
await
helper
.
getAssets
(
fetchOpForGetIndex
);
if
(
fetchResult
==
undefined
)
{
console
.
info
(
`${testNum} album getAssets failed`
);
expect
(
false
)
.
assertTrue
();
}
let
photoAsset
=
await
fetchResult
.
getObjectByPosition
(
expectIndex
);
if
(
photoAsset
==
undefined
)
{
console
.
info
(
`${testNum} getObjectByPosition failed`
);
expect
(
false
)
.
assertTrue
();
}
helper
.
getPhotoIndex
(
photoAsset
.
uri
,
""
,
fetchOpForGetIndex
,
(
err
,
index
)
=>
{
try
{
if
(
err
!==
undefined
)
{
console
.
info
(
`${testNum} getPhotoIndex failed; err: ${err}`
);
expect
(
true
)
.
assertTrue
();
}
else
{
expect
(
false
)
.
assertTrue
();
}
}
catch
(
error
)
{
console
.
info
(
`${testNum} getPhotoIndex failed; error: ${error}`
);
}
done
();
})
}
catch
(
error
)
{
console
.
info
(
`${testNum} getPhotoIndex failed; error: ${error}`
);
expect
(
true
)
.
assertTrue
();
done
();
}
}
async
function
getPhotoIndexTestPromise
(
done
,
testNum
,
albumSubType
,
fetchOpForGetIndex
)
{
let
expectIndex
=
1
;
try
{
let
fetchOp
=
fetchAllOption
();
let
albumFetchResult
=
await
helper
.
getAlbums
(
albumType
.
SYSTEM
,
albumSubType
,
fetchOp
);
if
(
albumFetchResult
==
undefined
)
{
console
.
info
(
`${testNum} getAlbums failed`
);
expect
(
false
)
.
assertTrue
();
}
let
album
=
await
albumFetchResult
.
getFirstObject
();
if
(
album
==
undefined
)
{
console
.
info
(
`${testNum} album getFirstObject failed`
);
expect
(
false
)
.
assertTrue
();
}
let
photoFetchResult
=
await
album
.
getAssets
(
fetchOpForGetIndex
);
if
(
photoFetchResult
==
undefined
)
{
console
.
info
(
`${testNum} album getAssets failed`
);
expect
(
false
)
.
assertTrue
();
}
let
photoAsset
=
await
photoFetchResult
.
getObjectByPosition
(
expectIndex
);
if
(
photoAsset
==
undefined
)
{
console
.
info
(
`${testNum} getObjectByPosition failed`
);
expect
(
false
)
.
assertTrue
();
}
let
index
=
await
helper
.
getPhotoIndex
(
photoAsset
.
uri
,
album
.
albumUri
,
fetchOpForGetIndex
);
console
.
info
(
`${testNum} get index : `
+
index
);
expect
(
index
)
.
assertEqual
(
expectIndex
+
1
);
done
();
}
catch
(
error
)
{
console
.
info
(
`${testNum} getPhotoIndex failed; error: ${error}`
);
expect
(
false
)
.
assertTrue
();
done
();
}
}
async
function
getPhotoIndexTestPromise1
(
done
,
testNum
,
fetchOpForGetIndex
)
{
let
expectIndex
=
1
;
try
{
let
fetchResult
=
await
helper
.
getAssets
(
fetchOpForGetIndex
);
if
(
fetchResult
==
undefined
)
{
console
.
info
(
`${testNum} album getAssets failed`
);
expect
(
false
)
.
assertTrue
();
}
let
photoAsset
=
await
fetchResult
.
getObjectByPosition
(
expectIndex
);
if
(
photoAsset
==
undefined
)
{
console
.
info
(
`${testNum} getObjectByPosition failed`
);
expect
(
false
)
.
assertTrue
();
}
let
index
=
await
helper
.
getPhotoIndex
(
photoAsset
.
uri
,
""
,
fetchOpForGetIndex
);
console
.
info
(
`${testNum} get index : `
+
index
);
expect
(
index
)
.
assertEqual
(
expectIndex
+
1
);
done
();
}
catch
(
error
)
{
console
.
info
(
`${testNum} getPhotoIndex failed; error: ${error}`
);
expect
(
false
)
.
assertTrue
();
done
();
}
}
async
function
getPhotoIndexTestAbnormalPromise
(
done
,
testNum
,
fetchOpForGetIndex
)
{
let
expectIndex
=
1
;
try
{
let
fetchResult
=
await
helper
.
getAssets
(
fetchOpForGetIndex
);
if
(
fetchResult
==
undefined
)
{
console
.
info
(
`${testNum} album getAssets failed`
);
expect
(
false
)
.
assertTrue
();
}
let
photoAsset
=
await
fetchResult
.
getObjectByPosition
(
expectIndex
);
if
(
photoAsset
==
undefined
)
{
console
.
info
(
`${testNum} getObjectByPosition failed`
);
expect
(
false
)
.
assertTrue
();
}
let
index
=
await
helper
.
getPhotoIndex
(
photoAsset
.
uri
,
""
,
fetchOpForGetIndex
);
expect
(
false
)
.
assertTrue
();
done
();
}
catch
(
error
)
{
console
.
info
(
`${testNum} getPhotoIndex failed; error: ${error}`
);
expect
(
true
)
.
assertTrue
();
done
();
}
}
//callback
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_GETPHOTOINDEX_0000
* @tc.name : getPhotoIndex_callback_000
* @tc.desc : getPhotoIndex by no album type and sort queries in asc order
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'getPhotoIndex_callback_000'
,
0
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_callback_000'
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByAsc
(
"date_modified"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestCallBack1
(
done
,
testNum
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_GETPHOTOINDEX_0100
* @tc.name : getPhotoIndex_callback_001
* @tc.desc : getPhotoIndex getPhotoIndex in a favorite type album and sort queries in asc order
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_callback_001'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_callback_001'
;
const
albumSubType
=
albumSubtype
.
FAVORITE
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByAsc
(
"date_modified"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestCallBack
(
done
,
testNum
,
albumSubType
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_GETPHOTOINDEX_0200
* @tc.name : getPhotoIndex_callback_002
* @tc.desc : getPhotoIndex in a video type album and sort queries in asc order
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_callback_002'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_callback_002'
;
const
albumSubType
=
albumSubtype
.
VIDEO
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByAsc
(
"date_modified"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestCallBack
(
done
,
testNum
,
albumSubType
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_GETPHOTOINDEX_0300
* @tc.name : getPhotoIndex_callback_003
* @tc.desc : getPhotoIndex in a screenshot type album and sort queries in asc order
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_callback_003'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_callback_003'
;
const
albumSubType
=
albumSubtype
.
SCREENSHOT
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByAsc
(
"date_modified"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestCallBack
(
done
,
testNum
,
albumSubType
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_GETPHOTOINDEX_0400
* @tc.name : getPhotoIndex_callback_004
* @tc.desc : getPhotoIndex in a trash type album and sort queries in asc order
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_callback_004'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_callback_004'
;
const
albumSubType
=
albumSubtype
.
TRASH
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByAsc
(
"date_modified"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestCallBack
(
done
,
testNum
,
albumSubType
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_GETPHOTOINDEX_0500
* @tc.name : getPhotoIndex_callback_005
* @tc.desc : getPhotoIndex in a camera type album and sort queries in asc order
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_callback_005'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_callback_005'
;
const
albumSubType
=
albumSubtype
.
CAMERA
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByAsc
(
"date_modified"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestCallBack
(
done
,
testNum
,
albumSubType
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_GETPHOTOINDEX_0600
* @tc.name : getPhotoIndex_callback_006
* @tc.desc : getPhotoIndex in a hidden type album and sort queries in asc order
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_callback_006'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_callback_006'
;
const
albumSubType
=
albumSubtype
.
HIDDEN
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByAsc
(
"date_modified"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestCallBack
(
done
,
testNum
,
albumSubType
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_GETPHOTOINDEX_0700
* @tc.name : getPhotoIndex_callback_007
* @tc.desc : getPhotoIndex by no album type and Sort queries in desc order using the keyword 'add_modified'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_callback_007'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_callback_007'
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByDesc
(
"date_modified"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestCallBack1
(
done
,
testNum
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_GETPHOTOINDEX_0800
* @tc.name : getPhotoIndex_callback_008
* @tc.desc : getPhotoIndex by no album type and Sort queries in asc order using the keyword 'date_added'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_callback_008'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_callback_008'
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByAsc
(
"date_added"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestCallBack1
(
done
,
testNum
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_GETPHOTOINDEX_0900
* @tc.name : getPhotoIndex_callback_009
* @tc.desc : getPhotoIndex by no album type and Sort queries in asc order and some fetchColumn args
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_callback_009'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_callback_009'
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByAsc
(
"date_modified"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[
photoKeys
.
SIZE
,
photoKeys
.
TITLE
,
photoKeys
.
POSITION
,
photoKeys
.
DATE_TRASHED
,
],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestCallBack1
(
done
,
testNum
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_GETPHOTOINDEX_01000
* @tc.name : getPhotoIndex_callback_0010
* @tc.desc : getPhotoIndex by no album type and no sorting method
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_callback_0010'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_callback_0010'
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestAbnormalCallBack
(
done
,
testNum
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_GETPHOTOINDEX_01100
* @tc.name : getPhotoIndex_callback_0011
* @tc.desc : getPhotoIndex by no album type and more sorting method
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_callback_0011'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_callback_0011'
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByAsc
(
"date_added"
);
predicatesForGetIndex
.
and
()
.
orderByAsc
(
"date_modified"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestAbnormalCallBack
(
done
,
testNum
,
fetchOpForGetIndex
);
});
//promise
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_GETPHOTOINDEX_0000
* @tc.name : getPhotoIndex_Promise_000
* @tc.desc : getPhotoIndex by no album type and sort queries in asc order
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
*/
it
(
'getPhotoIndex_Promise_000'
,
0
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_Promise_000'
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByAsc
(
"date_modified"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestPromise1
(
done
,
testNum
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_GETPHOTOINDEX_0100
* @tc.name : getPhotoIndex_Promise_001
* @tc.desc : getPhotoIndex getPhotoIndex in a favorite type album and sort queries in asc order
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_Promise_001'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_Promise_001'
;
const
albumSubType
=
albumSubtype
.
FAVORITE
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByAsc
(
"date_modified"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestPromise
(
done
,
testNum
,
albumSubType
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_GETPHOTOINDEX_0200
* @tc.name : getPhotoIndex_Promise_002
* @tc.desc : getPhotoIndex getPhotoIndex in a video type album and sort queries in asc order
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_Promise_002'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_Promise_002'
;
const
albumSubType
=
albumSubtype
.
VIDEO
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByAsc
(
"date_modified"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestPromise
(
done
,
testNum
,
albumSubType
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_GETPHOTOINDEX_0300
* @tc.name : getPhotoIndex_Promise_003
* @tc.desc : getPhotoIndex getPhotoIndex in a screenshot type album and sort queries in asc order
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_Promise_003'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_Promise_003'
;
const
albumSubType
=
albumSubtype
.
SCREENSHOT
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByAsc
(
"date_modified"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestPromise
(
done
,
testNum
,
albumSubType
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_GETPHOTOINDEX_0400
* @tc.name : getPhotoIndex_Promise_004
* @tc.desc : getPhotoIndex getPhotoIndex in a trash type album and sort queries in asc order
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_Promise_004'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_Promise_004'
;
const
albumSubType
=
albumSubtype
.
TRASH
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByAsc
(
"date_modified"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestPromise
(
done
,
testNum
,
albumSubType
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_GETPHOTOINDEX_0500
* @tc.name : getPhotoIndex_Promise_005
* @tc.desc : getPhotoIndex getPhotoIndex in a camera type album and sort queries in asc order
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_Promise_005'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_Promise_005'
;
const
albumSubType
=
albumSubtype
.
CAMERA
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByAsc
(
"date_modified"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestPromise
(
done
,
testNum
,
albumSubType
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_GETPHOTOINDEX_0600
* @tc.name : getPhotoIndex_Promise_006
* @tc.desc : getPhotoIndex getPhotoIndex in a hidden type album and sort queries in asc order
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_Promise_006'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_Promise_006'
;
const
albumSubType
=
albumSubtype
.
HIDDEN
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByAsc
(
"date_modified"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestPromise
(
done
,
testNum
,
albumSubType
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_GETPHOTOINDEX_0700
* @tc.name : getPhotoIndex_Promise_007
* @tc.desc : getPhotoIndex by no album type and Sort queries in desc order using the keyword 'add_modified'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_Promise_007'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_Promise_007'
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByDesc
(
"date_modified"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestPromise1
(
done
,
testNum
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_GETPHOTOINDEX_0800
* @tc.name : getPhotoIndex_Promise_008
* @tc.desc : getPhotoIndex by no album type and Sort queries in asc order using the keyword 'date_added'
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_Promise_008'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_Promise_008'
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByAsc
(
"date_added"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestPromise1
(
done
,
testNum
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_GETPHOTOINDEX_0900
* @tc.name : getPhotoIndex_Promise_009
* @tc.desc : getPhotoIndex by no album type and Sort queries in asc order and some fetchColumn args
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_Promise_009'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_Promise_009'
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByAsc
(
"date_modified"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[
photoKeys
.
SIZE
,
photoKeys
.
TITLE
,
photoKeys
.
POSITION
,
photoKeys
.
DATE_TRASHED
,
],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestPromise1
(
done
,
testNum
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_GETPHOTOINDEX_01000
* @tc.name : getPhotoIndex_Promise_0010
* @tc.desc : getPhotoIndex by no album type and no sorting method
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_Promise_0010'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_Promise_0010'
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestAbnormalPromise
(
done
,
testNum
,
fetchOpForGetIndex
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_GETPHOTOINDEX_01100
* @tc.name : getPhotoIndex_Promise_0011
* @tc.desc : getPhotoIndex by no album type and more sorting method
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'getPhotoIndex_Promise_0011'
,
2
,
async
function
(
done
)
{
const
testNum
=
'getPhotoIndex_Promise_0011'
;
let
predicatesForGetIndex
=
new
dataSharePredicates
.
DataSharePredicates
();
predicatesForGetIndex
.
orderByAsc
(
"date_modified"
);
predicatesForGetIndex
.
and
()
.
orderByAsc
(
"date_added"
);
let
fetchOpForGetIndex
=
{
fetchColumns
:
[],
predicates
:
predicatesForGetIndex
};
await
getPhotoIndexTestAbnormalPromise
(
done
,
testNum
,
fetchOpForGetIndex
);
});
})
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录