Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
d0542c03
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看板
未验证
提交
d0542c03
编写于
5月 27, 2022
作者:
O
openharmony_ci
提交者:
Gitee
5月 27, 2022
浏览文件
操作
浏览文件
下载
差异文件
!3323 Image测试用例整改
Merge pull request !3323 from 秦莉文/OpenHarmony-3.2-Beta1
上级
e81dfa83
d62d7ebd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
216 addition
and
193 deletion
+216
-193
multimedia/image/image_js_standard/Test.json
multimedia/image/image_js_standard/Test.json
+53
-11
multimedia/image/image_js_standard/src/main/js/test/image.test.js
...ia/image/image_js_standard/src/main/js/test/image.test.js
+163
-182
未找到文件。
multimedia/image/image_js_standard/Test.json
浏览文件 @
d0542c03
...
...
@@ -20,24 +20,66 @@
"./resource/image/test.jpg ->/storage/media/100/local/files"
,
"./resource/image/test_exif.jpg ->/storage/media/100/local/files"
,
"./resource/image/moving_test.gif ->/storage/media/100/local/files"
]
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"mkdir /storage/media/100/local/files/cjh"
,
"cp /storage/media/100/local/files/test.tiff /storage/media/100/local/files/cjh/"
,
"cp /storage/media/100/local/files/test.123 /storage/media/100/local/files/cjh/"
,
"cp /storage/media/100/local/files/test.bmp /storage/media/100/local/files/cjh/"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/cjh/"
,
"cp /storage/media/100/local/files/test.gif /storage/media/100/local/files/cjh/"
,
"cp /storage/media/100/local/files/test.jpg /storage/media/100/local/files/cjh/"
,
"cp /storage/media/100/local/files/test_exif.jpg /storage/media/100/local/files/cjh/"
,
"cp /storage/media/100/local/files/moving_test.gif /storage/media/100/local/files/cjh/"
,
"mkdir /storage/media/100/local/files/img"
,
"cp /storage/media/100/local/files/test.tiff /storage/media/100/local/files/img/"
,
"cp /storage/media/100/local/files/test.123 /storage/media/100/local/files/img/"
,
"cp /storage/media/100/local/files/test.bmp /storage/media/100/local/files/img/"
,
"cp /storage/media/100/local/files/test.bmp /storage/media/100/local/files/img/test0.bmp"
,
"cp /storage/media/100/local/files/test.bmp /storage/media/100/local/files/img/test1.bmp"
,
"cp /storage/media/100/local/files/test.bmp /storage/media/100/local/files/img/test2.bmp"
,
"cp /storage/media/100/local/files/test.bmp /storage/media/100/local/files/img/test3.bmp"
,
"cp /storage/media/100/local/files/test.bmp /storage/media/100/local/files/img/test4.bmp"
,
"cp /storage/media/100/local/files/test.bmp /storage/media/100/local/files/img/test5.bmp"
,
"cp /storage/media/100/local/files/test.bmp /storage/media/100/local/files/img/test6.bmp"
,
"cp /storage/media/100/local/files/test.bmp /storage/media/100/local/files/img/test7.bmp"
,
"cp /storage/media/100/local/files/test.bmp /storage/media/100/local/files/img/test8.bmp"
,
"cp /storage/media/100/local/files/test.bmp /storage/media/100/local/files/img/test9.bmp"
,
"cp /storage/media/100/local/files/test.bmp /storage/media/100/local/files/img/test10.bmp"
,
"cp /storage/media/100/local/files/test.bmp /storage/media/100/local/files/img/test11.bmp"
,
"cp /storage/media/100/local/files/test.bmp /storage/media/100/local/files/img/test12.bmp"
,
"cp /storage/media/100/local/files/test.bmp /storage/media/100/local/files/img/test13.bmp"
,
"cp /storage/media/100/local/files/test.bmp /storage/media/100/local/files/img/test14.bmp"
,
"cp /storage/media/100/local/files/test.bmp /storage/media/100/local/files/img/test15.bmp"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test0.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test1.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test2.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test3.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test4.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test5.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test6.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test7.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test8.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test9.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test10.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test11.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test12.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test13.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test14.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test15.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test00.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test01.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test02.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test03.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test04.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test05.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test06.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test07.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test08.png"
,
"cp /storage/media/100/local/files/test.png /storage/media/100/local/files/img/test09.png"
,
"cp /storage/media/100/local/files/test.gif /storage/media/100/local/files/img/"
,
"cp /storage/media/100/local/files/test.jpg /storage/media/100/local/files/img/"
,
"cp /storage/media/100/local/files/test.jpg /storage/media/100/local/files/img/test0.jpg"
,
"cp /storage/media/100/local/files/test_exif.jpg /storage/media/100/local/files/img/"
,
"cp /storage/media/100/local/files/moving_test.gif /storage/media/100/local/files/img/"
,
"chmod -R 666 /data/media/*"
,
"chmod -R 666 /storage/media/100/local/files/
cjh
/*"
,
"chmod -R 666 /storage/media/100/local/files/
img
/*"
,
"killall com.ohos.medialibrary.MediaScannerAbilityA"
,
"aa start -a MediaScannerAbility -b com.ohos.medialibrary.MediaScannerAbilityA"
],
...
...
multimedia/image/image_js_standard/src/main/js/test/image.test.js
浏览文件 @
d0542c03
...
...
@@ -61,7 +61,7 @@ describe('Image', function () {
let
fileKeyObj
=
mediaLibrary
.
FileKey
;
let
getFileOp
=
{
selections
:
fileKeyObj
.
DISPLAY_NAME
+
'
= ? AND
'
+
fileKeyObj
.
RELATIVE_PATH
+
'
= ?
'
,
selectionArgs
:
[
fileName
,
'
cjh
/
'
],
selectionArgs
:
[
fileName
,
'
img
/
'
],
order
:
fileKeyObj
.
ID
+
"
DESC LIMIT 0,100
"
,
extendArgs
:
""
,
}
...
...
@@ -852,55 +852,57 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_022-1
'
,
0
,
async
function
(
done
)
{
const
color
=
new
ArrayBuffer
(
96
);
let
opts
=
{
editable
:
true
,
pixelFormat
:
3
,
size
:
{
height
:
4
,
width
:
6
}
}
image
.
createPixelMap
(
color
,
opts
,
(
err
,
pixelmap
)
=>
{
if
(
pixelmap
==
undefined
)
{
console
.
info
(
'
TC_022-1 createPixelMap failed
'
);
expect
(
false
).
assertTrue
()
done
();
}
const
area
=
{
pixels
:
new
ArrayBuffer
(
8
),
const
color
=
new
ArrayBuffer
(
96
);
let
opts
=
{
editable
:
true
,
pixelFormat
:
3
,
size
:
{
height
:
4
,
width
:
6
}
}
image
.
createPixelMap
(
color
,
opts
,
(
err
,
pixelmap
)
=>
{
if
(
pixelmap
==
undefined
)
{
console
.
info
(
'
TC_022-1 createPixelMap failed
'
);
expect
(
false
).
assertTrue
()
done
();
}
const
area
=
{
pixels
:
new
ArrayBuffer
(
8
),
offset
:
0
,
stride
:
8
,
region
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
}
}
var
bufferArr
=
new
Uint8Array
(
area
.
pixels
);
for
(
var
i
=
0
;
i
<
bufferArr
.
length
;
i
++
)
{
bufferArr
[
i
]
=
i
+
1
;
}
pixelmap
.
writePixels
(
area
,
()
=>
{
const
readArea
=
{
pixels
:
new
ArrayBuffer
(
8
),
offset
:
0
,
stride
:
8
,
region
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
}
}
var
bufferArr
=
new
Uint8Array
(
area
.
pixels
);
for
(
var
i
=
0
;
i
<
bufferArr
.
length
;
i
++
)
{
bufferArr
[
i
]
=
i
+
1
;
}
pixelmap
.
writePixels
(
area
,
()
=>
{
const
readArea
=
{
pixels
:
new
ArrayBuffer
(
8
),
offset
:
0
,
stride
:
8
,
region
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
}
}
pixelmap
.
readPixels
(
readArea
,()
=>
{
var
readArr
=
new
Uint8Array
(
readArea
.
pixels
);
var
res
=
true
;
for
(
var
i
=
0
;
i
<
readArr
.
length
;
i
++
)
{
if
(
readArr
[
i
]
==
0
)
{
res
=
false
;
console
.
info
(
'
TC_022-1 failed
'
);
expect
(
false
).
assertTrue
();
done
();
break
;
}
}
if
(
res
)
{
console
.
info
(
'
TC_022-1 success
'
);
expect
(
true
).
assertTrue
()
pixelmap
.
readPixels
(
readArea
,
()
=>
{
var
readArr
=
new
Uint8Array
(
readArea
.
pixels
);
var
res
=
true
;
for
(
var
i
=
0
;
i
<
readArr
.
length
;
i
++
)
{
if
(
readArr
[
i
]
!=
tc_022buf
[
i
])
{
res
=
false
;
console
.
info
(
'
TC_022-1 failed
'
);
expect
(
false
).
assertTrue
();
done
();
break
;
}
})
}
if
(
res
)
{
console
.
info
(
'
TC_022-1 success
'
);
expect
(
true
).
assertTrue
()
done
();
}
})
})
})
.
catch
(
error
=>
{
console
.
log
(
'
TC_022-1 error:
'
+
error
);
expect
().
assertFail
();
done
();
})
})
})
/**
* @tc.number : TC_023
...
...
@@ -1345,7 +1347,6 @@ describe('Image', function () {
*/
it
(
'
TC_042
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_042 create image source failed
'
);
...
...
@@ -1353,9 +1354,24 @@ describe('Image', function () {
done
();
}
else
{
imageSourceApi
.
getImageInfo
((
err
,
imageInfo
)
=>
{
console
.
info
(
'
TC_042 success
'
);
expect
(
imageInfo
!=
undefined
).
assertTrue
();
done
();
if
(
err
){
expect
(
false
).
assertTrue
();
console
.
info
(
'
TC_042 err:
'
+
err
);
done
();
return
}
if
(
imageInfo
!=
undefined
){
console
.
info
(
'
TC_042 success
'
);
console
.
info
(
'
TC_042 imageInfo height:
'
+
imageInfo
.
size
.
height
);
console
.
info
(
'
TC_042 imageInfo width:
'
+
imageInfo
.
size
.
width
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
TC_042 failed
'
);
expect
(
false
).
assertTrue
();
done
();
}
})
}
})
...
...
@@ -1435,7 +1451,6 @@ describe('Image', function () {
*/
it
(
'
TC_044
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_044 create image source failed
'
);
...
...
@@ -1466,7 +1481,6 @@ describe('Image', function () {
*/
it
(
'
TC_044-1
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_044-1 create image source failed
'
);
...
...
@@ -1481,35 +1495,6 @@ describe('Image', function () {
}
})
/**
* @tc.number : TC_045
* @tc.name : getImageInfo(callback: AsyncCallback<ImageInfo>)-jpg
* @tc.desc : 1.create imageSource
* 2.imageSourcecall getImageInfo(ImageInfo)
* 3.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
TC_045
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_045 create image source failed
'
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imageSourceApi
.
getImageInfo
((
err
,
imageInfo
)
=>
{
console
.
info
(
'
TC_045 imageInfo
'
);
console
.
info
(
'
imageInfo.size.height:
'
+
imageInfo
.
size
.
height
);
console
.
info
(
'
imageInfo.size.width:
'
+
imageInfo
.
size
.
width
);
expect
(
imageInfo
!=
undefined
).
assertTrue
();
done
();
})
}
})
/**
* @tc.number : TC_045-1
* @tc.name : getImageInfo(callback: AsyncCallback<ImageInfo>)-bmp
...
...
@@ -1577,7 +1562,6 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_045-3
'
,
0
,
async
function
(
done
)
{
console
.
info
(
'
TC_045-3
'
);
await
getFd
(
"
test.gif
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
...
...
@@ -1586,11 +1570,23 @@ describe('Image', function () {
done
();
}
else
{
imageSourceApi
.
getImageInfo
((
err
,
imageInfo
)
=>
{
expect
(
imageInfo
!=
undefined
).
assertTrue
();
console
.
info
(
'
TC_045-3 imageInfo
'
);
console
.
info
(
'
imageInfo.size.height:
'
+
imageInfo
.
size
.
height
);
console
.
info
(
'
imageInfo.size.width:
'
+
imageInfo
.
size
.
width
);
done
();
if
(
err
){
expect
(
false
).
assertTrue
();
console
.
info
(
'
TC_045-3 error
'
+
err
);
done
();
return
}
if
(
imageInfo
!=
undefined
&&
imageInfo
!=
null
){
expect
(
true
).
assertTrue
();
console
.
info
(
'
TC_045-3 imageInfo.size.height:
'
+
imageInfo
.
size
.
height
);
console
.
info
(
'
TC_045-3 imageInfo.size.width:
'
+
imageInfo
.
size
.
width
);
console
.
info
(
'
TC_045-3 success
'
)
done
();
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
TC_045-3 failed
'
)
done
();
}
})
}
})
...
...
@@ -1607,7 +1603,6 @@ describe('Image', function () {
*/
it
(
'
TC_046
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_046 create image source failed
'
);
...
...
@@ -1644,9 +1639,8 @@ describe('Image', function () {
}
else
{
imageSourceApi
.
getImageInfo
(
0
,
(
err
,
imageInfo
)
=>
{
expect
(
imageInfo
!=
undefined
).
assertTrue
();
console
.
info
(
'
TC_046-1 imageInfo
'
);
console
.
info
(
'
imageInfo.size.height:
'
+
imageInfo
.
size
.
height
);
console
.
info
(
'
imageInfo.size.width:
'
+
imageInfo
.
size
.
width
);
console
.
info
(
'
TC_046-1 imageInfo.size.height:
'
+
imageInfo
.
size
.
height
);
console
.
info
(
'
TC_046-1 imageInfo.size.width:
'
+
imageInfo
.
size
.
width
);
done
();
})
}
...
...
@@ -1699,11 +1693,23 @@ describe('Image', function () {
done
();
}
else
{
imageSourceApi
.
getImageInfo
(
0
,(
err
,
imageInfo
)
=>
{
expect
(
imageInfo
!=
undefined
).
assertTrue
();
console
.
info
(
'
TC_046-3 imageInfo
'
);
console
.
info
(
'
imageInfo.size.height:
'
+
imageInfo
.
size
.
height
);
console
.
info
(
'
imageInfo.size.width:
'
+
imageInfo
.
size
.
width
);
done
();
if
(
err
){
expect
(
false
).
assertTrue
();
console
.
info
(
'
TC_046-3 error
'
+
err
);
done
();
return
}
if
(
imageInfo
!=
undefined
&&
imageInfo
!=
null
){
expect
(
true
).
assertTrue
();
console
.
info
(
'
TC_046-3 imageInfo.size.height:
'
+
imageInfo
.
size
.
height
);
console
.
info
(
'
TC_046-3 imageInfo.size.width:
'
+
imageInfo
.
size
.
width
);
console
.
info
(
'
TC_046-3 success
'
)
done
();
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
TC_046-3 failed
'
)
done
();
}
})
}
})
...
...
@@ -1774,7 +1780,6 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_047
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
...
...
@@ -1883,11 +1888,16 @@ describe('Image', function () {
}
else
{
imageSourceApi
.
getImageInfo
(
0
)
.
then
(
imageInfo
=>
{
expect
(
imageInfo
!=
undefined
).
assertTrue
();
console
.
info
(
'
TC_047-3
'
);
console
.
info
(
'
imageInfo.size.height:
'
+
imageInfo
.
size
.
height
);
console
.
info
(
'
imageInfo.size.width:
'
+
imageInfo
.
size
.
width
);
done
();
if
(
imageInfo
!=
undefined
&&
imageInfo
!=
null
){
expect
(
true
).
assertTrue
();
console
.
info
(
'
TC_047-3 imageInfo.size.height:
'
+
imageInfo
.
size
.
height
);
console
.
info
(
'
TC_047-3 imageInfo.size.width:
'
+
imageInfo
.
size
.
width
);
done
();
}
else
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
TC_047-3 failed
'
);
done
();
}
}).
catch
(
error
=>
{
console
.
log
(
'
TC_047-3 error:
'
+
error
);
expect
().
assertFail
();
...
...
@@ -2519,7 +2529,7 @@ describe('Image', function () {
})
/**
* @tc.number : TC_050-14
* @tc.number : TC_05
s
0-14
* @tc.name : createPixelMap-promise-jpg
* @tc.desc : 1.create imagesource
* 2.set index and DecodeOptions
...
...
@@ -2695,10 +2705,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_062
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.Png
"
);
console
.
log
(
'
start~~~
'
);
console
.
log
(
'
fdPng0~~~~~~~~
'
+
fdNumber
);
console
.
log
(
'
fdPng1~~~~~~~~
'
+
JSON
.
stringify
(
fdPng
));
await
getFd
(
"
test00.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_062 create image source failed
'
);
...
...
@@ -2738,7 +2745,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_062-1
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
01
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_062-1 create image source failed
'
);
...
...
@@ -2773,7 +2780,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_062-2
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
02
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_062-2 create image source failed
'
);
...
...
@@ -2809,7 +2816,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_062-3
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
03
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_062-3 create image source failed
'
);
...
...
@@ -2822,7 +2829,7 @@ describe('Image', function () {
expect
(
false
).
assertTrue
();
done
();
}
else
{
let
packOpts
=
{
format
:[
"
image/jpg
"
],
quality
:
101
}
let
packOpts
=
{
format
:[
"
image/jp
e
g
"
],
quality
:
101
}
imagePackerApi
.
packing
(
imageSourceApi
,
packOpts
,
(
err
,
data
)
=>
{
console
.
info
(
'
TC_062-3 success
'
);
expect
(
data
==
undefined
).
assertTrue
();
...
...
@@ -2845,7 +2852,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_062-4
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
04
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_062-4 create image source failed
'
);
...
...
@@ -2876,9 +2883,9 @@ describe('Image', function () {
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
TC_062-5
'
,
0
,
async
function
(
done
)
{
// await getFd("test.png");
await
getFd
(
"
test.Png
"
);
await
getFd
(
"
test05.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_062-5 create image source failed
'
);
...
...
@@ -2891,7 +2898,7 @@ describe('Image', function () {
expect
(
false
).
assertTrue
();
done
();
}
else
{
let
packOpts
=
{
format
:[
"
image/jpg
"
]
}
let
packOpts
=
{
format
:[
"
image/jp
e
g
"
]
}
imagePackerApi
.
packing
(
imageSourceApi
,
packOpts
)
.
then
(
data
=>
{
console
.
info
(
'
TC_062-5 failed
'
);
...
...
@@ -2906,6 +2913,7 @@ describe('Image', function () {
}
}
})
/**
* @tc.number : TC_062-6
...
...
@@ -2919,7 +2927,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_062-6
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
06
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_062-6 create image source failed
'
);
...
...
@@ -2948,41 +2956,6 @@ describe('Image', function () {
}
})
/**
* @tc.number : TC_062-7
* @tc.name : packing ImageSource - callback - quality 100
* @tc.desc : 1.create ImageSource
* 2.call packing
* 3.return array
* 4.callbackcall return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
TC_062-7
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_062-7 create image source failed
'
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
'
TC_062-7 create image packer failed
'
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
let
packOpts
=
{
format
:[
"
image/jpeg
"
],
quality
:
100
}
imagePackerApi
.
packing
(
imageSourceApi
,
packOpts
,
(
err
,
data
)
=>
{
console
.
info
(
'
TC_062-7 success
'
);
expect
(
data
!=
undefined
).
assertTrue
();
done
();
})
}
}
})
/**
* @tc.number : TC_062-8
* @tc.name : packing ImageSource - callback - quality 0
...
...
@@ -2995,7 +2968,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_062-8
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
08
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_062-8 create image source failed
'
);
...
...
@@ -3030,7 +3003,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_062-9
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
09
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_062-9 create image source failed
'
);
...
...
@@ -3155,9 +3128,16 @@ describe('Image', function () {
expect
(
false
).
assertTrue
();
done
();
}
else
{
imageSourceApi
.
release
(()
=>
{
imageSourceApi
.
release
(
async
(
err
)
=>
{
if
(
err
){
console
.
info
(
'
TC_064-1 err:
'
+
err
);
expect
(
false
).
assertTrue
();
done
();
return
}
console
.
info
(
'
TC_064-1 Success
'
);
expect
(
true
).
assertTrue
();
expect
(
true
).
assertTrue
();
done
();
})
}
...
...
@@ -3211,7 +3191,7 @@ describe('Image', function () {
expect
(
false
).
assertTrue
();
done
();
}
else
{
imageSourceApi
.
release
(()
=>
{
imageSourceApi
.
release
(
async
()
=>
{
console
.
info
(
'
TC_065-1 Success
'
);
expect
(
true
).
assertTrue
();
done
();
...
...
@@ -3886,7 +3866,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_068
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
await
getFd
(
"
test
0
.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_068 create image source failed
'
);
...
...
@@ -3921,7 +3901,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_068-1
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
await
getFd
(
"
test
1
.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_068-1 create image source failed
'
);
...
...
@@ -3956,7 +3936,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_068-2
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
await
getFd
(
"
test
2
.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_068-2 create image source failed
'
);
...
...
@@ -3991,7 +3971,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_068-3
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
await
getFd
(
"
test
3
.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_068-3 create image source failed
'
);
...
...
@@ -4032,7 +4012,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_068-4
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
await
getFd
(
"
test
4
.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_068-4 create image source failed
'
);
...
...
@@ -4073,7 +4053,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_068-5
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
await
getFd
(
"
test
5
.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_068-5 create image source failed
'
);
...
...
@@ -4114,7 +4094,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_068-6
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
await
getFd
(
"
test
6
.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_068-6 create image source failed
'
);
...
...
@@ -4155,7 +4135,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_068-7
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
await
getFd
(
"
test
7
.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_068-7 create image source failed
'
);
...
...
@@ -4196,7 +4176,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_068-8
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
await
getFd
(
"
test
8
.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_068-8 create image source failed
'
);
...
...
@@ -4232,7 +4212,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_068-9
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
await
getFd
(
"
test
9
.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_068-9 create image source failed
'
);
...
...
@@ -4268,7 +4248,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_068-10
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
await
getFd
(
"
test
10
.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_068-10 create image source failed
'
);
...
...
@@ -4309,7 +4289,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_068-11
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
await
getFd
(
"
test
11
.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_068-11 create image source failed
'
);
...
...
@@ -4350,7 +4330,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_068-12
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
await
getFd
(
"
test
12
.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_068-12 create image source failed
'
);
...
...
@@ -4390,7 +4370,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_068-13
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
await
getFd
(
"
test
13
.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_068-13 create image source failed
'
);
...
...
@@ -4430,7 +4410,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_068-14
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
await
getFd
(
"
test
14
.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_068-14 create image source failed
'
);
...
...
@@ -4461,7 +4441,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_068-15
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
await
getFd
(
"
test
15
.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_068-15 create image source failed
'
);
...
...
@@ -4487,7 +4467,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_163
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
0
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_163 create image source failed
'
);
...
...
@@ -4522,7 +4502,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_163-1
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
1
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_163-1 create image source failed
'
);
...
...
@@ -4557,7 +4537,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_163-2
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
2
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_163-2 create image source failed
'
);
...
...
@@ -4592,7 +4572,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_163-3
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
3
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_163-3 create image source failed
'
);
...
...
@@ -4634,7 +4614,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_163-4
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
4
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_163-4 create image source failed
'
);
...
...
@@ -4676,7 +4656,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_163-5
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
5
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_163-5 create image source failed
'
);
...
...
@@ -4718,7 +4698,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_163-6
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
6
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_163-6 create image source failed
'
);
...
...
@@ -4760,7 +4740,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_163-7
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
7
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_163-7 create image source failed
'
);
...
...
@@ -4802,7 +4782,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_163-8
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
8
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_163-8 create image source failed
'
);
...
...
@@ -4838,8 +4818,9 @@ describe('Image', function () {
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
TC_163-9
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
9
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_163-9 create image source failed
'
);
...
...
@@ -4849,7 +4830,7 @@ describe('Image', function () {
let
decodingOptions
=
{
sampleSize
:
1
,
editable
:
true
,
desiredSize
:{
width
:
10000
,
height
:
100
00
},
desiredSize
:{
width
:
500
,
height
:
5
00
},
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
...
...
@@ -4876,7 +4857,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_163-10
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
10
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_163-10 create image source failed
'
);
...
...
@@ -4918,7 +4899,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_163-11
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
11
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_163-11 create image source failed
'
);
...
...
@@ -4960,7 +4941,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_163-12
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
12
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_163-12 create image source failed
'
);
...
...
@@ -5000,7 +4981,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_163-13
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
13
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_163-13 create image source failed
'
);
...
...
@@ -5040,7 +5021,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_163-14
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
14
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_163-14 create image source failed
'
);
...
...
@@ -5071,7 +5052,7 @@ describe('Image', function () {
* @tc.level : Level 1
*/
it
(
'
TC_163-15
'
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
await
getFd
(
"
test
15
.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
TC_163-15 create image source failed
'
);
...
...
@@ -5256,7 +5237,7 @@ describe('Image', function () {
imageSourceApi
.
getImageProperty
(
"
BitsPerSample
"
)
.
then
(
data
=>
{
console
.
info
(
'
TC_171 BitsPerSample
'
+
data
);
expect
(
data
!=
undefined
&&
data
!=
''
).
assertTrue
();
expect
(
data
!=
undefined
).
assertTrue
();
done
();
})
.
catch
(
error
=>
{
...
...
@@ -5556,7 +5537,7 @@ describe('Image', function () {
done
();
}
else
{
console
.
info
(
'
TC_172 BitsPerSample
'
+
data
);
expect
(
data
!=
undefined
&&
data
!=
''
).
assertTrue
();
expect
(
data
!=
undefined
).
assertTrue
();
done
();
}
})
...
...
@@ -5846,7 +5827,7 @@ describe('Image', function () {
done
();
}
else
{
console
.
info
(
'
TC_173 BitsPerSample
'
+
data
);
expect
(
data
!=
'
9999
'
&&
data
!=
undefined
&&
data
!=
''
).
assertTrue
();
expect
(
data
!=
'
9999
'
&&
data
!=
undefined
).
assertTrue
();
done
();
}
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录