Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
53278d09
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看板
提交
53278d09
编写于
8月 03, 2023
作者:
S
sunshenshen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add cameraShotKey xts tests
Signed-off-by:
N
sunshenshen
<
sunshenshen@huawei.com
>
上级
5693118f
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
611 addition
and
98 deletion
+611
-98
multimedia/photoAccess/common.ts
multimedia/photoAccess/common.ts
+2
-1
multimedia/photoAccess/photoAccess/entry/src/main/ets/test/PhotoAccessHelper/unRegisterChange.ets
.../src/main/ets/test/PhotoAccessHelper/unRegisterChange.ets
+1
-1
multimedia/photoAccess/photoAccessSystem/entry/src/main/ets/test/createAsset.ets
...photoAccessSystem/entry/src/main/ets/test/createAsset.ets
+608
-96
未找到文件。
multimedia/photoAccess/common.ts
浏览文件 @
53278d09
...
...
@@ -80,6 +80,7 @@ export function photoFetchOption(testNum, key, value) : photoAccessHelper.FetchO
photoKeys
.
POSITION
,
photoKeys
.
DATE_TRASHED
,
photoKeys
.
HIDDEN
,
photoKeys
.
CAMERA_SHOT_KEY
,
],
predicates
:
predicates
};
...
...
multimedia/photoAccess/photoAccess/entry/src/main/ets/test/PhotoAccessHelper/unRegisterChange.ets
浏览文件 @
53278d09
...
...
@@ -32,7 +32,7 @@ export default function unRegisterChangeTest () {
/**
* @tc.number : SUB_PHOTOACCESS_UNREGISTERCHANGE_0100
* @tc.name : unRegisterChange_001
* @tc.desc : unRegister listening motify file
displayNam
e
* @tc.desc : unRegister listening motify file
titl
e
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
...
...
multimedia/photoAccess/photoAccessSystem/entry/src/main/ets/test/createAsset.ets
浏览文件 @
53278d09
...
...
@@ -17,6 +17,9 @@
import
photoAccessHelper
from
'@ohos.file.photoAccessHelper'
import
{
describe
,
beforeAll
,
it
,
expect
}
from
'deccjsunit/index'
import
{
photoKeys
,
photoFetchOption
,
getFileAsset
,
getPermission
}
from
'../../../../../../common'
...
...
@@ -72,6 +75,34 @@ export default function createAssetTest () {
}
}
async
function
createAssetCallback3
(
done
,
testNum
,
displayName
,
createOption
,
fetchOps
)
{
let
asset
:
photoAccessHelper
.
PhotoAsset
;
try
{
helper
.
createAsset
(
displayName
,
createOption
,
async
(
err
,
createAsset
)
=>
{
try
{
if
(
err
!==
undefined
)
{
console
.
info
(
`${testNum} createAsset failed; err: ${err}`
);
expect
(
false
)
.
assertTrue
();
}
else
{
let
fd
=
await
createAsset
.
open
(
"rw"
);
await
createAsset
.
close
(
fd
);
expect
(
createAsset
.
displayName
)
.
assertEqual
(
displayName
);
asset
=
await
getFileAsset
(
testNum
,
fetchOps
);
console
.
info
(
`${testNum} createAsset displayName: ${asset.displayName}`
);
expect
(
asset
.
displayName
)
.
assertEqual
(
displayName
);
}
}
catch
(
error
)
{
console
.
info
(
`${testNum} createAsset failed; error: ${error}`
);
}
done
();
})
}
catch
(
error
)
{
console
.
info
(
`${testNum} failed; error: ${error}`
);
expect
(
false
)
.
assertTrue
();
done
();
}
}
async
function
createAssetAbnormalCallback1
(
done
,
testNum
,
displayName
)
{
try
{
helper
.
createAsset
(
displayName
,
(
err
,
createAsset
)
=>
{
...
...
@@ -93,12 +124,17 @@ export default function createAssetTest () {
async
function
createAssetAbnormalCallback2
(
done
,
testNum
,
displayName
,
createOption
)
{
try
{
helper
.
createAsset
(
displayName
,
createOption
,
(
err
,
createAsset
)
=>
{
try
{
if
(
err
!==
undefined
)
{
console
.
info
(
`${testNum} createAsset failed; err: ${err}`
);
expect
(
true
)
.
assertTrue
();
}
else
{
console
.
info
(
`${testNum} createAsset success`
);
expect
(
false
)
.
assertTrue
();
}
}
catch
(
error
)
{
console
.
info
(
`${testNum} error: ${error}`
);
}
done
();
})
}
catch
(
error
)
{
...
...
@@ -134,6 +170,26 @@ export default function createAssetTest () {
}
}
async
function
createAssetPromise3
(
done
,
testNum
,
displayName
,
createOption
,
fetchOps
)
{
try
{
let
createAsset
:
photoAccessHelper
.
PhotoAsset
;
createAsset
=
await
helper
.
createAsset
(
displayName
,
createOption
);
expect
(
createAsset
.
displayName
)
.
assertEqual
(
displayName
);
let
fd
=
await
createAsset
.
open
(
"rw"
);
await
createAsset
.
close
(
fd
);
expect
(
createAsset
.
displayName
)
.
assertEqual
(
displayName
);
let
asset
:
photoAccessHelper
.
PhotoAsset
;
asset
=
await
getFileAsset
(
testNum
,
fetchOps
);
console
.
info
(
`${testNum} createAsset displayName: ${asset.displayName}`
);
expect
(
asset
.
displayName
)
.
assertEqual
(
displayName
);
done
();
}
catch
(
error
)
{
console
.
info
(
`${testNum} failed; error: ${error}`
);
expect
(
false
)
.
assertTrue
();
done
();
}
}
async
function
createAssetAbnormalPromise1
(
done
,
testNum
,
displayName
)
{
try
{
await
helper
.
createAsset
(
displayName
);
...
...
@@ -163,7 +219,7 @@ export default function createAssetTest () {
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_0000
* @tc.name : createAsset_callback_000
* @tc.desc : createAsset
* @tc.desc : createAsset
by displayname
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
...
...
@@ -211,7 +267,7 @@ export default function createAssetTest () {
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_0400
* @tc.name : createAsset_callback_004
* @tc.desc : createAsset
abnormal param
* @tc.desc : createAsset
displayname is undefined and no createoption
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
...
...
@@ -224,7 +280,7 @@ export default function createAssetTest () {
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_0500
* @tc.name : createAsset_callback_005
* @tc.desc : createAsset
abnormal param
* @tc.desc : createAsset
displayname is not has extension and no createoption
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
...
...
@@ -238,7 +294,7 @@ export default function createAssetTest () {
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_0600
* @tc.name : createAsset_callback_006
* @tc.desc : createAsset
abnormal param
* @tc.desc : createAsset
with too long displayname
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
...
...
@@ -256,7 +312,7 @@ export default function createAssetTest () {
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_0700
* @tc.name : createAsset_callback_007
* @tc.desc : createAsset
abnormal param
* @tc.desc : createAsset
with undefined displayname
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
...
...
@@ -272,7 +328,7 @@ export default function createAssetTest () {
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_0800
* @tc.name : createAsset_callback_008
* @tc.desc : createAsset
abnormal param
* @tc.desc : createAsset
displayname is not has extension and subtype is DEFAULT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
...
...
@@ -289,7 +345,7 @@ export default function createAssetTest () {
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_0900
* @tc.name : createAsset_callback_009
* @tc.desc : createAsset
abnormal param
* @tc.desc : createAsset
with too long displayname and subtype is DEFAULT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
...
...
@@ -307,11 +363,125 @@ export default function createAssetTest () {
await
createAssetAbnormalCallback2
(
done
,
testNum
,
displayName
,
createOption
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_01000
* @tc.name : createAsset_callback_0010
* @tc.desc : createAsset with normal cameraShotKey.length is greater than or equal to 30 and subtype is DEFAULT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_callback_0010'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_callback_0010'
;
const
displayName
=
testNum
+
'.jpg'
;
const
cameraShotKey
=
'createAsset_callback_0010aaaaa'
;
const
fetchOps
=
photoFetchOption
(
testNum
,
photoKeys
.
CAMERA_SHOT_KEY
,
cameraShotKey
);
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
subtype
:
photoAccessHelper
.
PhotoSubtype
.
DEFAULT
,
cameraShotKey
:
cameraShotKey
,
};
await
createAssetCallback3
(
done
,
testNum
,
displayName
,
createOption
,
fetchOps
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_01100
* @tc.name : createAsset_callback_0011
* @tc.desc : createAsset with cameraShotKey.length is greater than or equal to 30 and has no subtype
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_callback_0011'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_callback_0011'
;
const
displayName
=
testNum
+
'.jpg'
;
const
cameraShotKey
=
'createAsset_callback_0011aaaaa'
;
const
fetchOps
=
photoFetchOption
(
testNum
,
photoKeys
.
CAMERA_SHOT_KEY
,
cameraShotKey
);
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
cameraShotKey
:
cameraShotKey
,
};
await
createAssetCallback3
(
done
,
testNum
,
displayName
,
createOption
,
fetchOps
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_01200
* @tc.name : createAsset_callback_0012
* @tc.desc : createAsset with normal cameraShotKey.length is greater than or equal to 30 and subtype is SCREENSHOT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_callback_0012'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_callback_0012'
;
const
displayName
=
testNum
+
'.jpg'
;
const
cameraShotKey
=
'createAsset_callback_0012aaaaa'
;
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
subtype
:
photoAccessHelper
.
PhotoSubtype
.
SCREENSHOT
,
cameraShotKey
:
cameraShotKey
,
};
await
createAssetAbnormalCallback2
(
done
,
testNum
,
displayName
,
createOption
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_01300
* @tc.name : createAsset_callback_0013
* @tc.desc : createAsset with abnormal cameraShotKey.length is less than 30 and has no subtype
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_callback_0013'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_callback_0013'
;
const
displayName
=
testNum
+
'.jpg'
;
const
cameraShotKey
=
'createAsset_callback_0013a'
;
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
cameraShotKey
:
cameraShotKey
,
};
await
createAssetAbnormalCallback2
(
done
,
testNum
,
displayName
,
createOption
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_01400
* @tc.name : createAsset_callback_0014
* @tc.desc : createAsset with abnormal cameraShotKey.length is less than 30 and subtype is DEFAULT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_callback_0014'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_callback_0014'
;
const
displayName
=
testNum
+
'.jpg'
;
const
cameraShotKey
=
'createAsset_callback_0014a'
;
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
subtype
:
photoAccessHelper
.
PhotoSubtype
.
DEFAULT
,
cameraShotKey
:
cameraShotKey
,
};
await
createAssetAbnormalCallback2
(
done
,
testNum
,
displayName
,
createOption
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_01500
* @tc.name : createAsset_callback_0015
* @tc.desc : createAsset with abnormal cameraShotKey.length is less than 30 and subtype is SCREENSHOT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_callback_0015'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_callback_0015'
;
const
displayName
=
testNum
+
'.jpg'
;
const
cameraShotKey
=
'createAsset_callback_0015a'
;
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
subtype
:
photoAccessHelper
.
PhotoSubtype
.
SCREENSHOT
,
cameraShotKey
:
cameraShotKey
,
};
await
createAssetAbnormalCallback2
(
done
,
testNum
,
displayName
,
createOption
);
});
//promise
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_0000
* @tc.name : createAsset_promise_000
* @tc.desc : createAsset
* @tc.desc : createAsset
by displayname
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
...
...
@@ -342,7 +512,7 @@ export default function createAssetTest () {
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_0200
* @tc.name : createAsset_promise_002
* @tc.desc : createAsset with createOption(PhotoSubtype.SCREENSHOT)
* @tc.desc : createAsset
by displayname
with createOption(PhotoSubtype.SCREENSHOT)
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
...
...
@@ -359,7 +529,7 @@ export default function createAssetTest () {
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_0400
* @tc.name : createAsset_promise_004
* @tc.desc : createAsset
abnormal param
* @tc.desc : createAsset
displayname has no extension
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
...
...
@@ -372,7 +542,7 @@ export default function createAssetTest () {
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_0500
* @tc.name : createAsset_promise_005
* @tc.desc : createAsset
abnormal param
* @tc.desc : createAsset
displayname has no extension
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
...
...
@@ -386,7 +556,7 @@ export default function createAssetTest () {
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_0600
* @tc.name : createAsset_promise_006
* @tc.desc : createAsset
abnormal param
* @tc.desc : createAsset
displayname is too long
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
...
...
@@ -404,7 +574,7 @@ export default function createAssetTest () {
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_0700
* @tc.name : createAsset_promise_007
* @tc.desc : createAsset
abnormal param
* @tc.desc : createAsset
with undefined displayname
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
...
...
@@ -420,7 +590,7 @@ export default function createAssetTest () {
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_0800
* @tc.name : createAsset_promise_008
* @tc.desc : createAsset
abnormal param
* @tc.desc : createAsset
displayname has no extension
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
...
...
@@ -437,7 +607,7 @@ export default function createAssetTest () {
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_0900
* @tc.name : createAsset_promise_009
* @tc.desc : createAsset
abnormal param
* @tc.desc : createAsset
displayname is too long with subtype is DEFAULT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
...
...
@@ -455,12 +625,126 @@ export default function createAssetTest () {
await
createAssetAbnormalPromise2
(
done
,
testNum
,
displayName
,
createOption
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_01000
* @tc.name : createAsset_promise_0010
* @tc.desc : createAsset with normal cameraShotKey.length is is greater than or equal to 30 and has no subtype
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_promise_0010'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_promise_0010'
;
const
displayName
=
testNum
+
'.jpg'
;
const
cameraShotKey
=
'createAsset_promise_0010aaaaaa'
;
const
fetchOps
=
photoFetchOption
(
testNum
,
photoKeys
.
CAMERA_SHOT_KEY
,
cameraShotKey
);
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
cameraShotKey
:
cameraShotKey
,
};
await
createAssetPromise3
(
done
,
testNum
,
displayName
,
createOption
,
fetchOps
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_01100
* @tc.name : createAsset_promise_0011
* @tc.desc : createAsset with normal cameraShotKey.length is greater than or equal to 30 and subtype is DEFAULT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_promise_0011'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_promise_0011'
;
const
displayName
=
testNum
+
'.jpg'
;
const
cameraShotKey
=
'createAsset_promise_0011aaaaaa'
;
const
fetchOps
=
photoFetchOption
(
testNum
,
photoKeys
.
CAMERA_SHOT_KEY
,
cameraShotKey
);
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
subtype
:
photoAccessHelper
.
PhotoSubtype
.
DEFAULT
,
cameraShotKey
:
cameraShotKey
,
};
await
createAssetPromise3
(
done
,
testNum
,
displayName
,
createOption
,
fetchOps
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_01200
* @tc.name : createAsset_promise_0012
* @tc.desc : createAsset with normal cameraShotKey.length is greater than or equal to 30 and subtype is SCREENSHOT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_promise_0012'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_promise_0012'
;
const
displayName
=
testNum
+
'.jpg'
;
const
cameraShotKey
=
'createAsset_promise_0012aaaaaa'
;
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
subtype
:
photoAccessHelper
.
PhotoSubtype
.
SCREENSHOT
,
cameraShotKey
:
cameraShotKey
,
};
await
createAssetAbnormalPromise2
(
done
,
testNum
,
displayName
,
createOption
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_01300
* @tc.name : createAsset_promise_0013
* @tc.desc : createAsset with cameraShotKey.length is less than 30 and subtype is SCREENSHOT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_promise_0013'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_promise_0013'
;
const
displayName
=
testNum
+
'.jpg'
;
const
cameraShotKey
=
'createAsset_promise_0013a'
;
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
subtype
:
photoAccessHelper
.
PhotoSubtype
.
SCREENSHOT
,
cameraShotKey
:
cameraShotKey
,
};
await
createAssetAbnormalPromise2
(
done
,
testNum
,
displayName
,
createOption
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_01400
* @tc.name : createAsset_promise_0014
* @tc.desc : createAsset with cameraShotKey.length is less than 30 and subtype is DEFAULT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_promise_0014'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_promise_0014'
;
const
displayName
=
testNum
+
'.jpg'
;
const
cameraShotKey
=
'createAsset_promise_0014a'
;
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
subtype
:
photoAccessHelper
.
PhotoSubtype
.
DEFAULT
,
cameraShotKey
:
cameraShotKey
,
};
await
createAssetAbnormalPromise2
(
done
,
testNum
,
displayName
,
createOption
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_01500
* @tc.name : createAsset_promise_0015
* @tc.desc : createAsset with cameraShotKey.length is less than 30 and has no subtype
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_promise_0015'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_promise_0015'
;
const
displayName
=
testNum
+
'.jpg'
;
const
cameraShotKey
=
'createAsset_promise_0015a'
;
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
cameraShotKey
:
cameraShotKey
,
};
await
createAssetAbnormalPromise2
(
done
,
testNum
,
displayName
,
createOption
);
});
//video
//callback
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_1100
* @tc.name : createAsset_callback_011
* @tc.desc : createAsset
* @tc.desc : createAsset
by displayname
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
...
...
@@ -508,7 +792,7 @@ export default function createAssetTest () {
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_1500
* @tc.name : createAsset_callback_015
* @tc.desc : createAsset
abnormal param
* @tc.desc : createAsset
with displayname is too long
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
...
...
@@ -526,7 +810,7 @@ export default function createAssetTest () {
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_1600
* @tc.name : createAsset_callback_016
* @tc.desc : createAsset
abnormal param
* @tc.desc : createAsset
with displayname is too long and subtype is DEFAULT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
...
...
@@ -544,11 +828,125 @@ export default function createAssetTest () {
await
createAssetAbnormalCallback2
(
done
,
testNum
,
displayName
,
createOption
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_1700
* @tc.name : createAsset_callback_017
* @tc.desc : createAsset with normal cameraShotKey.length is greater than or equal to 30 and subtype is DEFAULT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_callback_017'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_callback_017'
;
const
displayName
=
testNum
+
'.mp4'
;
const
cameraShotKey
=
'createAsset_callback_0170aaaaa'
;
const
fetchOps
=
photoFetchOption
(
testNum
,
photoKeys
.
CAMERA_SHOT_KEY
,
cameraShotKey
);
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
subtype
:
photoAccessHelper
.
PhotoSubtype
.
DEFAULT
,
cameraShotKey
:
cameraShotKey
,
};
await
createAssetCallback3
(
done
,
testNum
,
displayName
,
createOption
,
fetchOps
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_1800
* @tc.name : createAsset_callback_0180
* @tc.desc : createAsset with normal cameraShotKey.length is greater than or equal to 30 and has no subtype
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_callback_018'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_callback_018'
;
const
displayName
=
testNum
+
'.mp4'
;
const
cameraShotKey
=
'createAsset_callback_0180aaaaa'
;
const
fetchOps
=
photoFetchOption
(
testNum
,
photoKeys
.
CAMERA_SHOT_KEY
,
cameraShotKey
);
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
cameraShotKey
:
cameraShotKey
,
};
await
createAssetCallback3
(
done
,
testNum
,
displayName
,
createOption
,
fetchOps
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_1900
* @tc.name : createAsset_callback_019
* @tc.desc : createAsset with normal cameraShotKey.length is greater than or equal to 30 and subtype is SCREENSHOT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_callback_019'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_callback_019'
;
const
displayName
=
testNum
+
'.mp4'
;
const
cameraShotKey
=
'createAsset_callback_0190aaaaa'
;
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
subtype
:
photoAccessHelper
.
PhotoSubtype
.
SCREENSHOT
,
cameraShotKey
:
cameraShotKey
,
};
await
createAssetAbnormalCallback2
(
done
,
testNum
,
displayName
,
createOption
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_2000
* @tc.name : createAsset_callback_020
* @tc.desc : createAsset with cameraShotKey.length is less than 30 and has no subtype
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_callback_020'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_callback_020'
;
const
displayName
=
testNum
+
'.mp4'
;
const
cameraShotKey
=
'createAsset_callback_020a'
;
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
cameraShotKey
:
cameraShotKey
,
};
await
createAssetAbnormalCallback2
(
done
,
testNum
,
displayName
,
createOption
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_2100
* @tc.name : createAsset_callback_021
* @tc.desc : createAsset with cameraShotKey.length is less than 30 and subtype is DEFAULT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_callback_021'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_callback_021'
;
const
displayName
=
testNum
+
'.mp4'
;
const
cameraShotKey
=
'createAsset_callback_021a'
;
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
subtype
:
photoAccessHelper
.
PhotoSubtype
.
DEFAULT
,
cameraShotKey
:
cameraShotKey
,
};
await
createAssetAbnormalCallback2
(
done
,
testNum
,
displayName
,
createOption
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_CALLBACK_CREATE_ASSET_2200
* @tc.name : createAsset_callback_022
* @tc.desc : createAsset with cameraShotKey.length is less than 30 and subtype is SCREENSHOT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_callback_022'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_callback_022'
;
const
displayName
=
testNum
+
'.mp4'
;
const
cameraShotKey
=
'createAsset_callback_022a'
;
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
subtype
:
photoAccessHelper
.
PhotoSubtype
.
SCREENSHOT
,
cameraShotKey
:
cameraShotKey
,
};
await
createAssetAbnormalCallback2
(
done
,
testNum
,
displayName
,
createOption
);
});
//promise
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_1100
* @tc.name : createAsset_promise_011
* @tc.desc : createAsset
* @tc.desc : createAsset
by displayname
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 0
...
...
@@ -596,7 +994,7 @@ export default function createAssetTest () {
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_1500
* @tc.name : createAsset_promise_015
* @tc.desc : createAsset
abnormal param
* @tc.desc : createAsset
with displayname is too long
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
...
...
@@ -614,7 +1012,7 @@ export default function createAssetTest () {
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_1600
* @tc.name : createAsset_promise_016
* @tc.desc : createAsset
abnormal param
* @tc.desc : createAsset
displayname is too long with subtype is DEFAULT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
...
...
@@ -631,5 +1029,119 @@ export default function createAssetTest () {
};
await
createAssetAbnormalPromise2
(
done
,
testNum
,
displayName
,
createOption
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_1700
* @tc.name : createAsset_promise_017
* @tc.desc : createAsset with normal cameraShotKey.length is greater than or equal to 30 and has no subtype
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_promise_017'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_promise_017'
;
const
displayName
=
testNum
+
'.mp4'
;
const
cameraShotKey
=
'createAsset_promise_0170aaaaaa'
;
const
fetchOps
=
photoFetchOption
(
testNum
,
photoKeys
.
CAMERA_SHOT_KEY
,
cameraShotKey
);
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
cameraShotKey
:
cameraShotKey
,
};
await
createAssetPromise3
(
done
,
testNum
,
displayName
,
createOption
,
fetchOps
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_1800
* @tc.name : createAsset_promise_018
* @tc.desc : createAsset with normal cameraShotKey.length is greater than or equal to 30 and subtype is DEFAULT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_promise_018'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_promise_018'
;
const
displayName
=
testNum
+
'.mp4'
;
const
cameraShotKey
=
'createAsset_promise_0180aaaaaa'
;
const
fetchOps
=
photoFetchOption
(
testNum
,
photoKeys
.
CAMERA_SHOT_KEY
,
cameraShotKey
);
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
subtype
:
photoAccessHelper
.
PhotoSubtype
.
DEFAULT
,
cameraShotKey
:
cameraShotKey
,
};
await
createAssetPromise3
(
done
,
testNum
,
displayName
,
createOption
,
fetchOps
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_1900
* @tc.name : createAsset_promise_019
* @tc.desc : createAsset with normal cameraShotKey.length is greater than or equal to 30 and subtype is SCREENSHOT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_promise_019'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_promise_019'
;
const
displayName
=
testNum
+
'.mp4'
;
const
cameraShotKey
=
'createAsset_promise_0190aaaaa'
;
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
subtype
:
photoAccessHelper
.
PhotoSubtype
.
SCREENSHOT
,
cameraShotKey
:
cameraShotKey
,
};
await
createAssetAbnormalPromise2
(
done
,
testNum
,
displayName
,
createOption
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_2000
* @tc.name : createAsset_promise_020
* @tc.desc : createAsset with cameraShotKey.length is less than 30 and subtype is SCREENSHOT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_promise_020'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_promise_020'
;
const
displayName
=
testNum
+
'.mp4'
;
const
cameraShotKey
=
'createAsset_promise_0200a'
;
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
subtype
:
photoAccessHelper
.
PhotoSubtype
.
SCREENSHOT
,
cameraShotKey
:
cameraShotKey
,
};
await
createAssetAbnormalPromise2
(
done
,
testNum
,
displayName
,
createOption
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_2100
* @tc.name : createAsset_promise_021
* @tc.desc : createAsset with cameraShotKey.length is less than 30 and subtype is DEFAULT
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_promise_021'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_promise_021'
;
const
displayName
=
testNum
+
'.mp4'
;
const
cameraShotKey
=
'createAsset_promise_0210a'
;
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
subtype
:
photoAccessHelper
.
PhotoSubtype
.
DEFAULT
,
cameraShotKey
:
cameraShotKey
,
};
await
createAssetAbnormalPromise2
(
done
,
testNum
,
displayName
,
createOption
);
});
/**
* @tc.number : SUB_PHOTOACCESS_HELPER_PROMISE_CREATE_ASSET_2200
* @tc.name : createAsset_promise_022
* @tc.desc : createAsset with cameraShotKey.length is less than 30 and no subtype
* @tc.size : MEDIUM
* @tc.type : Function
* @tc.level : Level 2
*/
it
(
'createAsset_promise_022'
,
2
,
async
function
(
done
)
{
const
testNum
=
'createAsset_promise_022'
;
const
displayName
=
testNum
+
'.mp4'
;
const
cameraShotKey
=
'createAsset_promise_0220a'
;
const
createOption
:
photoAccessHelper
.
PhotoCreateOptions
=
{
cameraShotKey
:
cameraShotKey
,
};
await
createAssetAbnormalPromise2
(
done
,
testNum
,
displayName
,
createOption
);
});
})
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录