Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
6b0f6fd0
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看板
未验证
提交
6b0f6fd0
编写于
10月 25, 2022
作者:
O
openharmony_ci
提交者:
Gitee
10月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
!6010 image 接口覆盖
Merge pull request !6010 from caochuan/getImageProp
上级
fcf1c96b
2cc93df2
变更
27
隐藏空白更改
内联
并排
Showing
27 changed file
with
4184 addition
and
1947 deletion
+4184
-1947
multimedia/BUILD.gn
multimedia/BUILD.gn
+1
-0
multimedia/image/image_js_standard/imageDecodeOptions/src/main/js/test/image.test.js
...tandard/imageDecodeOptions/src/main/js/test/image.test.js
+1012
-691
multimedia/image/image_js_standard/imageGetImageProperty/BUILD.gn
...ia/image/image_js_standard/imageGetImageProperty/BUILD.gn
+35
-0
multimedia/image/image_js_standard/imageGetImageProperty/Test.json
...a/image/image_js_standard/imageGetImageProperty/Test.json
+47
-0
multimedia/image/image_js_standard/imageGetImageProperty/signature/openharmony_sx.p7b
...andard/imageGetImageProperty/signature/openharmony_sx.p7b
+0
-0
multimedia/image/image_js_standard/imageGetImageProperty/src/main/config.json
...ge_js_standard/imageGetImageProperty/src/main/config.json
+132
-0
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/MainAbility/app.js
...dard/imageGetImageProperty/src/main/js/MainAbility/app.js
+23
-0
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/MainAbility/i18n/en-US.json
...eGetImageProperty/src/main/js/MainAbility/i18n/en-US.json
+6
-0
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/MainAbility/i18n/zh-CN.json
...eGetImageProperty/src/main/js/MainAbility/i18n/zh-CN.json
+6
-0
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/MainAbility/pages/index/index.css
...ageProperty/src/main/js/MainAbility/pages/index/index.css
+46
-0
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/MainAbility/pages/index/index.hml
...ageProperty/src/main/js/MainAbility/pages/index/index.hml
+5
-0
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/MainAbility/pages/index/index.js
...mageProperty/src/main/js/MainAbility/pages/index/index.js
+29
-0
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/TestAbility/app.js
...dard/imageGetImageProperty/src/main/js/TestAbility/app.js
+31
-0
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/TestAbility/i18n/en-US.json
...eGetImageProperty/src/main/js/TestAbility/i18n/en-US.json
+8
-0
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/TestAbility/i18n/zh-CN.json
...eGetImageProperty/src/main/js/TestAbility/i18n/zh-CN.json
+8
-0
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/TestAbility/pages/index/index.css
...ageProperty/src/main/js/TestAbility/pages/index/index.css
+30
-0
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/TestAbility/pages/index/index.hml
...ageProperty/src/main/js/TestAbility/pages/index/index.hml
+5
-0
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/TestAbility/pages/index/index.js
...mageProperty/src/main/js/TestAbility/pages/index/index.js
+26
-0
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/TestRunner/OpenHarmonyTestRunner.js
...eProperty/src/main/js/TestRunner/OpenHarmonyTestRunner.js
+59
-0
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/test/List.test.js
...ndard/imageGetImageProperty/src/main/js/test/List.test.js
+18
-0
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/test/getProperty.test.js
...mageGetImageProperty/src/main/js/test/getProperty.test.js
+1035
-0
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/test/getPropertyBuf.js
.../imageGetImageProperty/src/main/js/test/getPropertyBuf.js
+17
-0
multimedia/image/image_js_standard/imageGetImageProperty/src/main/resources/base/element/string.json
...ImageProperty/src/main/resources/base/element/string.json
+28
-0
multimedia/image/image_js_standard/imageGetImageProperty/src/main/resources/base/media/icon.png
...geGetImageProperty/src/main/resources/base/media/icon.png
+0
-0
multimedia/image/image_js_standard/imagePacking/src/main/js/test/packing.test.js
...js_standard/imagePacking/src/main/js/test/packing.test.js
+443
-331
multimedia/image/image_js_standard/imageRGBA/src/main/js/test/RGBA.test.js
...image_js_standard/imageRGBA/src/main/js/test/RGBA.test.js
+226
-161
multimedia/image/image_js_standard/imageYUV/src/main/js/test/yuv.test.js
...e/image_js_standard/imageYUV/src/main/js/test/yuv.test.js
+908
-764
未找到文件。
multimedia/BUILD.gn
浏览文件 @
6b0f6fd0
...
...
@@ -31,6 +31,7 @@ group("multimedia") {
"image/image_js_standard/imageCreator:image_creator_js_hap",
"image/image_js_standard/imageDecodeOptions:image_DecodeOptions_js_hap",
"image/image_js_standard/imageExif:image_exif_js_hap",
"image/image_js_standard/imageGetImageProperty:image_getProperty_js_hap",
"image/image_js_standard/imageModifyProperty:image_modifyProperty_js_hap",
"image/image_js_standard/imagePacking:image_packing_js_hap",
"image/image_js_standard/imagePixelMapFramework:image_pixelmapframework_js_hap",
...
...
multimedia/image/image_js_standard/imageDecodeOptions/src/main/js/test/image.test.js
浏览文件 @
6b0f6fd0
...
...
@@ -13,57 +13,61 @@
* limitations under the License.
*/
import
image
from
'
@ohos.multimedia.image
'
import
fileio
from
'
@ohos.fileio
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
featureAbility
from
'
@ohos.ability.featureAbility
'
import
image
from
"
@ohos.multimedia.image
"
;
import
fileio
from
"
@ohos.fileio
"
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
"
@ohos/hypium
"
;
import
featureAbility
from
"
@ohos.ability.featureAbility
"
;
export
default
function
imageDecodeOptions
()
{
describe
(
'
imageDecodeOptions
'
,
function
()
{
describe
(
"
imageDecodeOptions
"
,
function
()
{
let
filePath
;
let
fdNumber
;
let
globalpixelmap
;
async
function
getFd
(
fileName
)
{
let
context
=
await
featureAbility
.
getContext
();
await
context
.
getFilesDir
().
then
((
data
)
=>
{
filePath
=
data
+
'
/
'
+
fileName
;
console
.
info
(
'
image case filePath is
'
+
filePath
);
})
await
fileio
.
open
(
filePath
).
then
((
data
)
=>
{
fdNumber
=
data
;
console
.
info
(
"
image case open fd success
"
+
fdNumber
);
},
(
err
)
=>
{
console
.
info
(
"
image cese open fd fail
"
+
err
)
}).
catch
((
err
)
=>
{
console
.
info
(
"
image case open fd err
"
+
err
);
})
filePath
=
data
+
"
/
"
+
fileName
;
console
.
info
(
"
image case filePath is
"
+
filePath
);
});
await
fileio
.
open
(
filePath
)
.
then
(
(
data
)
=>
{
fdNumber
=
data
;
console
.
info
(
"
image case open fd success
"
+
fdNumber
);
},
(
err
)
=>
{
console
.
info
(
"
image cese open fd fail
"
+
err
);
}
)
.
catch
((
err
)
=>
{
console
.
info
(
"
image case open fd err
"
+
err
);
});
}
beforeAll
(
async
function
()
{
console
.
info
(
'
beforeAll case
'
);
})
console
.
info
(
"
beforeAll case
"
);
})
;
beforeEach
(
function
()
{
console
.
info
(
'
beforeEach case
'
);
})
console
.
info
(
"
beforeEach case
"
);
})
;
afterEach
(
async
function
()
{
if
(
globalpixelmap
!=
undefined
)
{
console
.
info
(
'
globalpixelmap release start
'
);
console
.
info
(
"
globalpixelmap release start
"
);
try
{
await
globalpixelmap
.
release
();
}
catch
(
error
)
{
console
.
info
(
'
globalpixelmap release fail
'
);
console
.
info
(
"
globalpixelmap release fail
"
);
}
}
console
.
info
(
'
afterEach case
'
);
})
console
.
info
(
"
afterEach case
"
);
})
;
afterAll
(
async
function
()
{
console
.
info
(
'
afterAll case
'
);
})
console
.
info
(
"
afterAll case
"
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0100
...
...
@@ -72,16 +76,18 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0100
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0100
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.jpg
'
);
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0100 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0100 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -92,27 +98,32 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
3
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0100 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0100 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0100 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0100 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0100 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0100 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0200
...
...
@@ -121,16 +132,18 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0200
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0200
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.jpg
'
);
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0200 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0200 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -141,27 +154,32 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0200 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0200 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0200 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0200 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0200 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0200 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0300
...
...
@@ -170,16 +188,18 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return null
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0300
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0300
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.jpg
'
);
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0300 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0300 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -190,27 +210,32 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
0
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0300 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0300 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0300 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0300 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0300 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_JPG_0300 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0100
...
...
@@ -219,16 +244,18 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0100
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0100
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.jpg
'
);
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0100 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0100 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -239,27 +266,30 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
0
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
1
index
:
1
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0100 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0100 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0100 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0100 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0100 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0100 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0100 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0100 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0200
...
...
@@ -268,16 +298,18 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0200
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0200
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.jpg
'
);
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0200 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0200 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -288,27 +320,30 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
0
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
-
1
index
:
-
1
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0200 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0200 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0200 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0200 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0200 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0200 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0200 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0200 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0100
...
...
@@ -317,16 +352,18 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0100
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0100
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.jpg
'
);
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0100 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0100 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -337,27 +374,32 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
0
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0100 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0100 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0100 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0100 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0100 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0100 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0100 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0100 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0100
...
...
@@ -366,16 +408,18 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0100
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0100
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.jpg
'
);
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0100 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0100 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -386,45 +430,52 @@ export default function imageDecodeOptions() {
rotate
:
-
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0100 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0100 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0100 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0100 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0100 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0100 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0100 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0100 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0100
* @tc.name : createPixelMap(decodingOptions:unsupported pixelformat)-jpg
* @tc.name : createPixelMap(decodingOptions:unsupported pixelformat)-jpg
* @tc.desc : 1.create imagesource
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0100
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0100
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.jpg
'
);
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0100 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0100 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -435,27 +486,37 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
60
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0100 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0100 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0100 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0100 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0100 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0100 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0100 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0100 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0100
...
...
@@ -464,16 +525,18 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0100
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0100
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.jpg
'
);
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0100 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0100 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -484,27 +547,30 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0100 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0100 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0100 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0100 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0100 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0100 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0100
...
...
@@ -513,16 +579,18 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0100
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0100
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.jpg
'
);
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0100 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0100 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -533,27 +601,30 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0100 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0100 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0100 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0100 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0100 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0100 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0200
...
...
@@ -562,16 +633,18 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0200
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0200
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.jpg
'
);
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0200 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0200 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -582,34 +655,45 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
10000
,
width
:
10000
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0200 createPixelMap err
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0200 createPixelMap err
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
pixelmap
.
getImageInfo
().
then
((
imageInfo
)
=>
{
expect
(
imageInfo
.
size
.
height
==
2
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
1
).
assertTrue
();
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0200 success
'
);
console
.
info
(
"
imageInfo height :
"
+
imageInfo
.
size
.
height
);
console
.
info
(
"
imageInfo width :
"
+
imageInfo
.
size
.
width
);
done
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0200 getimageInfo err
'
+
JSON
.
stringify
(
err
));
})
pixelmap
.
getImageInfo
()
.
then
((
imageInfo
)
=>
{
expect
(
imageInfo
.
size
.
height
==
2
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
1
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0200 success
"
);
console
.
info
(
"
imageInfo height :
"
+
imageInfo
.
size
.
height
);
console
.
info
(
"
imageInfo width :
"
+
imageInfo
.
size
.
width
);
done
();
})
.
catch
((
err
)
=>
{
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0200 getimageInfo err
"
+
JSON
.
stringify
(
err
)
);
});
}
})
})
;
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0200 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0200 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0100
...
...
@@ -618,16 +702,16 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0100
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0100
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.jpg
'
);
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0100 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0100 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -638,27 +722,30 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
-
1
,
y
:
-
1
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0100 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0100 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0100 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0100 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0100 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0100 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0100 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0100 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0200
...
...
@@ -671,12 +758,12 @@ export default function imageDecodeOptions() {
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0200
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0200
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.jpg
'
);
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0200 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0200 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -687,27 +774,30 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
10000
,
y
:
10000
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0200 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0200 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0200 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0200 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0200 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0200 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0200 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0200 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0200
...
...
@@ -720,12 +810,14 @@ export default function imageDecodeOptions() {
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0200
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0200
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.jpg
'
);
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0200 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0200 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -736,27 +828,32 @@ export default function imageDecodeOptions() {
rotate
:
500
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
1
,
y
:
2
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0200 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0200 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0200 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0200 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0200 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0200 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0200 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0200 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PROMISE_0100
...
...
@@ -765,36 +862,41 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PROMISE_0100
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.jpg
'
);
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PROMISE_0100 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PROMISE_0100 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imageSourceApi
.
createPixelMap
().
then
(
pixelmap
=>
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PROMISE_0100 success
'
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}).
catch
(
error
=>
{
console
.
log
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PROMISE_0100 error:
'
+
error
);
expect
().
assertFail
();
done
();
})
imageSourceApi
.
createPixelMap
()
.
then
((
pixelmap
)
=>
{
globalpixelmap
=
pixelmap
;
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PROMISE_0100 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
})
.
catch
((
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PROMISE_0100 error:
"
+
error
);
expect
().
assertFail
();
done
();
});
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PROMISE_0100 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PROMISE_0100 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_CALLBACK_0100
...
...
@@ -803,32 +905,34 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return null
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_CALLBACK_0100
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_CALLBACK_0100
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.jpg
'
);
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_CALLBACK_0100 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_CALLBACK_0100 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imageSourceApi
.
createPixelMap
((
err
,
pixelmap
)
=>
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_CALLBACK_0100 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_CALLBACK_0100 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
})
})
;
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_CALLBACK_0100 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_CALLBACK_0100 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0100
...
...
@@ -837,15 +941,17 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0100
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
moving_test.gif
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0100
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
moving_test.gif
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0100 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0100 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -856,22 +962,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
3
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0100 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0100 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0100 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0100 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0200
...
...
@@ -880,15 +989,17 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return null
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0200
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
moving_test.gif
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0200
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
moving_test.gif
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0200 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0200 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -899,22 +1010,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0200 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0200 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0200 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0200 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0300
...
...
@@ -923,15 +1037,17 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0300
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
moving_test.gif
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0300
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
moving_test.gif
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0300 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0300 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -942,39 +1058,42 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
0
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0300 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0300 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0300 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0300 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0300
* @tc.name : createPixelMap(decodingOptions:index 1})-gif
* @tc.name : createPixelMap(decodingOptions:index 1})-gif
* @tc.desc : 1.create imagesource
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return null
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0300
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
moving_test.gif
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0300
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
moving_test.gif
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0300 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0300 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -985,22 +1104,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
0
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
1
index
:
1
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0300 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0300 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0300 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0300 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0400
...
...
@@ -1009,15 +1131,15 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return null
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0400
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
moving_test.gif
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0400
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
moving_test.gif
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0400 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0400 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1028,22 +1150,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
0
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
-
1
index
:
-
1
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0400 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0400 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0400 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0400 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0400 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0400 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0200
...
...
@@ -1052,15 +1177,17 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0200
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
moving_test.gif
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0200
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
moving_test.gif
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0200 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0200 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1071,22 +1198,27 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
0
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0200 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0200 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0200 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0200 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0200 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0200 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0300
...
...
@@ -1095,15 +1227,15 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0300
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
moving_test.gif
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0300
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
moving_test.gif
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0300 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0300 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1114,39 +1246,44 @@ export default function imageDecodeOptions() {
rotate
:
-
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0300 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0300 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0300 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0300 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0300 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0300 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0200
* @tc.name : createPixelMap(decodingOptions:unsupported pixelformat)-gif
* @tc.name : createPixelMap(decodingOptions:unsupported pixelformat)-gif
* @tc.desc : 1.create imagesource
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0200
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
moving_test.gif
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0200
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
moving_test.gif
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0200 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0200 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1157,22 +1294,30 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
60
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0200 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0200 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0200 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0200 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0200 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0200 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0200
...
...
@@ -1181,15 +1326,17 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0200
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
moving_test.gif
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0200
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
moving_test.gif
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0200 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0200 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1200,22 +1347,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0200 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0200 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0200 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0200 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0300
...
...
@@ -1224,15 +1374,15 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0300
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
moving_test.gif
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0300
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
moving_test.gif
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0300 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0300 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1243,22 +1393,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0300 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0300 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0300 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0300 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0400
...
...
@@ -1267,15 +1420,15 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0400
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
moving_test.gif
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0400
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
moving_test.gif
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0400 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0400 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1286,29 +1439,38 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
10000
,
width
:
10000
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0400 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0400 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
pixelmap
.
getImageInfo
().
then
((
imageInfo
)
=>
{
expect
(
imageInfo
.
size
.
height
==
2
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
1
).
assertTrue
();
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0400 success
'
);
pixelmap
.
getImageInfo
()
.
then
((
imageInfo
)
=>
{
expect
(
imageInfo
.
size
.
height
==
2
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
1
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0400 success
"
);
console
.
info
(
"
imageInfo height :
"
+
imageInfo
.
size
.
height
);
console
.
info
(
"
imageInfo width :
"
+
imageInfo
.
size
.
width
);
done
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0400 getimageInfo err
'
+
JSON
.
stringify
(
err
));
})
done
();
})
.
catch
((
err
)
=>
{
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0400 getimageInfo err
"
+
JSON
.
stringify
(
err
)
);
});
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0300
...
...
@@ -1317,15 +1479,15 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0300
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
moving_test.gif
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0300
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
moving_test.gif
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0300 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0300 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1336,22 +1498,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
-
1
,
y
:
-
1
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0300 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0300createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0300 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0300createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0300 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0300 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0400
...
...
@@ -1360,15 +1525,15 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0400
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
moving_test.gif
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0400
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
moving_test.gif
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0400 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0400 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1379,22 +1544,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
10000
,
y
:
10000
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0400 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0400 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0400 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0400 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0400 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0400 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0400
...
...
@@ -1403,15 +1571,15 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0400
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
moving_test.gif
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0400
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
moving_test.gif
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0400 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0400 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1422,22 +1590,25 @@ export default function imageDecodeOptions() {
rotate
:
500
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
1
,
y
:
2
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0400 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0400 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0400 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0400 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0400 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0400 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PROMISE_0200
...
...
@@ -1446,30 +1617,33 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PROMISE_0200
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
moving_test.gif
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PROMISE_0200
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
moving_test.gif
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PROMISE_0200 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PROMISE_0200 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imageSourceApi
.
createPixelMap
().
then
(
pixelmap
=>
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PROMISE_0200 success
'
);
expect
(
pixelmap
!==
undefined
).
assertTrue
();
done
();
}).
catch
(
error
=>
{
console
.
log
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PROMISE_0200 error:
'
+
error
);
expect
().
assertFail
();
done
();
})
imageSourceApi
.
createPixelMap
()
.
then
((
pixelmap
)
=>
{
globalpixelmap
=
pixelmap
;
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PROMISE_0200 success
"
);
expect
(
pixelmap
!==
undefined
).
assertTrue
();
done
();
})
.
catch
((
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PROMISE_0200 error:
"
+
error
);
expect
().
assertFail
();
done
();
});
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_CALLBACK_0200
...
...
@@ -1478,26 +1652,25 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return null
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_CALLBACK_0200
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
moving_test.gif
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_CALLBACK_0200
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
moving_test.gif
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_CALLBACK_0200 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_CALLBACK_0200 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imageSourceApi
.
createPixelMap
((
err
,
pixelmap
)
=>
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_CALLBACK_0200 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_CALLBACK_0200 success
"
);
expect
(
pixelmap
!==
undefined
).
assertTrue
();
done
();
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0400
...
...
@@ -1506,15 +1679,17 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0400
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.bmp
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0400
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0400 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0400 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1525,22 +1700,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
3
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0400 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0400 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0400 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0400 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0500
...
...
@@ -1549,15 +1727,17 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0500
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.bmp
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0500
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0500 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0500 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1568,22 +1748,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0500 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0500 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0500 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0500 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0600
...
...
@@ -1592,15 +1775,17 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0600
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.bmp
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0600
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0600 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0600 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1611,22 +1796,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
0
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0600 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0600 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0600 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0600 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0500
...
...
@@ -1635,15 +1823,15 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0500
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.bmp
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0500
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0500 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0500 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1654,22 +1842,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
0
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
1
index
:
1
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0500 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0500 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0500 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0500 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0500 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0500 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0600
...
...
@@ -1678,15 +1869,15 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0600
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.bmp
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0600
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0600 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0600 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1697,22 +1888,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
0
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
-
1
index
:
-
1
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0600 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0600 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0600 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0600 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0600 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0600 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0300
...
...
@@ -1721,15 +1915,17 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0300
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.bmp
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0300
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0300 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0300 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1740,22 +1936,27 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
0
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0300 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0300 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0300 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0300 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0300 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0300 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0500
...
...
@@ -1764,15 +1965,15 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0500
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.bmp
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0500
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0500 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0500 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1783,39 +1984,44 @@ export default function imageDecodeOptions() {
rotate
:
-
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0500 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0500 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0500 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0500 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0500 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0500 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0300
* @tc.name : createPixelMap(decodingOptions:unsupported pixelformat)-bmp
* @tc.name : createPixelMap(decodingOptions:unsupported pixelformat)-bmp
* @tc.desc : 1.create imagesource
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0300
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.bmp
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0300
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0300 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0300 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1826,22 +2032,30 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
60
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0300 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0300 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0300 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0300 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0300 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0300 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0300
...
...
@@ -1850,15 +2064,17 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0300
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.bmp
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0300
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0300 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0300 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1869,22 +2085,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0300 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0300 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0300 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0300 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0500
...
...
@@ -1893,15 +2112,15 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0500
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.bmp
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0500
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0500 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0500 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1912,22 +2131,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0500 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0500 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0500 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0500 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0600
...
...
@@ -1936,15 +2158,15 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0600
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.bmp
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0600
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0600 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0600 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -1955,30 +2177,39 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
10000
,
width
:
10000
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0600 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0600 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
pixelmap
.
getImageInfo
().
then
((
imageInfo
)
=>
{
expect
(
imageInfo
.
size
.
height
==
2
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
1
).
assertTrue
();
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0600 success
'
);
pixelmap
.
getImageInfo
()
.
then
((
imageInfo
)
=>
{
expect
(
imageInfo
.
size
.
height
==
2
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
1
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0600 success
"
);
console
.
info
(
"
imageInfo height :
"
+
imageInfo
.
size
.
height
);
console
.
info
(
"
imageInfo width :
"
+
imageInfo
.
size
.
width
);
done
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0600 getimageInfo err
'
+
JSON
.
stringify
(
err
));
})
done
();
})
.
catch
((
err
)
=>
{
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0600 getimageInfo err
"
+
JSON
.
stringify
(
err
)
);
});
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0500
...
...
@@ -1987,15 +2218,15 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0500
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.bmp
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0500
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0500 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0500 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -2006,22 +2237,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
-
1
,
y
:
-
1
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0500 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0500 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0500 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0500 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0500 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0500 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0600
...
...
@@ -2030,15 +2264,15 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0600
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.bmp
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0600
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0600 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0600 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -2049,22 +2283,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
10000
,
y
:
10000
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0600 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0600 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0600 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0600 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0600 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0600 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0600
...
...
@@ -2073,15 +2310,15 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0600
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.bmp
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0600
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.bmp
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0600 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0600 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -2092,22 +2329,25 @@ export default function imageDecodeOptions() {
rotate
:
500
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
1
,
y
:
2
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0600 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0600 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0600 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0600 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0600 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0600 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0700
...
...
@@ -2116,15 +2356,17 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0700
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.png
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0700
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0700 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0700 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -2135,22 +2377,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
3
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0700 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0700 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0700 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0700 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0800
...
...
@@ -2159,15 +2404,17 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0800
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.png
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0800
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0800 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0800 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -2178,22 +2425,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0800 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0800 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0800 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0800 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0900
...
...
@@ -2202,15 +2452,17 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0900
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.png
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0900
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0900 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0900 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -2221,22 +2473,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
0
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0900 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0900 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0900 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_PIXELFORMAT_0900 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0700
...
...
@@ -2245,15 +2500,15 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0700
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.png
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0700
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0700 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0700 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -2264,22 +2519,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
0
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
1
index
:
1
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0700 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0700 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0700 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0700 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0700 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0700 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0800
...
...
@@ -2289,15 +2547,15 @@ export default function imageDecodeOptions() {
* 3.call createPixelMap
* 4.set index=-1,options
* 5.return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0800
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.png
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0800
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0800 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0800 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -2308,22 +2566,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
0
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
-
1
index
:
-
1
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0800 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0800 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0800 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0800 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0800 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_INDEX_0800 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0400
...
...
@@ -2333,15 +2594,17 @@ export default function imageDecodeOptions() {
* 3.call createPixelMap
* 4.set index=-1,options
* 5.return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0400
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.png
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0400
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0400 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0400 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -2352,22 +2615,27 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
0
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0400 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0400 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0400 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0400 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0400 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_SAMPLESIZE_0400 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0700
...
...
@@ -2377,15 +2645,15 @@ export default function imageDecodeOptions() {
* 3.call createPixelMap
* 4.set index=-1,options
* 5.return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0700
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.png
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0700
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0700 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0700 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -2396,22 +2664,25 @@ export default function imageDecodeOptions() {
rotate
:
-
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0700 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0700 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0700 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0700 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0700 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0700 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0400
...
...
@@ -2421,15 +2692,17 @@ export default function imageDecodeOptions() {
* 3.call createPixelMap
* 4.set index=-1,options
* 5.return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0400
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.png
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0400
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0400 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0400 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -2440,22 +2713,30 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
60
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0400 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0400 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0400 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0400 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0400 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_PIXELFORMAT_0400 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0400
...
...
@@ -2465,15 +2746,17 @@ export default function imageDecodeOptions() {
* 3.call createPixelMap
* 4.set index=-1,options
* 5.return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0400
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.png
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0400
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0400 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0400 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -2484,22 +2767,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0400 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0400 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0400 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_EDITABLE_FALSE_0400 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0700
...
...
@@ -2509,15 +2795,15 @@ export default function imageDecodeOptions() {
* 3.call createPixelMap
* 4.set index=-1,options
* 5.return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0700
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.png
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0700
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0700 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0700 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -2528,22 +2814,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0700 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0700 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0700 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0700 success
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0800
...
...
@@ -2553,15 +2842,15 @@ export default function imageDecodeOptions() {
* 3.call createPixelMap
* 4.set index=-1,options
* 5.return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0800
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.png
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0800
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0800 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0800 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -2572,29 +2861,38 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
10000
,
width
:
10000
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0800 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0800 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
pixelmap
.
getImageInfo
().
then
((
imageInfo
)
=>
{
expect
(
imageInfo
.
size
.
height
==
2
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
1
).
assertTrue
();
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0800 success
'
);
pixelmap
.
getImageInfo
()
.
then
((
imageInfo
)
=>
{
expect
(
imageInfo
.
size
.
height
==
2
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
1
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0800 success
"
);
console
.
info
(
"
imageInfo height :
"
+
imageInfo
.
size
.
height
);
console
.
info
(
"
imageInfo width :
"
+
imageInfo
.
size
.
width
);
done
();
}).
catch
((
err
)
=>
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0800 getimageInfo err
'
+
JSON
.
stringify
(
err
));
})
done
();
})
.
catch
((
err
)
=>
{
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_DESIRED_0800 getimageInfo err
"
+
JSON
.
stringify
(
err
)
);
});
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0700
...
...
@@ -2604,15 +2902,15 @@ export default function imageDecodeOptions() {
* 3.call createPixelMap
* 4.set index=-1,options
* 5.return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0700
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.png
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0700
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0700 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0700 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -2623,22 +2921,25 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
-
1
,
y
:
-
1
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0700 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0700 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0700 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0700 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0700 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0700 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0800
...
...
@@ -2648,15 +2949,15 @@ export default function imageDecodeOptions() {
* 3.call createPixelMap
* 4.set index=-1,options
* 5.return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0800
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.png
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0800
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0800 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0800 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -2667,39 +2968,42 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
10000
,
y
:
10000
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0800 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0800 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0800 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0800 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0800 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_XY_0800 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0800
* @tc.name : createPixelMap(decodingOptions:rotate>360)-png
* @tc.desc : 1.create imagesource
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0800
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.png
'
);
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0800
* @tc.name : createPixelMap(decodingOptions:rotate>360)-png
* @tc.desc : 1.create imagesource
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0800
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0800 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0800 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -2710,22 +3014,25 @@ export default function imageDecodeOptions() {
rotate
:
500
,
desiredPixelFormat
:
2
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
1
,
y
:
2
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0800 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0800 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0800 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0800 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0800 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0800 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_IMAGE_FORMAT_0100
...
...
@@ -2734,12 +3041,12 @@ export default function imageDecodeOptions() {
* 2.set index and DecodeOptions
* 3.create PixelMap
* 4.callback return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_IMAGE_FORMAT_0100
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.tiff
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_IMAGE_FORMAT_0100
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.tiff
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
let
decodingOptions
=
{
sampleSize
:
1
,
...
...
@@ -2748,40 +3055,46 @@ export default function imageDecodeOptions() {
rotate
:
10
,
desiredPixelFormat
:
3
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
globalpixelmap
=
pixelmap
;
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_IMAGE_FORMAT_0100 success
'
);
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_IMAGE_FORMAT_0100 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_IMAGE_FORMAT_0100 success
"
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_IMAGE_FORMAT_0100 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
pixelmap
==
undefined
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_IMAGE_FORMAT_0100 fail
'
+
pixelmap
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_UNSUPPORTED_IMAGE_FORMAT_0100 fail
"
+
pixelmap
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
});
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0900
* @tc.name : Decode the image to generate a bitmap
* @tc.name : Decode the image to generate a bitmap
* @tc.desc : 1.create imagesource
* 2.create pixelmap
* 3.call getimageinfo
* 4.Judging the length and width are opposite to the original
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0900
'
,
0
,
async
function
(
done
)
{
await
getFd
(
'
test.jpg
'
);
it
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0900
"
,
0
,
async
function
(
done
)
{
await
getFd
(
"
test.jpg
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0900 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0900 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
...
...
@@ -2792,36 +3105,44 @@ export default function imageDecodeOptions() {
rotate
:
90
,
desiredPixelFormat
:
3
,
desiredRegion
:
{
size
:
{
height
:
1
,
width
:
2
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
,
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0900 createPixelMap error
'
+
JSON
.
stringify
(
err
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0900 createPixelMap error
"
+
JSON
.
stringify
(
err
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
pixelmap
.
getImageInfo
((
error
,
imageInfo
)
=>
{
if
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0900 getimageInfo err
'
+
JSON
.
stringify
(
error
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0900 getimageInfo err
"
+
JSON
.
stringify
(
error
)
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
if
(
imageInfo
!=
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0900 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0900 success
"
);
expect
(
imageInfo
.
size
.
height
==
2
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
1
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0900 imageInfo is empty
'
);
expect
(
false
).
assertTrue
()
console
.
info
(
"
SUB_GRAPHIC_IMAGE_DECODEOPTIONS_CREATEPIXELMAP_ROTATE_0900 imageInfo is empty
"
);
expect
(
false
).
assertTrue
();
done
();
}
}
})
})
;
}
})
})
;
}
})
})
})
;
})
;
}
multimedia/image/image_js_standard/imageGetImageProperty/BUILD.gn
0 → 100644
浏览文件 @
6b0f6fd0
# Copyright (C) 2021 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("image_getProperty_js_hap") {
hap_profile = "./src/main/config.json"
deps = [
":image_getProperty_js_assets",
":image_getProperty_resources",
]
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsImageGetImagePropertyJsTest"
subsystem_name = "multimedia"
part_name = "multimedia_image_standard"
}
ohos_js_assets("image_getProperty_js_assets") {
js2abc = true
hap_profile = "./src/main/config.json"
source_dir = "./src/main/js"
}
ohos_resources("image_getProperty_resources") {
sources = [ "./src/main/resources" ]
hap_profile = "./src/main/config.json"
}
multimedia/image/image_js_standard/imageGetImageProperty/Test.json
0 → 100644
浏览文件 @
6b0f6fd0
{
"description"
:
"Configuration for Image Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"300000"
,
"shell-timeout"
:
"120000"
,
"bundle-name"
:
"ohos.acts.multimedia.image.GetImageProperty"
,
"package-name"
:
"ohos.acts.multimedia.image.GetImageProperty"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsImageGetImagePropertyJsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"mkdir -p /data/app/el2/100/base/ohos.acts.multimedia.image.GetImageProperty/haps/entry/files/"
,
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image.GetImageProperty/haps/entry/files/*"
],
"teardown-command"
:[
]
},
{
"type"
:
"PushKit"
,
"pre-push"
:
[],
"push"
:
[
"./resource/image/test_exif1.jpg ->/data/app/el2/100/base/ohos.acts.multimedia.image.GetImageProperty/haps/entry/files"
]
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"hilog -Q pidoff"
,
"hilog -b D"
,
"chmod 777 /data/app/el2/100/base/ohos.acts.multimedia.image.GetImageProperty/haps/entry/files/test_exif.jpg"
],
"teardown-command"
:
[
"rm -rf /data/app/el2/100/base/ohos.acts.multimedia.image.GetImageProperty/haps/entry/files/*"
]
}
]
}
\ No newline at end of file
multimedia/image/image_js_standard/imageGetImageProperty/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
6b0f6fd0
文件已添加
multimedia/image/image_js_standard/imageGetImageProperty/src/main/config.json
0 → 100644
浏览文件 @
6b0f6fd0
{
"app"
:
{
"apiVersion"
:
{
"compatible"
:
6
,
"releaseType"
:
"Beta1"
,
"target"
:
7
},
"vendor"
:
"acts"
,
"bundleName"
:
"ohos.acts.multimedia.image.GetImageProperty"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
}
},
"deviceConfig"
:
{
"default"
:
{
"debug"
:
true
}
},
"module"
:
{
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"orientation"
:
"unspecified"
,
"formsEnabled"
:
false
,
"name"
:
".MainAbility"
,
"srcLanguage"
:
"js"
,
"srcPath"
:
"MainAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:MainAbility_desc"
,
"label"
:
"$string:MainAbility_label"
,
"type"
:
"page"
,
"visible"
:
true
,
"launchType"
:
"standard"
},
{
"orientation"
:
"unspecified"
,
"formsEnabled"
:
false
,
"name"
:
".TestAbility"
,
"srcLanguage"
:
"js"
,
"srcPath"
:
"TestAbility"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:TestAbility_desc"
,
"label"
:
"$string:TestAbility_label"
,
"type"
:
"page"
,
"visible"
:
true
,
"launchType"
:
"standard"
}
],
"deviceType"
:
[
"phone"
,
"tablet"
,
"tv"
,
"wearable"
],
"mainAbility"
:
".MainAbility"
,
"distro"
:
{
"moduleType"
:
"entry"
,
"installationFree"
:
false
,
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
},
"reqPermissions"
:
[
{
"name"
:
"ohos.permission.GET_BUNDLE_INFO"
,
"reason"
:
"use ohos.permission.GET_BUNDLE_INFO"
},
{
"name"
:
"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
,
"reason"
:
"use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED"
},
{
"name"
:
"ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
,
"reason"
:
"use ohos.permission.GRANT_SENSITIVE_PERMISSIONS"
},
{
"name"
:
"ohos.permission.REVOKE_SENSITIVE_PERMISSIONS"
,
"reason"
:
"use ohos.permission.REVOKE_SENSITIVE_PERMISSIONS"
},
{
"name"
:
"ohos.permission.MEDIA_LOCATION"
,
"reason"
:
"use ohos.permission.MEDIA_LOCATION"
},
{
"name"
:
"ohos.permission.READ_MEDIA"
,
"reason"
:
"use ohos.permission.READ_MEDIA"
},
{
"name"
:
"ohos.permission.WRITE_MEDIA"
,
"reason"
:
"use ohos.permission.WRITE_MEDIA"
}
],
"package"
:
"ohos.acts.multimedia.image.GetImageProperty"
,
"name"
:
".entry"
,
"js"
:
[
{
"pages"
:
[
"pages/index/index"
],
"name"
:
"default"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
true
}
},
{
"pages"
:
[
"pages/index/index"
],
"name"
:
".TestAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
],
"testRunner"
:
{
"name"
:
"OpenHarmonyTestRunner"
,
"srcPath"
:
"TestRunner"
},
"srcPath"
:
""
}
}
\ No newline at end of file
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/MainAbility/app.js
0 → 100644
浏览文件 @
6b0f6fd0
/*
* Copyright (C) 2021 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.
*/
export
default
{
onCreate
()
{
console
.
info
(
'
AceApplication onCreate
'
);
},
onDestroy
()
{
console
.
info
(
'
AceApplication onDestroy
'
);
}
};
\ No newline at end of file
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/MainAbility/i18n/en-US.json
0 → 100644
浏览文件 @
6b0f6fd0
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
}
}
\ No newline at end of file
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/MainAbility/i18n/zh-CN.json
0 → 100644
浏览文件 @
6b0f6fd0
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
}
}
\ No newline at end of file
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/MainAbility/pages/index/index.css
0 → 100644
浏览文件 @
6b0f6fd0
.container
{
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
width
:
100%
;
height
:
100%
;
}
.title
{
font-size
:
40px
;
color
:
#000000
;
opacity
:
0.9
;
}
@media
screen
and
(
device-type
:
tablet
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
100px
;
}
}
@media
screen
and
(
device-type
:
wearable
)
{
.title
{
font-size
:
28px
;
color
:
#FFFFFF
;
}
}
@media
screen
and
(
device-type
:
tv
)
{
.container
{
background-image
:
url("/common/images/Wallpaper.png")
;
background-size
:
cover
;
background-repeat
:
no-repeat
;
background-position
:
center
;
}
.title
{
font-size
:
100px
;
color
:
#FFFFFF
;
}
}
@media
screen
and
(
device-type
:
phone
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
60px
;
}
}
\ No newline at end of file
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/MainAbility/pages/index/index.hml
0 → 100644
浏览文件 @
6b0f6fd0
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
\ No newline at end of file
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/MainAbility/pages/index/index.js
0 → 100644
浏览文件 @
6b0f6fd0
/*
* Copyright (C) 2021 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.
*/
export
default
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
},
onShow
()
{
console
.
info
(
'
onShow finish
'
)
},
onReady
()
{
},
}
\ No newline at end of file
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/TestAbility/app.js
0 → 100644
浏览文件 @
6b0f6fd0
/*
* Copyright (c) 2022 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
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
import
{
Hypium
}
from
'
@ohos/hypium
'
import
testsuite
from
'
../test/List.test
'
export
default
{
onCreate
()
{
console
.
info
(
'
TestApplication onCreate
'
)
var
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
console
.
info
(
'
start run testcase!!!
'
)
Hypium
.
hypiumTest
(
abilityDelegator
,
abilityDelegatorArguments
,
testsuite
)
},
onDestroy
()
{
console
.
info
(
"
TestApplication onDestroy
"
);
}
};
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/TestAbility/i18n/en-US.json
0 → 100644
浏览文件 @
6b0f6fd0
{
"strings"
:
{
"hello"
:
"Hello"
,
"world"
:
"World"
},
"Files"
:
{
}
}
\ No newline at end of file
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/TestAbility/i18n/zh-CN.json
0 → 100644
浏览文件 @
6b0f6fd0
{
"strings"
:
{
"hello"
:
"您好"
,
"world"
:
"世界"
},
"Files"
:
{
}
}
\ No newline at end of file
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/TestAbility/pages/index/index.css
0 → 100644
浏览文件 @
6b0f6fd0
.container
{
display
:
flex
;
flex-direction
:
column
;
justify-content
:
center
;
align-items
:
center
;
left
:
0px
;
top
:
0px
;
width
:
100%
;
height
:
100%
;
}
.title
{
font-size
:
60px
;
text-align
:
center
;
width
:
100%
;
height
:
40%
;
margin
:
10px
;
}
@media
screen
and
(
device-type
:
phone
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
60px
;
}
}
@media
screen
and
(
device-type
:
tablet
)
and
(
orientation
:
landscape
)
{
.title
{
font-size
:
100px
;
}
}
\ No newline at end of file
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/TestAbility/pages/index/index.hml
0 → 100644
浏览文件 @
6b0f6fd0
<div class="container">
<text class="title">
{{ $t('strings.hello') }} {{ title }}
</text>
</div>
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/TestAbility/pages/index/index.js
0 → 100644
浏览文件 @
6b0f6fd0
/*
* Copyright (c) 2022 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.
*/
export
default
{
data
:
{
title
:
""
},
onInit
()
{
this
.
title
=
this
.
$t
(
'
strings.world
'
);
}
}
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/TestRunner/OpenHarmonyTestRunner.js
0 → 100644
浏览文件 @
6b0f6fd0
/*
* Copyright (c) 2022 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
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
function
translateParamsToString
(
parameters
)
{
const
keySet
=
new
Set
([
'
-s class
'
,
'
-s notClass
'
,
'
-s suite
'
,
'
-s itName
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
,
'
-s package
'
,
'
-s dryRun
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
+=
'
'
+
key
+
'
'
+
parameters
[
key
]
}
}
return
targetParams
.
trim
()
}
export
default
{
onPrepare
()
{
console
.
info
(
'
OpenHarmonyTestRunner OnPrepare
'
)
},
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
var
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
var
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
parameters
[
'
-p
'
]
+
'
.TestAbility
'
var
cmd
=
'
aa start -d 0 -a
'
+
testAbilityName
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
var
debug
=
abilityDelegatorArguments
.
parameters
[
"
-D
"
]
console
.
info
(
'
debug value :
'
+
debug
)
if
(
debug
==
'
true
'
)
{
cmd
+=
'
-D
'
}
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
,
data
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
data
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
data
.
exitCode
);
})
}
};
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/test/List.test.js
0 → 100644
浏览文件 @
6b0f6fd0
/*
* Copyright (C) 2021 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
imageGetImageProperty
from
"
./getProperty.test.js
"
;
export
default
function
testsuite
()
{
imageGetImageProperty
();
}
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/test/getProperty.test.js
0 → 100644
浏览文件 @
6b0f6fd0
/*
* Copyright (C) 2021 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
image
from
"
@ohos.multimedia.image
"
;
import
fileio
from
"
@ohos.fileio
"
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
"
@ohos/hypium
"
;
import
{
getPropertyBuf
}
from
"
./getPropertyBuf
"
;
import
featureAbility
from
"
@ohos.ability.featureAbility
"
;
export
default
function
imageGetImageProperty
()
{
describe
(
"
imageGetImageProperty
"
,
function
()
{
const
{
DATE_TIME_ORIGINAL
,
EXPOSURE_TIME
,
SCENE_TYPE
,
ISO_SPEED_RATINGS
,
F_NUMBER
}
=
image
.
PropertyKey
;
let
filePath
;
let
fdNumber
;
async
function
getFd
(
fileName
)
{
let
context
=
await
featureAbility
.
getContext
();
await
context
.
getFilesDir
().
then
((
data
)
=>
{
filePath
=
data
+
"
/
"
+
fileName
;
console
.
info
(
"
image case filePath is
"
+
filePath
);
});
await
fileio
.
open
(
filePath
)
.
then
(
(
data
)
=>
{
fdNumber
=
data
;
console
.
info
(
"
image case open fd success
"
+
fdNumber
);
},
(
err
)
=>
{
console
.
info
(
"
image cese open fd fail
"
+
err
);
}
)
.
catch
((
err
)
=>
{
console
.
info
(
"
image case open fd err
"
+
err
);
});
}
beforeAll
(
async
function
()
{
console
.
info
(
"
beforeAll case
"
);
});
beforeEach
(
function
()
{
console
.
info
(
"
beforeEach case
"
);
});
afterEach
(
function
()
{
console
.
info
(
"
afterEach case
"
);
});
afterAll
(
function
()
{
console
.
info
(
"
afterAll case
"
);
});
let
props
=
{
DateTimeOriginal
:
"
2022:06:02 15:51:35
"
,
ExposureTime
:
"
1/33 sec.
"
,
SceneType
:
"
Directly photographed
"
,
ISOSpeedRatings
:
"
400
"
,
FNumber
:
"
f/1.8
"
,
};
async
function
getPromise
(
done
,
testNum
,
type
,
args
)
{
let
imageSourceApi
;
if
(
type
==
"
buf
"
)
{
const
data
=
getPropertyBuf
.
buffer
;
imageSourceApi
=
image
.
createImageSource
(
data
);
}
else
{
await
getFd
(
"
test_exif1.jpg
"
);
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
}
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create image source failed`
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imageSourceApi
.
getImageProperty
(
args
)
.
then
((
data
)
=>
{
console
.
info
(
`
${
testNum
}
${
args
}
`
+
data
);
expect
(
data
==
props
[
args
]).
assertTrue
();
done
();
})
.
catch
((
error
)
=>
{
console
.
log
(
`
${
testNum
}
error: `
+
error
);
expect
(
false
).
assertTrue
();
done
();
});
}
}
async
function
getCb
(
done
,
testNum
,
type
,
args
)
{
let
imageSourceApi
;
if
(
type
==
"
buf
"
)
{
const
data
=
getPropertyBuf
.
buffer
;
imageSourceApi
=
image
.
createImageSource
(
data
);
}
else
{
await
getFd
(
"
test_exif1.jpg
"
);
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
}
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create image source failed`
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imageSourceApi
.
getImageProperty
(
args
,
(
err
,
data
)
=>
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
console
.
info
(
`
${
testNum
}
${
args
}
err: `
+
err
);
}
else
{
console
.
info
(
`
${
testNum
}
${
args
}
`
+
data
);
expect
(
data
==
props
[
args
]).
assertTrue
();
done
();
}
});
}
}
async
function
getCb2
(
done
,
testNum
,
type
,
args
)
{
let
imageSourceApi
;
if
(
type
==
"
buf
"
)
{
const
data
=
getPropertyBuf
.
buffer
;
imageSourceApi
=
image
.
createImageSource
(
data
);
}
else
{
await
getFd
(
"
test_exif1.jpg
"
);
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
}
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create image source failed`
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
let
property
=
{
index
:
0
,
defaultValue
:
"
9999
"
};
imageSourceApi
.
getImageProperty
(
args
,
property
,
(
err
,
data
)
=>
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
onsole
.
info
(
`
${
testNum
}
${
args
}
err: `
+
err
);
}
else
{
console
.
info
(
`
${
testNum
}
${
args
}
`
+
data
);
expect
(
data
!=
"
9999
"
&&
data
==
props
[
args
]).
assertTrue
();
done
();
}
});
}
}
async
function
getPromiseErr
(
done
,
testNum
,
type
,
args
,
isTypeErr
)
{
let
imageSourceApi
;
if
(
type
==
"
buf
"
)
{
const
data
=
getPropertyBuf
.
buffer
;
imageSourceApi
=
image
.
createImageSource
(
data
);
}
else
{
await
getFd
(
"
test_exif1.jpg
"
);
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
}
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create image source failed`
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
if
(
isTypeErr
)
{
try
{
await
imageSourceApi
.
getImageProperty
(
args
);
expect
(
false
).
assertTrue
();
}
catch
(
error
)
{
expect
(
error
.
code
==
1
).
assertTrue
();
console
.
log
(
`
${
testNum
}
error msg: `
+
error
);
done
();
}
}
else
{
try
{
await
imageSourceApi
.
getImageProperty
(
args
);
expect
(
false
).
assertTrue
();
}
catch
(
error
)
{
expect
(
error
.
code
!=
0
).
assertTrue
();
console
.
log
(
`
${
testNum
}
error msg: `
+
error
);
done
();
}
}
}
}
async
function
getCbErr
(
done
,
testNum
,
type
,
args
,
isTypeErr
)
{
let
imageSourceApi
;
if
(
type
==
"
buf
"
)
{
const
data
=
getPropertyBuf
.
buffer
;
imageSourceApi
=
image
.
createImageSource
(
data
);
}
else
{
await
getFd
(
"
test_exif1.jpg
"
);
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
}
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create image source failed`
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
if
(
isTypeErr
)
{
try
{
imageSourceApi
.
getImageProperty
(
args
,
(
error
,
data
)
=>
{
expect
(
false
).
assertTrue
();
done
();
});
}
catch
(
error
)
{
console
.
log
(
`
${
testNum
}
error1 msg: `
+
error
);
expect
(
error
.
code
==
1
).
assertTrue
();
done
();
}
}
else
{
imageSourceApi
.
getImageProperty
(
args
,
(
error
,
data
)
=>
{
expect
(
error
.
code
!=
0
).
assertTrue
();
console
.
log
(
`
${
testNum
}
error3 msg: `
+
error
);
done
();
});
}
}
}
async
function
getCb2Err
(
done
,
testNum
,
type
,
args
,
isTypeErr
)
{
let
imageSourceApi
;
if
(
type
==
"
buf
"
)
{
const
data
=
getPropertyBuf
.
buffer
;
imageSourceApi
=
image
.
createImageSource
(
data
);
}
else
{
await
getFd
(
"
test_exif1.jpg
"
);
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
}
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create image source failed`
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
let
property
=
{
index
:
0
,
defaultValue
:
"
9999
"
};
if
(
isTypeErr
)
{
try
{
imageSourceApi
.
getImageProperty
(
args
,
property
,
(
error
,
data
)
=>
{
expect
(
false
).
assertTrue
();
});
}
catch
(
error
)
{
expect
(
error
.
code
==
1
).
assertTrue
();
console
.
log
(
`
${
testNum
}
error msg: `
+
error
);
done
();
}
}
else
{
imageSourceApi
.
getImageProperty
(
args
,
property
,
(
error
,
data
)
=>
{
expect
(
error
.
code
!=
0
).
assertTrue
();
console
.
log
(
`
${
testNum
}
error msg: `
+
error
);
done
();
});
}
}
}
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_0100
* @tc.name : getImageProperty(DateTimeOriginal)
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(DateTimeOriginal)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_0100
"
,
0
,
async
function
(
done
)
{
let
key
=
DATE_TIME_ORIGINAL
;
getPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_0100
"
,
"
picture
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_0200
* @tc.name : getImageProperty(ExposureTime)
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(ExposureTime)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_0200
"
,
0
,
async
function
(
done
)
{
let
key
=
EXPOSURE_TIME
;
getPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_0200
"
,
"
picture
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_0300
* @tc.name : getImageProperty(FNumber)
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(FNumber)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_0300
"
,
0
,
async
function
(
done
)
{
let
key
=
F_NUMBER
;
getPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_0300
"
,
"
picture
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_0400
* @tc.name : getImageProperty(ISOSpeedRatings)
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(ISOSpeedRatings)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_0400
"
,
0
,
async
function
(
done
)
{
let
key
=
ISO_SPEED_RATINGS
;
getPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_0400
"
,
"
picture
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_0500
* @tc.name : getImageProperty(SceneType)
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(SceneType)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_0500
"
,
0
,
async
function
(
done
)
{
let
key
=
SCENE_TYPE
;
getPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_0500
"
,
"
picture
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0100
* @tc.name : getImageProperty(DateTimeOriginal)-callback
* @tc.desc : 1.create imagesource
* 2.call getImageProperty(DateTimeOriginal)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0100
"
,
0
,
async
function
(
done
)
{
let
key
=
DATE_TIME_ORIGINAL
;
getCb
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0100
"
,
"
picture
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0200
* @tc.name : getImageProperty(ExposureTime)-callback
* @tc.desc : 1.create imagesource
* 2.call getImageProperty(ExposureTime)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0200
"
,
0
,
async
function
(
done
)
{
let
key
=
EXPOSURE_TIME
;
getCb
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0200
"
,
"
picture
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0300
* @tc.name : getImageProperty(FNumber)-callback
* @tc.desc : 1.create imagesource
* 2.call getImageProperty(FNumber)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0300
"
,
0
,
async
function
(
done
)
{
let
key
=
F_NUMBER
;
getCb
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0300
"
,
"
picture
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0400
* @tc.name : getImageProperty(ISOSpeedRatings)-callback
* @tc.desc : 1.create imagesource
* 2.call getImageProperty(ISOSpeedRatings)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0400
"
,
0
,
async
function
(
done
)
{
let
key
=
ISO_SPEED_RATINGS
;
getCb
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0400
"
,
"
picture
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0500
* @tc.name : getImageProperty(SceneType)-callback
* @tc.desc : 1.create imagesource
* 2.call getImageProperty(SceneType)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0500
"
,
0
,
async
function
(
done
)
{
let
key
=
SCENE_TYPE
;
getCb
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0500
"
,
"
picture
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0600
* @tc.name : getImageProperty(DateTimeOriginal,property)-callback
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(DateTimeOriginal,property)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0600
"
,
0
,
async
function
(
done
)
{
let
key
=
DATE_TIME_ORIGINAL
;
getCb2
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0600
"
,
"
picture
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0700
* @tc.name : getImageProperty(ExposureTime,property)-callback
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(ExposureTime,property)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0700
"
,
0
,
async
function
(
done
)
{
let
key
=
EXPOSURE_TIME
;
getCb2
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0700
"
,
"
picture
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0800
* @tc.name : getImageProperty(FNumber,property)-callback
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(FNumber,property)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0800
"
,
0
,
async
function
(
done
)
{
let
key
=
F_NUMBER
;
getCb2
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0800
"
,
"
picture
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0900
* @tc.name : getImageProperty(ISOSpeedRatings,property)-callback
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(ISOSpeedRatings,property)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0900
"
,
0
,
async
function
(
done
)
{
let
key
=
ISO_SPEED_RATINGS
;
getCb2
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_0900
"
,
"
picture
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_1000
* @tc.name : getImageProperty(SceneType,property)-callback
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(SceneType,property)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_1000
"
,
0
,
async
function
(
done
)
{
let
key
=
SCENE_TYPE
;
getCb2
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_1000
"
,
"
picture
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_0100
* @tc.name : getImageProperty(DateTimeOriginal)
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(DateTimeOriginal)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_0100
"
,
0
,
async
function
(
done
)
{
let
key
=
DATE_TIME_ORIGINAL
;
getPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_0100
"
,
"
buf
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_0200
* @tc.name : getImageProperty(ExposureTime)
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(ExposureTime)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_0200
"
,
0
,
async
function
(
done
)
{
let
key
=
EXPOSURE_TIME
;
getPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_0200
"
,
"
buf
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_0300
* @tc.name : getImageProperty(FNumber)
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(FNumber)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_0300
"
,
0
,
async
function
(
done
)
{
let
key
=
F_NUMBER
;
getPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_0300
"
,
"
buf
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_0400
* @tc.name : getImageProperty(ISOSpeedRatings)
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(ISOSpeedRatings)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_0400
"
,
0
,
async
function
(
done
)
{
let
key
=
ISO_SPEED_RATINGS
;
getPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_0400
"
,
"
buf
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_0500
* @tc.name : getImageProperty(SceneType)
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(SceneType)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_0500
"
,
0
,
async
function
(
done
)
{
let
key
=
SCENE_TYPE
;
getPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_0500
"
,
"
buf
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0100
* @tc.name : getImageProperty(DateTimeOriginal)-callback
* @tc.desc : 1.create imagesource
* 2.call getImageProperty(DateTimeOriginal)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0100
"
,
0
,
async
function
(
done
)
{
let
key
=
DATE_TIME_ORIGINAL
;
getCb
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0100
"
,
"
buf
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0200
* @tc.name : getImageProperty(ExposureTime)-callback
* @tc.desc : 1.create imagesource
* 2.call getImageProperty(ExposureTime)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0200
"
,
0
,
async
function
(
done
)
{
let
key
=
EXPOSURE_TIME
;
getCb
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0200
"
,
"
buf
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0300
* @tc.name : getImageProperty(FNumber)-callback
* @tc.desc : 1.create imagesource
* 2.call getImageProperty(FNumber)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0300
"
,
0
,
async
function
(
done
)
{
let
key
=
F_NUMBER
;
getCb
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0300
"
,
"
buf
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0400
* @tc.name : getImageProperty(ISOSpeedRatings)-callback
* @tc.desc : 1.create imagesource
* 2.call getImageProperty(ISOSpeedRatings)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0400
"
,
0
,
async
function
(
done
)
{
let
key
=
ISO_SPEED_RATINGS
;
getCb
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0400
"
,
"
buf
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0500
* @tc.name : getImageProperty(SceneType)-callback
* @tc.desc : 1.create imagesource
* 2.call getImageProperty(SceneType)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0500
"
,
0
,
async
function
(
done
)
{
let
key
=
SCENE_TYPE
;
getCb
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0500
"
,
"
buf
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0600
* @tc.name : getImageProperty(DateTimeOriginal,property)-callback
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(DateTimeOriginal,property)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0600
"
,
0
,
async
function
(
done
)
{
let
key
=
DATE_TIME_ORIGINAL
;
getCb2
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0600
"
,
"
buf
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0700
* @tc.name : getImageProperty(ExposureTime,property)-callback
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(ExposureTime,property)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0700
"
,
0
,
async
function
(
done
)
{
let
key
=
EXPOSURE_TIME
;
getCb2
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0700
"
,
"
buf
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0800
* @tc.name : getImageProperty(FNumber,property)-callback
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(FNumber,property)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0800
"
,
0
,
async
function
(
done
)
{
let
key
=
F_NUMBER
;
getCb2
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0800
"
,
"
buf
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0900
* @tc.name : getImageProperty(ISOSpeedRatings,property)-callback
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(ISOSpeedRatings,property)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0900
"
,
0
,
async
function
(
done
)
{
let
key
=
ISO_SPEED_RATINGS
;
getCb2
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_0900
"
,
"
buf
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_1000
* @tc.name : getImageProperty(SceneType,property)-callback
* @tc.desc : 1.create imagesource
* 2.set property
* 3.call getImageProperty(SceneType,property)
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_1000
"
,
0
,
async
function
(
done
)
{
let
key
=
SCENE_TYPE
;
getCb2
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBAK_BUFFER_1000
"
,
"
buf
"
,
key
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_ERROR_0100
* @tc.name : getImageProperty-Promise-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_ERROR_0100
"
,
0
,
async
function
(
done
)
{
let
key
=
"
Date
"
;
getPromiseErr
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_ERROR_0100
"
,
"
picture
"
,
key
,
false
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_ERROR_0200
* @tc.name : getImageProperty-Promise-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_ERROR_0200
"
,
0
,
async
function
(
done
)
{
let
key
=
null
;
getPromiseErr
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_ERROR_0200
"
,
"
picture
"
,
key
,
true
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_ERROR_0300
* @tc.name : getImageProperty-Promise-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_ERROR_0300
"
,
0
,
async
function
(
done
)
{
let
key
=
12
;
getPromiseErr
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_ERROR_0300
"
,
"
picture
"
,
key
,
true
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_ERROR_0400
* @tc.name : getImageProperty-Promise-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_ERROR_0400
"
,
0
,
async
function
(
done
)
{
let
key
=
{
w
:
12
};
getPromiseErr
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_ERROR_0400
"
,
"
picture
"
,
key
,
true
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0100
* @tc.name : getImageProperty-callback-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0100
"
,
0
,
async
function
(
done
)
{
let
key
=
"
Date
"
;
await
getCbErr
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0100
"
,
"
picture
"
,
key
,
false
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0200
* @tc.name : getImageProperty-callback-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0200
"
,
0
,
async
function
(
done
)
{
let
key
=
null
;
await
getCbErr
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0200
"
,
"
picture
"
,
key
,
true
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0300
* @tc.name : getImageProperty-callback-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0300
"
,
0
,
async
function
(
done
)
{
let
key
=
12
;
await
getCbErr
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0300
"
,
"
picture
"
,
key
,
true
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0400
* @tc.name : getImageProperty-callback-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0400
"
,
0
,
async
function
(
done
)
{
let
key
=
{
w
:
12
};
await
getCbErr
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0400
"
,
"
picture
"
,
key
,
true
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0500
* @tc.name : getImageProperty-callback-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0500
"
,
0
,
async
function
(
done
)
{
let
key
=
"
Date
"
;
getCb2Err
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0500
"
,
"
picture
"
,
key
,
false
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0600
* @tc.name : getImageProperty-callback-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0600
"
,
0
,
async
function
(
done
)
{
let
key
=
null
;
getCb2Err
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0600
"
,
"
picture
"
,
key
,
true
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0700
* @tc.name : getImageProperty-callback-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0700
"
,
0
,
async
function
(
done
)
{
let
key
=
12
;
getCb2Err
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0700
"
,
"
picture
"
,
key
,
true
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0800
* @tc.name : getImageProperty-callback-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0800
"
,
0
,
async
function
(
done
)
{
let
key
=
{
a
:
12
};
getCb2Err
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_ERROR_0800
"
,
"
picture
"
,
key
,
true
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_ERROR_0100
* @tc.name : getImageProperty-promise-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_ERROR_0100
"
,
0
,
async
function
(
done
)
{
let
key
=
"
Date
"
;
getPromiseErr
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_ERROR_0100
"
,
"
buf
"
,
key
,
false
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_ERROR_0200
* @tc.name : getImageProperty-promise-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_ERROR_0200
"
,
0
,
async
function
(
done
)
{
let
key
=
null
;
getPromiseErr
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_ERROR_0200
"
,
"
buf
"
,
key
,
true
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_ERROR_0300
* @tc.name : getImageProperty-promise-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_ERROR_0300
"
,
0
,
async
function
(
done
)
{
let
key
=
12
;
getPromiseErr
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_ERROR_0300
"
,
"
buf
"
,
key
,
true
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_ERROR_0400
* @tc.name : getImageProperty-promise-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_ERROR_0400
"
,
0
,
async
function
(
done
)
{
let
key
=
{
w
:
12
};
getPromiseErr
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_PROMISE_BUFFER_ERROR_0400
"
,
"
buf
"
,
key
,
true
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0100
* @tc.name : getImageProperty-callback-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0100
"
,
0
,
async
function
(
done
)
{
let
key
=
"
Date
"
;
await
getCbErr
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0100
"
,
"
buf
"
,
key
,
false
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0200
* @tc.name : getImageProperty-callback-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0200
"
,
0
,
async
function
(
done
)
{
let
key
=
null
;
await
getCbErr
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0200
"
,
"
buf
"
,
key
,
true
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0300
* @tc.name : getImageProperty-callback-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0300
"
,
0
,
async
function
(
done
)
{
let
key
=
12
;
await
getCbErr
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0300
"
,
"
buf
"
,
key
,
true
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0400
* @tc.name : getImageProperty-callback-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0400
"
,
0
,
async
function
(
done
)
{
let
key
=
{
w
:
12
};
await
getCbErr
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0400
"
,
"
buf
"
,
key
,
true
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0500
* @tc.name : getImageProperty-callback-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0500
"
,
0
,
async
function
(
done
)
{
let
key
=
"
Date
"
;
getCb2Err
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0500
"
,
"
buf
"
,
key
,
false
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0600
* @tc.name : getImageProperty-callback-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0600
"
,
0
,
async
function
(
done
)
{
let
key
=
null
;
getCb2Err
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0600
"
,
"
buf
"
,
key
,
true
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0700
* @tc.name : getImageProperty-callback-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0700
"
,
0
,
async
function
(
done
)
{
let
key
=
12
;
getCb2Err
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0700
"
,
"
buf
"
,
key
,
true
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0800
* @tc.name : getImageProperty-callback-wrong key
* @tc.desc : 1.create imagesource
* 2.call getImageProperty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0800
"
,
0
,
async
function
(
done
)
{
let
key
=
{
a
:
12
};
getCb2Err
(
done
,
"
SUB_GRAPHIC_IMAGE_GETIMAGEPROPERTY_CALLBACK_BUFFER_ERROR_0800
"
,
"
buf
"
,
key
,
true
);
});
});
}
multimedia/image/image_js_standard/imageGetImageProperty/src/main/js/test/getPropertyBuf.js
0 → 100644
浏览文件 @
6b0f6fd0
因为 它太大了无法显示 source diff 。你可以改为
查看blob
。
multimedia/image/image_js_standard/imageGetImageProperty/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
6b0f6fd0
{
"string"
:
[
{
"name"
:
"entry_MainAbility"
,
"value"
:
"ImageJSTestMain"
},
{
"name"
:
"mainability_description"
,
"value"
:
"ImageJSTestMain Ability"
},
{
"name"
:
"MainAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"MainAbility_label"
,
"value"
:
"label"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"label"
}
]
}
\ No newline at end of file
multimedia/image/image_js_standard/imageGetImageProperty/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
6b0f6fd0
6.6 KB
multimedia/image/image_js_standard/imagePacking/src/main/js/test/packing.test.js
浏览文件 @
6b0f6fd0
...
...
@@ -13,69 +13,77 @@
* limitations under the License.
*/
import
image
from
'
@ohos.multimedia.image
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
featureAbility
from
'
@ohos.ability.featureAbility
'
import
fileio
from
'
@ohos.fileio
'
import
image
from
"
@ohos.multimedia.image
"
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
"
@ohos/hypium
"
;
import
featureAbility
from
"
@ohos.ability.featureAbility
"
;
import
fileio
from
"
@ohos.fileio
"
;
export
default
function
imagePacking
()
{
describe
(
'
imagePacking
'
,
function
()
{
describe
(
"
imagePacking
"
,
function
()
{
let
filePath
;
let
fdNumber
;
async
function
getFd
(
fileName
)
{
let
context
=
await
featureAbility
.
getContext
();
await
context
.
getFilesDir
().
then
((
data
)
=>
{
filePath
=
data
+
'
/
'
+
fileName
;
console
.
info
(
'
image case filePath is
'
+
filePath
);
})
await
fileio
.
open
(
filePath
).
then
((
data
)
=>
{
fdNumber
=
data
;
console
.
info
(
"
image case open fd success
"
+
fdNumber
);
},
(
err
)
=>
{
console
.
info
(
"
image cese open fd fail
"
+
err
)
}).
catch
((
err
)
=>
{
console
.
info
(
"
image case open fd err
"
+
err
);
})
filePath
=
data
+
"
/
"
+
fileName
;
console
.
info
(
"
image case filePath is
"
+
filePath
);
});
await
fileio
.
open
(
filePath
)
.
then
(
(
data
)
=>
{
fdNumber
=
data
;
console
.
info
(
"
image case open fd success
"
+
fdNumber
);
},
(
err
)
=>
{
console
.
info
(
"
image cese open fd fail
"
+
err
);
}
)
.
catch
((
err
)
=>
{
console
.
info
(
"
image case open fd err
"
+
err
);
});
}
beforeAll
(
async
function
()
{
console
.
info
(
'
beforeAll case
'
);
})
console
.
info
(
"
beforeAll case
"
);
})
;
beforeEach
(
function
()
{
console
.
info
(
'
beforeEach case
'
);
})
console
.
info
(
"
beforeEach case
"
);
})
;
afterEach
(
function
()
{
console
.
info
(
'
afterEach case
'
);
})
console
.
info
(
"
afterEach case
"
);
})
;
afterAll
(
function
()
{
console
.
info
(
'
afterAll case
'
);
})
console
.
info
(
"
afterAll case
"
);
})
;
function
packingPromise
(
done
,
testNum
,
pixFormat
,
arg
)
{
let
opts
;
const
Color
=
new
ArrayBuffer
(
96
);
if
(
pixFormat
==
2
)
{
opts
=
{
editable
:
true
,
pixelFormat
:
2
,
size
:
{
height
:
4
,
width
:
6
}
}
opts
=
{
editable
:
true
,
pixelFormat
:
2
,
size
:
{
height
:
4
,
width
:
6
}
}
;
}
else
{
opts
=
{
editable
:
true
,
pixelFormat
:
5
,
size
:
{
height
:
4
,
width
:
6
}
}
opts
=
{
editable
:
true
,
pixelFormat
:
5
,
size
:
{
height
:
4
,
width
:
6
}
}
;
}
image
.
createPixelMap
(
Color
,
opts
)
.
then
(
pixelmap
=>
{
image
.
createPixelMap
(
Color
,
opts
)
.
then
((
pixelmap
)
=>
{
if
(
pixelmap
==
undefined
)
{
expect
(
false
).
assertTrue
()
console
.
info
(
`
${
testNum
}
create pixelmap fail`
)
expect
(
false
).
assertTrue
()
;
console
.
info
(
`
${
testNum
}
create pixelmap fail`
)
;
done
();
}
else
{
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
expect
(
false
).
assertTrue
();
console
.
info
(
`
${
testNum
}
create imagepacker fail`
)
console
.
info
(
`
${
testNum
}
create imagepacker fail`
)
;
done
();
}
else
{
imagePackerApi
.
packing
(
pixelmap
,
arg
)
imagePackerApi
.
packing
(
pixelmap
,
arg
)
.
then
((
data
)
=>
{
var
dataArr
=
new
Uint8Array
(
data
);
console
.
info
(
`
${
testNum
}
dataArr.length=`
+
dataArr
.
length
);
...
...
@@ -83,47 +91,49 @@ export default function imagePacking() {
console
.
info
(
`dataArr[`
+
i
+
`]=`
+
dataArr
[
i
]);
}
expect
(
data
!=
undefined
).
assertTrue
();
console
.
info
(
`
${
testNum
}
success`
)
console
.
info
(
`
${
testNum
}
success`
)
;
done
();
}).
catch
(
error
=>
{
})
.
catch
((
error
)
=>
{
console
.
log
(
`
${
testNum
}
error:`
+
error
);
expect
().
assertFail
();
done
();
})
})
;
}
}
})
.
catch
(
error
=>
{
console
.
log
(
'
createpixelmap error:
'
+
error
);
.
catch
(
(
error
)
=>
{
console
.
log
(
"
createpixelmap error:
"
+
error
);
expect
().
assertFail
();
done
();
})
})
;
}
function
packingCb
(
done
,
testNum
,
pixFormat
,
arg
)
{
let
opts
;
const
Color
=
new
ArrayBuffer
(
96
);
if
(
pixFormat
==
2
)
{
opts
=
{
editable
:
true
,
pixelFormat
:
2
,
size
:
{
height
:
4
,
width
:
6
}
}
opts
=
{
editable
:
true
,
pixelFormat
:
2
,
size
:
{
height
:
4
,
width
:
6
}
}
;
}
else
{
opts
=
{
editable
:
true
,
pixelFormat
:
5
,
size
:
{
height
:
4
,
width
:
6
}
}
opts
=
{
editable
:
true
,
pixelFormat
:
5
,
size
:
{
height
:
4
,
width
:
6
}
}
;
}
image
.
createPixelMap
(
Color
,
opts
)
.
then
(
pixelmap
=>
{
image
.
createPixelMap
(
Color
,
opts
)
.
then
((
pixelmap
)
=>
{
if
(
pixelmap
==
undefined
)
{
expect
(
false
).
assertTrue
()
console
.
info
(
`
${
testNum
}
create pixelmap fail`
)
expect
(
false
).
assertTrue
()
;
console
.
info
(
`
${
testNum
}
create pixelmap fail`
)
;
done
();
}
else
{
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
expect
(
false
).
assertTrue
();
console
.
info
(
`
${
testNum
}
create imagepacker fail`
)
console
.
info
(
`
${
testNum
}
create imagepacker fail`
)
;
done
();
}
else
{
imagePackerApi
.
packing
(
pixelmap
,
arg
,
(
err
,
data
)
=>
{
if
(
err
!=
undefined
)
{
console
.
info
(
`
${
testNum
}
packing failerr:
${
err
}
`
)
console
.
info
(
`
${
testNum
}
packing failerr:
${
err
}
`
)
;
expect
(
false
).
assertTrue
();
done
();
return
;
...
...
@@ -135,29 +145,30 @@ export default function imagePacking() {
}
expect
(
data
!=
undefined
).
assertTrue
();
done
();
})
})
;
}
}
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
console
.
log
(
`
${
testNum
}
createpixelmap error: `
+
error
);
expect
().
assertFail
();
done
();
})
})
;
}
function
packingCbFail
(
done
,
testNum
,
pixFormat
,
arg
)
{
const
Color
=
new
ArrayBuffer
(
96
);
if
(
pixFormat
==
2
)
{
var
opts
=
{
editable
:
true
,
pixelFormat
:
2
,
size
:
{
height
:
4
,
width
:
6
}
}
var
opts
=
{
editable
:
true
,
pixelFormat
:
2
,
size
:
{
height
:
4
,
width
:
6
}
}
;
}
else
{
var
opts
=
{
editable
:
true
,
pixelFormat
:
5
,
size
:
{
height
:
4
,
width
:
6
}
}
var
opts
=
{
editable
:
true
,
pixelFormat
:
5
,
size
:
{
height
:
4
,
width
:
6
}
}
;
}
image
.
createPixelMap
(
Color
,
opts
)
.
then
(
pixelmap
=>
{
image
.
createPixelMap
(
Color
,
opts
)
.
then
((
pixelmap
)
=>
{
if
(
pixelmap
==
undefined
)
{
expect
(
false
).
assertTrue
()
expect
(
false
).
assertTrue
()
;
done
();
}
else
{
const
imagePackerApi
=
image
.
createImagePacker
();
...
...
@@ -168,28 +179,29 @@ export default function imagePacking() {
imagePackerApi
.
packing
(
pixelmap
,
arg
,
(
err
,
data
)
=>
{
expect
(
err
!=
undefined
).
assertTrue
();
done
();
})
})
;
}
}
})
.
catch
(
error
=>
{
.
catch
(
(
error
)
=>
{
console
.
log
(
`
${
testNum
}
createpixelmap error:`
+
error
);
expect
().
assertFail
();
done
();
})
})
;
}
function
packingPromiseFail
(
done
,
testNum
,
pixFormat
,
arg
)
{
const
Color
=
new
ArrayBuffer
(
96
);
if
(
pixFormat
==
2
)
{
var
opts
=
{
editable
:
true
,
pixelFormat
:
2
,
size
:
{
height
:
4
,
width
:
6
}
}
var
opts
=
{
editable
:
true
,
pixelFormat
:
2
,
size
:
{
height
:
4
,
width
:
6
}
}
;
}
else
{
var
opts
=
{
editable
:
true
,
pixelFormat
:
5
,
size
:
{
height
:
4
,
width
:
6
}
}
var
opts
=
{
editable
:
true
,
pixelFormat
:
5
,
size
:
{
height
:
4
,
width
:
6
}
}
;
}
image
.
createPixelMap
(
Color
,
opts
)
.
then
(
pixelmap
=>
{
image
.
createPixelMap
(
Color
,
opts
)
.
then
((
pixelmap
)
=>
{
if
(
pixelmap
==
undefined
)
{
expect
(
false
).
assertTrue
()
expect
(
false
).
assertTrue
()
;
done
();
}
else
{
const
imagePackerApi
=
image
.
createImagePacker
();
...
...
@@ -197,23 +209,25 @@ export default function imagePacking() {
expect
(
false
).
assertTrue
();
done
();
}
else
{
imagePackerApi
.
packing
(
pixelmap
,
arg
)
imagePackerApi
.
packing
(
pixelmap
,
arg
)
.
then
((
data
)
=>
{
expect
(
false
).
assertTrue
();
done
();
}).
catch
(
error
=>
{
})
.
catch
((
error
)
=>
{
console
.
log
(
`
${
testNum
}
error:`
+
error
);
expect
(
true
).
assertTrue
();
done
();
})
})
;
}
}
})
.
catch
(
error
=>
{
console
.
log
(
'
createpixelmap error:
'
+
error
);
.
catch
(
(
error
)
=>
{
console
.
log
(
"
createpixelmap error:
"
+
error
);
expect
().
assertFail
();
done
();
})
})
;
}
/**
...
...
@@ -222,14 +236,14 @@ export default function imagePacking() {
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
packingPromise
(
done
,
'
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0100
'
,
2
,
packOpts
)
})
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0100
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
;
packingPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0100
"
,
2
,
packOpts
);
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0200
...
...
@@ -237,14 +251,14 @@ export default function imagePacking() {
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0200
'
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
123
}
packingPromiseFail
(
done
,
'
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0200
'
,
2
,
packOpts
)
})
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0200
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
123
}
;
packingPromiseFail
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0200
"
,
2
,
packOpts
);
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0300
...
...
@@ -252,14 +266,14 @@ export default function imagePacking() {
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0300
'
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
}
packingPromiseFail
(
done
,
'
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0300
'
,
2
,
packOpts
)
})
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0300
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
}
;
packingPromiseFail
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0300
"
,
2
,
packOpts
);
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0400
...
...
@@ -267,14 +281,14 @@ export default function imagePacking() {
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0400
'
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
quality
:
99
}
packingPromiseFail
(
done
,
'
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0400
'
,
2
,
packOpts
)
})
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0400
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
quality
:
99
}
;
packingPromiseFail
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0400
"
,
2
,
packOpts
);
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0500
...
...
@@ -282,14 +296,14 @@ export default function imagePacking() {
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0500
'
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/png
"
,
quality
:
99
}
packingPromiseFail
(
done
,
'
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0500
'
,
2
,
packOpts
)
})
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0500
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/png
"
,
quality
:
99
}
;
packingPromiseFail
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0500
"
,
2
,
packOpts
);
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0600
...
...
@@ -297,14 +311,14 @@ export default function imagePacking() {
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0600
'
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
50
}
packingPromise
(
done
,
'
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0600
'
,
5
,
packOpts
)
})
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0600
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
50
}
;
packingPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0600
"
,
5
,
packOpts
);
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0700
...
...
@@ -312,14 +326,14 @@ export default function imagePacking() {
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0700
'
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
123
}
packingPromiseFail
(
done
,
'
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0700
'
,
5
,
packOpts
)
})
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0700
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
123
}
;
packingPromiseFail
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0700
"
,
5
,
packOpts
);
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0800
...
...
@@ -327,14 +341,14 @@ export default function imagePacking() {
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0800
'
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
}
packingPromiseFail
(
done
,
'
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0800
'
,
5
,
packOpts
)
})
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0800
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
}
;
packingPromiseFail
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0800
"
,
5
,
packOpts
);
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0900
...
...
@@ -342,14 +356,14 @@ export default function imagePacking() {
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0900
'
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
quality
:
99
}
packingPromiseFail
(
done
,
'
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0900
'
,
5
,
packOpts
)
})
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0900
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
quality
:
99
}
;
packingPromiseFail
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_0900
"
,
5
,
packOpts
);
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_PROMISE_1000
...
...
@@ -357,14 +371,14 @@ export default function imagePacking() {
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_1000
'
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/png
"
,
quality
:
99
}
packingPromiseFail
(
done
,
'
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_1000
'
,
5
,
packOpts
)
})
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_1000
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/png
"
,
quality
:
99
}
;
packingPromiseFail
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_PROMISE_1000
"
,
5
,
packOpts
);
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0100
...
...
@@ -372,14 +386,14 @@ export default function imagePacking() {
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0100
'
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
packingCb
(
done
,
'
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0100
'
,
2
,
packOpts
)
})
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0100
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
;
packingCb
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0100
"
,
2
,
packOpts
);
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0200
...
...
@@ -387,15 +401,14 @@ export default function imagePacking() {
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0200
'
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
123
}
packingCbFail
(
done
,
'
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0200
'
,
2
,
packOpts
)
})
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0200
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
123
};
packingCbFail
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0200
"
,
2
,
packOpts
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0300
...
...
@@ -403,14 +416,14 @@ export default function imagePacking() {
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0300
'
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
}
packingCbFail
(
done
,
'
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0300
'
,
2
,
packOpts
)
})
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0300
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
}
;
packingCbFail
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0300
"
,
2
,
packOpts
);
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0400
...
...
@@ -418,14 +431,14 @@ export default function imagePacking() {
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0400
'
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
quality
:
99
}
packingCbFail
(
done
,
'
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0400
'
,
2
,
packOpts
)
})
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0400
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
quality
:
99
}
;
packingCbFail
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0400
"
,
2
,
packOpts
);
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0500
...
...
@@ -433,14 +446,14 @@ export default function imagePacking() {
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0500
'
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/png
"
,
quality
:
99
}
packingCbFail
(
done
,
'
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0500
'
,
2
,
packOpts
)
})
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0500
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/png
"
,
quality
:
99
}
;
packingCbFail
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0500
"
,
2
,
packOpts
);
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0600
...
...
@@ -448,14 +461,14 @@ export default function imagePacking() {
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0600
'
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
50
}
packingCb
(
done
,
'
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0600
'
,
5
,
packOpts
)
})
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0600
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
50
}
;
packingCb
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0600
"
,
5
,
packOpts
);
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0700
...
...
@@ -463,15 +476,14 @@ export default function imagePacking() {
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0700
'
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
123
}
packingCbFail
(
done
,
'
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0700
'
,
5
,
packOpts
)
})
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0700
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
123
};
packingCbFail
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0700
"
,
5
,
packOpts
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0800
...
...
@@ -479,14 +491,14 @@ export default function imagePacking() {
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0800
'
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
}
packingCbFail
(
done
,
'
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0800
'
,
5
,
packOpts
)
})
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0800
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
}
;
packingCbFail
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0800
"
,
5
,
packOpts
);
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0900
...
...
@@ -494,14 +506,14 @@ export default function imagePacking() {
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0900
'
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
quality
:
99
}
packingCbFail
(
done
,
'
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0900
'
,
5
,
packOpts
)
})
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0900
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
quality
:
99
}
;
packingCbFail
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_0900
"
,
5
,
packOpts
);
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_1000
...
...
@@ -509,102 +521,105 @@ export default function imagePacking() {
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_1000
'
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/png
"
,
quality
:
99
}
packingCbFail
(
done
,
'
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_1000
'
,
5
,
packOpts
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0100
* @tc.name : packing ImageSource - promise
* @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
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_1000
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/png
"
,
quality
:
99
}
;
packingCbFail
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_CALLBACK_1000
"
,
5
,
packOpts
);
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0100
* @tc.name : packing ImageSource - promise
* @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
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0100
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.png
'
);
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0100 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0100 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0100 create image packer failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0100 create image packer failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
imagePackerApi
.
packing
(
imageSourceApi
,
packOpts
)
.
then
(
data
=>
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0100 success
'
);
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
};
imagePackerApi
.
packing
(
imageSourceApi
,
packOpts
)
.
then
((
data
)
=>
{
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0100 success
"
);
expect
(
data
!=
undefined
).
assertTrue
();
done
();
}).
catch
(
error
=>
{
console
.
log
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0100 error:
'
+
error
);
})
.
catch
((
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0100 error:
"
+
error
);
expect
(
false
).
assertFail
();
done
();
})
})
;
}
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0100 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0100 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0100
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0100
* @tc.name : packing ImageSource - callback
* @tc.desc : 1.create ImageSource
* 2.call packing
* 3.return array
* 4.callbackcall return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0100
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0100
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.png
'
);
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0100 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0100 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0100 create image packer failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0100 create image packer failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
1
}
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
1
}
;
imagePackerApi
.
packing
(
imageSourceApi
,
packOpts
,
(
err
,
data
)
=>
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0100 success
'
+
JSON
.
stringify
(
data
));
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0100 success
"
+
JSON
.
stringify
(
data
)
);
expect
(
data
!=
undefined
).
assertTrue
();
done
();
})
})
;
}
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0100 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0100 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0200
...
...
@@ -613,40 +628,40 @@ export default function imagePacking() {
* 2.call packing
* 3.return array
* 4.callbackcall return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0200
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0200
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.png
'
);
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0200 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0200 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0200 create image packer failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0200 create image packer failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
let
packOpts
=
{
format
:
"
image/gif
"
,
quality
:
98
}
let
packOpts
=
{
format
:
"
image/gif
"
,
quality
:
98
}
;
imagePackerApi
.
packing
(
imageSourceApi
,
packOpts
,
(
err
,
data
)
=>
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0200 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0200 success
"
);
expect
(
data
==
undefined
).
assertTrue
();
console
.
info
(
data
);
done
();
})
})
;
}
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0200 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0200 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0300
...
...
@@ -655,78 +670,78 @@ export default function imagePacking() {
* 2.call packing
* 3.call return array
* 4.callbackcall return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0300
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0300
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.png
'
);
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0300 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0300 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0300 create image packer failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0300 create image packer failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
101
}
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
101
}
;
imagePackerApi
.
packing
(
imageSourceApi
,
packOpts
,
(
err
,
data
)
=>
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0300 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0300 success
"
);
expect
(
data
==
undefined
).
assertTrue
();
console
.
info
(
data
);
done
();
})
})
;
}
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0300 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0300 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_CREATEIMAGEPACKER_0100
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_CREATEIMAGEPACKER_0100
* @tc.name : createImagePacker
* @tc.desc : 1.create ImageSource
* 2.call packing
* 3.return array
* 4.callbackcall return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_CREATEIMAGEPACKER_0100
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_CREATEIMAGEPACKER_0100
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.png
'
);
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_CREATEIMAGEPACKER_0100 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_CREATEIMAGEPACKER_0100 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_CREATEIMAGEPACKER_0100 create image packer failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_CREATEIMAGEPACKER_0100 create image packer failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_CREATEIMAGEPACKER_0100 create image packer success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_CREATEIMAGEPACKER_0100 create image packer success
"
);
expect
(
true
).
assertTrue
();
done
();
}
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_CREATEIMAGEPACKER_0100 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_CREATEIMAGEPACKER_0100 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0200
...
...
@@ -735,46 +750,48 @@ export default function imagePacking() {
* 2.call packing
* 3.call return array
* 4.callbackcall return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0200
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0200
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.png
'
);
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0200 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0200 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0200 create image packer failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0200 create image packer failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
let
packOpts
=
{
format
:
"
image/jpeg
"
}
imagePackerApi
.
packing
(
imageSourceApi
,
packOpts
)
.
then
(
data
=>
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0200 failed
'
);
let
packOpts
=
{
format
:
"
image/jpeg
"
};
imagePackerApi
.
packing
(
imageSourceApi
,
packOpts
)
.
then
((
data
)
=>
{
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0200 failed
"
);
expect
(
data
==
undefined
).
assertTrue
();
done
();
}).
catch
(
error
=>
{
console
.
log
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0200 error:
'
+
error
);
console
.
log
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0200 success
'
);
})
.
catch
((
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0200 error:
"
+
error
);
console
.
log
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0200 success
"
);
expect
(
true
).
assertTrue
();
done
();
})
})
;
}
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0200 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0200 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0300
...
...
@@ -783,181 +800,183 @@ export default function imagePacking() {
* 2.call packing
* 3.call return array
* 4.callbackcall return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0300
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0300
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.png
'
);
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0300 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0300 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0300 create image packer failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0300 create image packer failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
let
packOpts
=
{
quality
:
50
}
imagePackerApi
.
packing
(
imageSourceApi
,
packOpts
)
.
then
(
data
=>
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0300 failed
'
);
let
packOpts
=
{
quality
:
50
};
imagePackerApi
.
packing
(
imageSourceApi
,
packOpts
)
.
then
((
data
)
=>
{
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0300 failed
"
);
expect
(
data
==
undefined
).
assertTrue
();
done
();
}).
catch
(
error
=>
{
console
.
log
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0300 error:
'
+
error
);
console
.
log
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0300 success
'
);
})
.
catch
((
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0300 error:
"
+
error
);
console
.
log
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0300 success
"
);
expect
(
true
).
assertTrue
();
done
();
})
})
;
}
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0300 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_PROMISE_0300 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0400
* @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
*/
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0400
* @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
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0400
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0400
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.png
'
);
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0400 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0400 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0400 create image packer failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0400 create image packer failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
100
}
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
100
}
;
imagePackerApi
.
packing
(
imageSourceApi
,
packOpts
,
(
err
,
data
)
=>
{
if
(
err
)
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0400 error:
'
+
err
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0400 error:
"
+
err
);
done
();
return
return
;
}
if
(
data
!=
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0400 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0400 success
"
);
expect
(
true
).
assertTrue
();
done
();
}
else
{
except
(
false
).
assertTrue
();
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0400 failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0400 failed
"
);
done
();
}
})
})
;
}
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0400 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0400 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0500
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0500
* @tc.name : packing ImageSource - callback - quality 0
* @tc.desc : 1.create ImageSource
* 2.call packing
* 3.return array
* 4.callbackcall return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0500
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0500
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.png
'
);
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0500 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0500 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0500 create image packer failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0500 create image packer failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
0
}
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
0
}
;
imagePackerApi
.
packing
(
imageSourceApi
,
packOpts
,
(
err
,
data
)
=>
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0500 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0500 success
"
);
expect
(
data
!=
undefined
).
assertTrue
();
done
();
})
})
;
}
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0500 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0500 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0600
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0600
* @tc.name : packing ImageSource - callback - quality -1
* @tc.desc : 1.create ImageSource
* 2.call packing
* 3.return array
* 4.callbackcall return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0600
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0600
"
,
0
,
async
function
(
done
)
{
try
{
await
getFd
(
'
test.png
'
);
await
getFd
(
"
test.png
"
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0600 create image source failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0600 create image source failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0600 create image packer failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0600 create image packer failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
-
1
}
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
-
1
}
;
imagePackerApi
.
packing
(
imageSourceApi
,
packOpts
,
(
err
,
data
)
=>
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0600 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0600 success
"
);
expect
(
data
==
undefined
).
assertTrue
();
done
();
})
})
;
}
}
}
catch
(
error
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0600 error:
'
+
error
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_IMAGESOURCE_CALLBACK_0600 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_RELEASE_IMAGEPACKER_PROMISE_0100
...
...
@@ -965,53 +984,146 @@ export default function imagePacking() {
* @tc.desc : 1.create ImagePacker
* 2.call release
* 3.return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_RELEASE_IMAGEPACKER_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_RELEASE_IMAGEPACKER_PROMISE_0100
"
,
0
,
async
function
(
done
)
{
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_RELEASE_IMAGEPACKER_PROMISE_0100 create image packer failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_RELEASE_IMAGEPACKER_PROMISE_0100 create image packer failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imagePackerApi
.
release
().
then
(()
=>
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_RELEASE_IMAGEPACKER_PROMISE_0100 success
'
);
expect
(
true
).
assertTrue
();
done
();
}).
catch
(()
=>
{
console
.
log
(
'
SUB_GRAPHIC_IMAGE_PACKING_RELEASE_IMAGEPACKER_PROMISE_0100 error:
'
+
error
);
expect
(
false
).
assertTrue
();
done
();
})
imagePackerApi
.
release
()
.
then
(()
=>
{
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_RELEASE_IMAGEPACKER_PROMISE_0100 success
"
);
expect
(
true
).
assertTrue
();
done
();
})
.
catch
(()
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_PACKING_RELEASE_IMAGEPACKER_PROMISE_0100 error:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
});
}
})
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_RELEASE_IMAGEPACKER_CALLBACK_0100
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_RELEASE_IMAGEPACKER_CALLBACK_0100
* @tc.name : release ImagePacker - callback
* @tc.desc : 1.create ImagePacker
* 2.call release
* 3.return undefined
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 1
*/
it
(
'
SUB_GRAPHIC_IMAGE_PACKING_RELEASE_IMAGEPACKER_CALLBACK_0100
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_RELEASE_IMAGEPACKER_CALLBACK_0100
"
,
0
,
async
function
(
done
)
{
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_RELEASE_IMAGEPACKER_CALLBACK_0100 create image packer failed
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_RELEASE_IMAGEPACKER_CALLBACK_0100 create image packer failed
"
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imagePackerApi
.
release
(()
=>
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_PACKING_RELEASE_IMAGEPACKER_CALLBACK_0100 success
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_PACKING_RELEASE_IMAGEPACKER_CALLBACK_0100 success
"
);
expect
(
true
).
assertTrue
();
done
();
})
})
;
}
})
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_PROMISE_0100
* @tc.name : SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_PROMISE_0100
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_PROMISE_0100
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
,
bufferSize
:
10485760
};
packingPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_PROMISE_0100
"
,
2
,
packOpts
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_PROMISE_0200
* @tc.name : SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_PROMISE_0200
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_PROMISE_0200
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
,
bufferSize
:
20480
};
console
.
info
(
`SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_PROMISE_0200 buffersize:
${
packOpts
.
bufferSize
}
`
);
packingPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_PROMISE_0200
"
,
2
,
packOpts
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_PROMISE_0300
* @tc.name : SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_PROMISE_0300-over maxbufferSize
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_PROMISE_0300
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
,
bufferSize
:
20000000
};
packingPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_PROMISE_0300
"
,
2
,
packOpts
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_CALLBACK_0100
* @tc.name : SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_CALLBACK_0100
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_CALLBACK_0100
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
,
bufferSize
:
10485760
};
packingCb
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_CALLBACK_0100
"
,
2
,
packOpts
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_CALLBACK_0200
* @tc.name : SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_CALLBACK_0200
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_CALLBACK_0200
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
,
bufferSize
:
20480
};
packingCb
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_CALLBACK_0200
"
,
5
,
packOpts
);
});
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_CALLBACK_0300
* @tc.name : SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_CALLBACK_0300
* @tc.desc : 1.create PixelMap
* 2.create ImagePacker
* 3.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_CALLBACK_0300
"
,
0
,
async
function
(
done
)
{
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
,
bufferSize
:
20000000
};
packingCb
(
done
,
"
SUB_GRAPHIC_IMAGE_PACKING_ADDBUFFERSIZE_CALLBACK_0300
"
,
5
,
packOpts
);
});
});
}
multimedia/image/image_js_standard/imageRGBA/src/main/js/test/RGBA.test.js
浏览文件 @
6b0f6fd0
...
...
@@ -13,26 +13,27 @@
* limitations under the License.
*/
import
image
from
'
@ohos.multimedia.image
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
image
from
"
@ohos.multimedia.image
"
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
"
deccjsunit/index
"
;
describe
(
'
Image
'
,
function
()
{
describe
(
"
Image
"
,
function
()
{
const
{
RGBA_F16
,
BGRA_8888
,
ALPHA_8
,
RGB_565
,
ARGB_8888
,
UNKNOWN
,
RGB_888
}
=
image
.
PixelMapFormat
;
beforeAll
(
function
()
{
console
.
info
(
'
beforeAll case
'
);
})
console
.
info
(
"
beforeAll case
"
);
})
;
beforeEach
(
function
()
{
console
.
info
(
'
beforeEach case
'
);
})
console
.
info
(
"
beforeEach case
"
);
})
;
afterEach
(
function
()
{
console
.
info
(
'
afterEach case
'
);
})
console
.
info
(
"
afterEach case
"
);
})
;
afterAll
(
function
()
{
console
.
info
(
'
afterAll case
'
);
})
console
.
info
(
"
afterAll case
"
);
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0100
...
...
@@ -42,25 +43,26 @@ describe('Image', function () {
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0100
"
,
0
,
async
function
(
done
)
{
const
Color
=
new
ArrayBuffer
(
96
);
let
opts
=
{
editable
:
true
,
pixelFormat
:
7
,
size
:
{
height
:
4
,
width
:
6
}
}
image
.
createPixelMap
(
Color
,
opts
)
.
then
(
pixelmap
=>
{
let
opts
=
{
editable
:
true
,
pixelFormat
:
RGBA_F16
,
size
:
{
height
:
4
,
width
:
6
}
};
image
.
createPixelMap
(
Color
,
opts
)
.
then
((
pixelmap
)
=>
{
expect
(
pixelmap
!=
undefined
).
assertTrue
();
expect
(
pixelmap
.
isEditable
==
opts
.
editable
).
assertTrue
();
done
();
})
.
catch
(
error
=>
{
console
.
log
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0100 err
'
+
error
);
.
catch
(
(
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0100 err
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
})
})
})
;
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0100
...
...
@@ -70,16 +72,16 @@ describe('Image', function () {
* 2.set editable,pixelFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0100
'
,
0
,
async
function
(
done
)
{
*/
it
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0100
"
,
0
,
async
function
(
done
)
{
const
Color
=
new
ArrayBuffer
(
96
);
let
opts
=
{
editable
:
true
,
pixelFormat
:
7
,
size
:
{
height
:
4
,
width
:
6
}
}
let
opts
=
{
editable
:
true
,
pixelFormat
:
RGBA_F16
,
size
:
{
height
:
4
,
width
:
6
}
};
image
.
createPixelMap
(
Color
,
opts
,
(
err
,
pixelmap
)
=>
{
if
(
err
!=
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0100 err:
'
+
err
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0100 err:
"
+
err
);
expect
(
false
).
assertTrue
();
done
();
return
;
...
...
@@ -87,8 +89,8 @@ describe('Image', function () {
expect
(
pixelmap
!=
undefined
).
assertTrue
();
expect
(
pixelmap
.
isEditable
==
opts
.
editable
).
assertTrue
();
done
();
})
})
})
;
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0200
...
...
@@ -98,44 +100,45 @@ describe('Image', function () {
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0200
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0200
"
,
0
,
async
function
(
done
)
{
const
Color
=
new
ArrayBuffer
(
96
);
let
opts
=
{
editable
:
false
,
pixelFormat
:
7
,
size
:
{
height
:
4
,
width
:
6
}
}
image
.
createPixelMap
(
Color
,
opts
)
.
then
(
pixelmap
=>
{
let
opts
=
{
editable
:
false
,
pixelFormat
:
RGBA_F16
,
size
:
{
height
:
4
,
width
:
6
}
};
image
.
createPixelMap
(
Color
,
opts
)
.
then
((
pixelmap
)
=>
{
expect
(
pixelmap
!=
undefined
).
assertTrue
();
expect
(
pixelmap
.
isEditable
==
opts
.
editable
).
assertTrue
();
done
();
})
.
catch
(
error
=>
{
console
.
log
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0200 err
'
+
error
);
.
catch
(
(
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0200 err
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
})
})
})
;
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0200
* @tc.name : create pixelmap-callback (editable: false, pixelFormat: RGBA_F16,
* size: { height: 4, width: 6 },bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixelFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0200
'
,
0
,
async
function
(
done
)
{
* @tc.number : SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0200
* @tc.name : create pixelmap-callback (editable: false, pixelFormat: RGBA_F16,
* size: { height: 4, width: 6 },bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixelFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0200
"
,
0
,
async
function
(
done
)
{
const
Color
=
new
ArrayBuffer
(
96
);
let
opts
=
{
editable
:
false
,
pixelFormat
:
7
,
size
:
{
height
:
4
,
width
:
6
}
}
let
opts
=
{
editable
:
false
,
pixelFormat
:
RGBA_F16
,
size
:
{
height
:
4
,
width
:
6
}
};
image
.
createPixelMap
(
Color
,
opts
,
(
err
,
pixelmap
)
=>
{
if
(
err
!=
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0200 err:
'
+
err
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0200 err:
"
+
err
);
expect
(
false
).
assertTrue
();
done
();
return
;
...
...
@@ -143,9 +146,8 @@ describe('Image', function () {
expect
(
pixelmap
!=
undefined
).
assertTrue
();
expect
(
pixelmap
.
isEditable
==
opts
.
editable
).
assertTrue
();
done
();
})
})
});
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0300
...
...
@@ -155,25 +157,26 @@ describe('Image', function () {
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0300
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0300
"
,
0
,
async
function
(
done
)
{
const
Color
=
new
ArrayBuffer
(
96
);
let
opts
=
{
editable
:
true
,
pixelFormat
:
6
,
size
:
{
height
:
4
,
width
:
6
}
}
image
.
createPixelMap
(
Color
,
opts
)
.
then
(
pixelmap
=>
{
let
opts
=
{
editable
:
true
,
pixelFormat
:
ALPHA_8
,
size
:
{
height
:
4
,
width
:
6
}
};
image
.
createPixelMap
(
Color
,
opts
)
.
then
((
pixelmap
)
=>
{
expect
(
pixelmap
!=
undefined
).
assertTrue
();
expect
(
pixelmap
.
isEditable
==
opts
.
editable
).
assertTrue
();
done
();
})
.
catch
(
error
=>
{
console
.
log
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0300 err
'
+
error
);
.
catch
(
(
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0300 err
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
})
})
})
;
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0400
...
...
@@ -183,25 +186,26 @@ describe('Image', function () {
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0400
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0400
"
,
0
,
async
function
(
done
)
{
const
Color
=
new
ArrayBuffer
(
96
);
let
opts
=
{
editable
:
true
,
pixelFormat
:
2
,
size
:
{
height
:
4
,
width
:
6
}
}
image
.
createPixelMap
(
Color
,
opts
)
.
then
(
pixelmap
=>
{
let
opts
=
{
editable
:
true
,
pixelFormat
:
RGB_565
,
size
:
{
height
:
4
,
width
:
6
}
};
image
.
createPixelMap
(
Color
,
opts
)
.
then
((
pixelmap
)
=>
{
expect
(
pixelmap
!=
undefined
).
assertTrue
();
expect
(
pixelmap
.
isEditable
==
opts
.
editable
).
assertTrue
();
done
();
})
.
catch
(
error
=>
{
console
.
log
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0400 err
'
+
error
);
.
catch
(
(
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0400 err
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
})
})
})
;
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0500
...
...
@@ -211,25 +215,26 @@ describe('Image', function () {
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0500
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0500
"
,
0
,
async
function
(
done
)
{
const
Color
=
new
ArrayBuffer
(
96
);
let
opts
=
{
editable
:
true
,
pixelFormat
:
1
,
size
:
{
height
:
4
,
width
:
6
}
}
image
.
createPixelMap
(
Color
,
opts
)
.
then
(
pixelmap
=>
{
let
opts
=
{
editable
:
true
,
pixelFormat
:
ARGB_8888
,
size
:
{
height
:
4
,
width
:
6
}
};
image
.
createPixelMap
(
Color
,
opts
)
.
then
((
pixelmap
)
=>
{
expect
(
pixelmap
!=
undefined
).
assertTrue
();
expect
(
pixelmap
.
isEditable
==
opts
.
editable
).
assertTrue
();
done
();
})
.
catch
(
error
=>
{
console
.
log
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0500 err
'
+
error
);
.
catch
(
(
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0500 err
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
})
})
})
;
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0300
...
...
@@ -239,16 +244,16 @@ describe('Image', function () {
* 2.set editable,pixelFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0300
'
,
0
,
async
function
(
done
)
{
*/
it
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0300
"
,
0
,
async
function
(
done
)
{
const
Color
=
new
ArrayBuffer
(
96
);
let
opts
=
{
editable
:
true
,
pixelFormat
:
6
,
size
:
{
height
:
4
,
width
:
6
}
}
let
opts
=
{
editable
:
true
,
pixelFormat
:
ALPHA_8
,
size
:
{
height
:
4
,
width
:
6
}
};
image
.
createPixelMap
(
Color
,
opts
,
(
err
,
pixelmap
)
=>
{
if
(
err
!=
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0300 err:
'
+
err
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0300 err:
"
+
err
);
expect
(
false
).
assertTrue
();
done
();
return
;
...
...
@@ -256,9 +261,8 @@ describe('Image', function () {
expect
(
pixelmap
!=
undefined
).
assertTrue
();
expect
(
pixelmap
.
isEditable
==
opts
.
editable
).
assertTrue
();
done
();
})
})
});
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0400
...
...
@@ -268,16 +272,16 @@ describe('Image', function () {
* 2.set editable,pixelFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0400
'
,
0
,
async
function
(
done
)
{
*/
it
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0400
"
,
0
,
async
function
(
done
)
{
const
Color
=
new
ArrayBuffer
(
96
);
let
opts
=
{
editable
:
true
,
pixelFormat
:
2
,
size
:
{
height
:
4
,
width
:
6
}
}
let
opts
=
{
editable
:
true
,
pixelFormat
:
RGB_565
,
size
:
{
height
:
4
,
width
:
6
}
};
image
.
createPixelMap
(
Color
,
opts
,
(
err
,
pixelmap
)
=>
{
if
(
err
!=
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0400 err:
'
+
err
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0400 err:
"
+
err
);
expect
(
false
).
assertTrue
();
done
();
return
;
...
...
@@ -285,9 +289,8 @@ describe('Image', function () {
expect
(
pixelmap
!=
undefined
).
assertTrue
();
expect
(
pixelmap
.
isEditable
==
opts
.
editable
).
assertTrue
();
done
();
})
})
});
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0500
...
...
@@ -297,16 +300,16 @@ describe('Image', function () {
* 2.set editable,pixelFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0500
'
,
0
,
async
function
(
done
)
{
*/
it
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0500
"
,
0
,
async
function
(
done
)
{
const
Color
=
new
ArrayBuffer
(
96
);
let
opts
=
{
editable
:
true
,
pixelFormat
:
1
,
size
:
{
height
:
4
,
width
:
6
}
}
let
opts
=
{
editable
:
true
,
pixelFormat
:
ARGB_8888
,
size
:
{
height
:
4
,
width
:
6
}
};
image
.
createPixelMap
(
Color
,
opts
,
(
err
,
pixelmap
)
=>
{
if
(
err
!=
undefined
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0500 err:
'
+
err
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0500 err:
"
+
err
);
expect
(
false
).
assertTrue
();
done
();
return
;
...
...
@@ -314,8 +317,8 @@ describe('Image', function () {
expect
(
pixelmap
!=
undefined
).
assertTrue
();
expect
(
pixelmap
.
isEditable
==
opts
.
editable
).
assertTrue
();
done
();
})
})
})
;
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0600
...
...
@@ -328,21 +331,21 @@ describe('Image', function () {
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0600
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0600
"
,
0
,
async
function
(
done
)
{
const
Color
=
new
ArrayBuffer
(
96
);
let
opts
=
{
editable
:
true
,
pixelFormat
:
0
,
size
:
{
height
:
-
1
,
width
:
8
}
}
let
opts
=
{
editable
:
true
,
pixelFormat
:
UNKNOWN
,
size
:
{
height
:
-
1
,
width
:
8
}
};
image
.
createPixelMap
(
Color
,
opts
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0600 err:
'
+
err
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0600 err:
"
+
err
);
expect
(
pixelmap
==
undefined
).
assertTrue
();
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0600 pass
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0600 pass
"
);
done
();
}
else
{
expect
(
false
).
assertTrue
();
done
();
}
})
})
})
;
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0700
...
...
@@ -355,21 +358,21 @@ describe('Image', function () {
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0700
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0700
"
,
0
,
async
function
(
done
)
{
const
Color
=
new
ArrayBuffer
(
96
);
let
opts
=
{
editable
:
true
,
pixelFormat
:
1
,
size
:
{
height
:
6
,
width
:
-
1
}
}
let
opts
=
{
editable
:
true
,
pixelFormat
:
ARGB_8888
,
size
:
{
height
:
6
,
width
:
-
1
}
};
image
.
createPixelMap
(
Color
,
opts
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0700 err:
'
+
err
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0700 err:
"
+
err
);
expect
(
pixelmap
==
undefined
).
assertTrue
();
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0700 pass
'
);
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0700 pass
"
);
done
();
}
else
{
expect
(
false
).
assertTrue
();
done
();
}
})
})
})
;
})
;
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0600
...
...
@@ -381,20 +384,23 @@ describe('Image', function () {
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0600
'
,
0
,
async
function
(
done
)
{
*/
it
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0600
"
,
0
,
async
function
(
done
)
{
const
Color
=
new
ArrayBuffer
(
96
);
let
opts
=
{
editable
:
true
,
pixelFormat
:
0
,
size
:
{
height
:
-
1
,
width
:
8
}
}
image
.
createPixelMap
(
Color
,
opts
).
then
(
pixelmap
=>
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0600 failed
'
);
done
();
}).
catch
(
error
=>
{
console
.
log
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0600 err:
'
+
error
);
expect
(
true
).
assertTrue
();
done
();
})
})
let
opts
=
{
editable
:
true
,
pixelFormat
:
UNKNOWN
,
size
:
{
height
:
-
1
,
width
:
8
}
};
image
.
createPixelMap
(
Color
,
opts
)
.
then
((
pixelmap
)
=>
{
expect
(
false
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0600 failed
"
);
done
();
})
.
catch
((
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0600 err:
"
+
error
);
expect
(
true
).
assertTrue
();
done
();
});
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0700
...
...
@@ -406,76 +412,135 @@ describe('Image', function () {
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0700
'
,
0
,
async
function
(
done
)
{
*/
it
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0700
"
,
0
,
async
function
(
done
)
{
const
Color
=
new
ArrayBuffer
(
96
);
let
opts
=
{
editable
:
true
,
pixelFormat
:
0
,
size
:
{
height
:
6
,
width
:
-
1
}
}
image
.
createPixelMap
(
Color
,
opts
).
then
(
pixelmap
=>
{
expect
(
false
).
assertTrue
();
console
.
info
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0700 failed
'
);
done
();
}).
catch
(
error
=>
{
console
.
log
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0700 error:
'
+
error
);
expect
(
true
).
assertTrue
();
done
();
})
})
let
opts
=
{
editable
:
true
,
pixelFormat
:
UNKNOWN
,
size
:
{
height
:
6
,
width
:
-
1
}
};
image
.
createPixelMap
(
Color
,
opts
)
.
then
((
pixelmap
)
=>
{
expect
(
false
).
assertTrue
();
console
.
info
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0700 failed
"
);
done
();
})
.
catch
((
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0700 error:
"
+
error
);
expect
(
true
).
assertTrue
();
done
();
});
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0800
* @tc.name : create pixelmap-promise (editable: true, pixelFormat: BGRA8888,
* @tc.name : create pixelmap-promise (editable: true, pixelFormat: BGRA
_
8888,
* size: { height: 4, width: 6 }, bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0800
'
,
0
,
async
function
(
done
)
{
it
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0800
"
,
0
,
async
function
(
done
)
{
const
Color
=
new
ArrayBuffer
(
96
);
let
opts
=
{
editable
:
true
,
pixelFormat
:
4
,
size
:
{
height
:
4
,
width
:
6
}
}
image
.
createPixelMap
(
Color
,
opts
)
.
then
(
pixelmap
=>
{
console
.
log
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0800 pixelFormat: 4
'
);
let
opts
=
{
editable
:
true
,
pixelFormat
:
BGRA_8888
,
size
:
{
height
:
4
,
width
:
6
}
};
image
.
createPixelMap
(
Color
,
opts
)
.
then
((
pixelmap
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0800 pixelFormat: BGRA_8888
"
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
expect
(
pixelmap
.
isEditable
==
opts
.
editable
).
assertTrue
();
done
();
})
.
catch
(
error
=>
{
console
.
log
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0800 err:
'
+
error
);
.
catch
(
(
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0800 err:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
});
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0900
* @tc.name : create pixelmap-promise (editable: true, pixelFormat: RGB_888 ,
* size: { height: 4, width: 6 }, bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixeFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0900
"
,
0
,
async
function
(
done
)
{
const
Color
=
new
ArrayBuffer
(
96
);
let
opts
=
{
editable
:
true
,
pixelFormat
:
RGB_888
,
size
:
{
height
:
4
,
width
:
6
}
};
image
.
createPixelMap
(
Color
,
opts
)
.
then
((
pixelmap
)
=>
{
expect
(
pixelmap
!=
undefined
).
assertTrue
();
expect
(
pixelmap
.
isEditable
==
opts
.
editable
).
assertTrue
();
done
();
})
})
.
catch
((
error
)
=>
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_PROMISE_0900 err:
"
+
error
);
expect
(
false
).
assertTrue
();
done
();
});
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0800
* @tc.name : create pixelmap-callback (editable: true, pixelFormat: BGRA8888,
* @tc.name : create pixelmap-callback (editable: true, pixelFormat: BGRA_8888,
* size: { height: 4, width: 6 },bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixelFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0800
"
,
0
,
async
function
(
done
)
{
const
Color
=
new
ArrayBuffer
(
96
);
let
opts
=
{
editable
:
true
,
pixelFormat
:
BGRA_8888
,
size
:
{
height
:
4
,
width
:
6
}
};
image
.
createPixelMap
(
Color
,
opts
,
(
err
,
pixelmap
)
=>
{
if
(
err
!=
undefined
)
{
console
.
log
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0800 err:
"
+
err
);
expect
(
false
).
assertTrue
();
done
();
return
;
}
expect
(
pixelmap
!=
undefined
).
assertTrue
();
expect
(
pixelmap
.
isEditable
==
opts
.
editable
).
assertTrue
();
done
();
});
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0900
* @tc.name : create pixelmap-callback (editable: true, pixelFormat: RGB_888,
* size: { height: 4, width: 6 },bytes = buffer)
* @tc.desc : 1.create InitializationOptions object
* 2.set editable,pixelFormat,size
* 3.using color and opts create newPixelMap
* 4.return newpixelmap not empty
* @tc.size : MEDIUM
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : Level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0800
'
,
0
,
async
function
(
done
)
{
*/
it
(
"
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0900
"
,
0
,
async
function
(
done
)
{
const
Color
=
new
ArrayBuffer
(
96
);
let
opts
=
{
editable
:
true
,
pixelFormat
:
4
,
size
:
{
height
:
4
,
width
:
6
}
}
let
opts
=
{
editable
:
true
,
pixelFormat
:
RGB_888
,
size
:
{
height
:
4
,
width
:
6
}
};
image
.
createPixelMap
(
Color
,
opts
,
(
err
,
pixelmap
)
=>
{
if
(
err
!=
undefined
)
{
console
.
log
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0800 err:
'
+
err
);
expect
(
false
).
assertTrue
();
done
();
return
;
}
console
.
log
(
'
SUB_GRAPHIC_IMAGE_RGBA_CREATE_PIXELMAP_CALLBACK_0800 pixelFormat: image.PixelMapFormat.BGRA_8888
'
);
expect
(
pixelmap
!=
undefined
).
assertTrue
();
expect
(
pixelmap
.
isEditable
==
opts
.
editable
).
assertTrue
();
done
();
})
})
})
\ No newline at end of file
});
});
});
multimedia/image/image_js_standard/imageYUV/src/main/js/test/yuv.test.js
浏览文件 @
6b0f6fd0
...
...
@@ -13,201 +13,278 @@
* limitations under the License.
*/
import
image
from
'
@ohos.multimedia.image
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
@ohos/hypium
'
import
image
from
"
@ohos.multimedia.image
"
;
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
"
@ohos/hypium
"
;
export
default
function
imageYuv
()
{
describe
(
'
imageYuv
'
,
function
()
{
beforeAll
(
async
function
()
{
console
.
info
(
'
beforeAll case
'
);
})
beforeEach
(
function
()
{
isTimeOut
=
false
;
console
.
info
(
'
beforeEach case
'
);
})
afterEach
(
async
function
()
{
console
.
info
(
'
afterEach case
'
);
})
afterAll
(
function
()
{
console
.
info
(
'
afterAll case
'
);
})
function
createBuffer
(
height
,
width
)
{
var
ySize
=
height
*
width
;
var
uvSize
=
ySize
/
2
var
ySum
=
ySize
;
var
uvSum
=
uvSize
/
2
;
var
bufferSize
=
ySize
+
uvSize
;
var
yBase
=
0
;
var
uvBase
=
yBase
+
ySize
;
var
yuv
=
new
ArrayBuffer
(
bufferSize
);
var
yuvArr
=
new
Uint8Array
(
yuv
);
for
(
var
p
=
0
;
p
<
ySum
;
p
++
)
{
var
pos
=
yBase
+
p
;
yuvArr
[
pos
]
=
1
+
p
;
describe
(
"
imageYuv
"
,
function
()
{
const
{
NV21
,
NV12
}
=
image
.
PixelMapFormat
;
const
WRONG_FORMAT
=
10
;
beforeAll
(
async
function
()
{
console
.
info
(
"
beforeAll case
"
);
});
beforeEach
(
function
()
{
isTimeOut
=
false
;
console
.
info
(
"
beforeEach case
"
);
});
afterEach
(
async
function
()
{
console
.
info
(
"
afterEach case
"
);
});
afterAll
(
function
()
{
console
.
info
(
"
afterAll case
"
);
});
function
createBuffer
(
height
,
width
)
{
var
ySize
=
height
*
width
;
var
uvSize
=
ySize
/
2
;
var
ySum
=
ySize
;
var
uvSum
=
uvSize
/
2
;
var
bufferSize
=
ySize
+
uvSize
;
var
yBase
=
0
;
var
uvBase
=
yBase
+
ySize
;
var
yuv
=
new
ArrayBuffer
(
bufferSize
);
var
yuvArr
=
new
Uint8Array
(
yuv
);
for
(
var
p
=
0
;
p
<
ySum
;
p
++
)
{
var
pos
=
yBase
+
p
;
yuvArr
[
pos
]
=
1
+
p
;
}
for
(
var
p
=
0
;
p
<
uvSum
;
p
++
)
{
var
pos
=
uvBase
+
p
*
2
;
yuvArr
[
pos
+
0
]
=
41
+
p
;
yuvArr
[
pos
+
1
]
=
71
+
p
;
}
return
yuv
;
}
for
(
var
p
=
0
;
p
<
uvSum
;
p
++
)
{
var
pos
=
uvBase
+
p
*
2
;
yuvArr
[
pos
+
0
]
=
41
+
p
;
yuvArr
[
pos
+
1
]
=
71
+
p
;
async
function
yuvToJpegByPixelMapPromise
(
done
,
testNum
,
sourceOptions
,
yuvData
)
{
try
{
let
imageSource
=
image
.
createImageSource
(
yuvData
,
sourceOptions
);
if
(
imageSource
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImageSource failed`
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imageSource
.
createPixelMap
()
.
then
((
pixelmap
)
=>
{
if
(
pixelmap
==
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
}
else
{
pixelmap
.
getImageInfo
((
err
,
imageInfo
)
=>
{
if
(
err
!=
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
expect
(
imageInfo
!=
undefined
).
assertTrue
();
expect
(
imageInfo
.
size
.
height
==
4
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
6
).
assertTrue
();
expect
(
imageInfo
.
density
==
120
).
assertTrue
();
done
();
});
}
})
.
catch
((
error
)
=>
{
console
.
info
(
`
${
testNum
}
create Pixelmap failed`
);
console
.
log
(
`
${
testNum
}
error:`
+
error
);
expect
(
false
).
assertTrue
();
done
();
});
}
}
catch
(
error
)
{
logger
.
log
(
`
${
testNum
}
error:`
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
}
return
yuv
;
}
async
function
yuvToJpegByPixelMapPromise
(
done
,
testNum
,
sourceOptions
,
yuvData
)
{
try
{
let
imageSource
=
image
.
createImageSource
(
yuvData
,
sourceOptions
)
if
(
imageSource
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImageSource failed`
);
expect
(
false
).
assertTrue
()
async
function
yuvToJpegByPixelMapPromise_Fail
(
done
,
testNum
,
sourceOptions
,
yuvData
)
{
try
{
let
imageSource
=
image
.
createImageSource
(
yuvData
,
sourceOptions
);
if
(
imageSource
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImageSource failed`
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imageSource
.
createPixelMap
()
.
then
((
pixelmap
)
=>
{
expect
(
false
).
assertTrue
();
done
();
})
.
catch
((
error
)
=>
{
console
.
info
(
`
${
testNum
}
error:`
+
error
);
expect
(
true
).
assertTrue
();
done
();
});
}
}
catch
(
error
)
{
logger
.
log
(
`
${
testNum
}
error:`
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imageSource
.
createPixelMap
()
.
then
((
pixelmap
)
=>
{
if
(
pixelmap
==
undefined
)
{
}
}
async
function
yuvToJpegByPixelMapCallback
(
done
,
testNum
,
sourceOptions
,
yuvData
)
{
console
.
info
(
`
${
testNum
}
test`
);
try
{
let
imageSource
=
image
.
createImageSource
(
yuvData
,
sourceOptions
);
if
(
imageSource
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImageSource failed`
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imageSource
.
createPixelMap
((
err
,
pixelmap
)
=>
{
if
(
err
!=
undefined
||
pixelmap
==
undefined
)
{
console
.
info
(
`
${
testNum
}
err2: `
+
err
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
pixelmap
.
getImageInfo
((
err
,
imageInfo
)
=>
{
if
(
err
!=
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
expect
(
imageInfo
!=
undefined
).
assertTrue
();
expect
(
imageInfo
.
size
.
height
==
4
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
6
).
assertTrue
();
done
();
})
return
;
}
}).
catch
(
error
=>
{
console
.
info
(
`
${
testNum
}
create Pixelmap failed`
);
console
.
log
(
`
${
testNum
}
error:`
+
error
);
expect
(
false
).
assertTrue
();
done
();
})
pixelmap
.
getImageInfo
((
err
,
imageInfo
)
=>
{
if
(
err
!=
undefined
)
{
console
.
info
(
`
${
testNum
}
getImageInfo fail`
);
expect
(
false
).
assertTrue
();
done
();
return
;
}
expect
(
imageInfo
!=
undefined
).
assertTrue
();
expect
(
imageInfo
.
size
.
height
==
4
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
6
).
assertTrue
();
expect
(
imageInfo
.
density
==
120
).
assertTrue
();
done
();
});
});
}
}
catch
(
error
)
{
logger
.
log
(
`
${
testNum
}
error:`
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
}
catch
(
error
)
{
logger
.
log
(
`
${
testNum
}
error:`
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
}
async
function
yuvToJpegByPixelMapPromise_Fail
(
done
,
testNum
,
sourceOptions
,
yuvData
)
{
try
{
let
imageSource
=
image
.
createImageSource
(
yuvData
,
sourceOptions
)
if
(
imageSource
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImageSource failed`
);
expect
(
false
).
assertTrue
()
done
();
}
else
{
imageSource
.
createPixelMap
()
.
then
((
pixelmap
)
=>
{
async
function
yuvToJpegByPixelMapCallback_Fail
(
done
,
testNum
,
sourceOptions
,
yuvData
)
{
try
{
let
imageSource
=
image
.
createImageSource
(
yuvData
,
sourceOptions
);
if
(
imageSource
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImageSource failed`
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imageSource
.
createPixelMap
((
err
,
pixelmap
)
=>
{
if
(
err
!=
undefined
||
pixelmap
==
undefined
)
{
console
.
info
(
`
${
testNum
}
err: `
+
err
);
expect
(
true
).
assertTrue
();
done
();
return
;
}
expect
(
false
).
assertTrue
();
done
();
}).
catch
(
error
=>
{
console
.
info
(
`
${
testNum
}
error:`
+
error
);
expect
(
true
).
assertTrue
();
done
();
})
});
}
}
catch
(
error
)
{
logger
.
log
(
`
${
testNum
}
error:`
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
}
catch
(
error
)
{
logger
.
log
(
`
${
testNum
}
error:`
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
}
async
function
yuvToJpegByPixelMapCallback
(
done
,
testNum
,
sourceOptions
,
yuvData
)
{
console
.
info
(
`
${
testNum
}
test`
);
try
{
async
function
yuvToJpegByImageSourcePromise
(
done
,
testNum
,
sourceOptions
,
arg
,
yuvData
)
{
let
imageSource
=
image
.
createImageSource
(
yuvData
,
sourceOptions
);
if
(
imageSource
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImageSource failed`
);
expect
(
false
).
assertTrue
()
expect
(
false
).
assertTrue
()
;
done
();
}
else
{
imageSource
.
createPixelMap
((
err
,
pixelmap
)
=>
{
if
(
err
!=
undefined
||
pixelmap
==
undefined
)
{
console
.
info
(
`
${
testNum
}
err2: `
+
err
);
expect
(
false
).
assertTrue
();
done
();
return
;
}
pixelmap
.
getImageInfo
((
err
,
imageInfo
)
=>
{
if
(
err
!=
undefined
)
{
console
.
info
(
`
${
testNum
}
getImageInfo fail`
);
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImagePacker failed`
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imagePackerApi
.
packing
(
imageSource
,
arg
)
.
then
((
data
)
=>
{
console
.
info
(
`
${
testNum
}
packed`
);
var
dataArr
=
new
Uint8Array
(
data
);
console
.
info
(
`
${
testNum
}
dataArr.length=`
+
dataArr
.
length
);
for
(
var
i
=
0
;
i
<
dataArr
.
length
;
i
++
)
{
var
str
=
`dataArr[`
+
i
+
`]=`
;
for
(
var
j
=
0
;
j
<
20
&&
i
<
dataArr
.
length
;
j
++
,
i
++
)
{
str
=
str
+
"
,
"
+
dataArr
[
i
];
}
console
.
info
(
`
${
testNum
}
`
+
str
);
i
--
;
}
expect
(
data
!=
undefined
).
assertTrue
();
done
();
})
.
catch
((
error
)
=>
{
console
.
log
(
`
${
testNum
}
error: `
+
error
);
expect
(
false
).
assertTrue
();
done
();
return
;
}
expect
(
imageInfo
!=
undefined
).
assertTrue
();
expect
(
imageInfo
.
size
.
height
==
4
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
6
).
assertTrue
();
done
();
})
})
});
}
}
}
catch
(
error
)
{
logger
.
log
(
`
${
testNum
}
error:`
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
}
async
function
yuvToJpegByPixelMapCallback_Fail
(
done
,
testNum
,
sourceOptions
,
yuvData
)
{
try
{
async
function
yuvToJpegByImageSourcePromise_Fail
(
done
,
testNum
,
sourceOptions
,
arg
,
yuvData
)
{
let
imageSource
=
image
.
createImageSource
(
yuvData
,
sourceOptions
);
if
(
imageSource
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImageSource failed`
);
expect
(
false
).
assertTrue
()
expect
(
false
).
assertTrue
()
;
done
();
}
else
{
imageSource
.
createPixelMap
((
err
,
pixelmap
)
=>
{
if
(
err
!=
undefined
||
pixelmap
==
undefined
)
{
console
.
info
(
`
${
testNum
}
err: `
+
err
);
expect
(
true
).
assertTrue
();
done
();
return
;
}
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImagePacker failed`
);
expect
(
false
).
assertTrue
();
done
();
})
}
else
{
imagePackerApi
.
packing
(
imageSource
,
arg
)
.
then
((
data
)
=>
{
expect
(
data
==
undefined
).
assertTrue
();
done
();
})
.
catch
((
error
)
=>
{
console
.
log
(
`
${
testNum
}
error: `
+
error
);
expect
(
true
).
assertTrue
();
done
();
});
}
}
}
catch
(
error
)
{
logger
.
log
(
`
${
testNum
}
error:`
+
error
);
expect
(
false
).
assertTrue
();
done
();
}
}
async
function
yuvToJpegByImageSourcePromise
(
done
,
testNum
,
sourceOptions
,
arg
,
yuvData
)
{
let
imageSource
=
image
.
createImageSource
(
yuvData
,
sourceOptions
);
if
(
imageSource
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImageSource failed`
);
expect
(
false
).
assertTrue
()
done
();
}
else
{
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImagePacker failed`
);
async
function
yuvToJpegByImageSourceCallback
(
done
,
testNum
,
sourceOptions
,
arg
,
yuvData
)
{
let
imageSource
=
image
.
createImageSource
(
yuvData
,
sourceOptions
);
if
(
imageSource
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImageSource failed`
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imagePackerApi
.
packing
(
imageSource
,
arg
)
.
then
(
data
=>
{
console
.
info
(
`
${
testNum
}
packed`
);
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImagePacker failed`
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imagePackerApi
.
packing
(
imageSource
,
arg
,
(
err
,
data
)
=>
{
if
(
err
!=
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
var
dataArr
=
new
Uint8Array
(
data
);
console
.
info
(
`
${
testNum
}
dataArr.length=`
+
dataArr
.
length
);
for
(
var
i
=
0
;
i
<
dataArr
.
length
;
i
++
)
{
var
str
=
`dataArr[`
+
i
+
`]=`
;
for
(
var
j
=
0
;
((
j
<
20
)
&&
(
i
<
dataArr
.
length
))
;
j
++
,
i
++
)
{
for
(
var
j
=
0
;
j
<
20
&&
i
<
dataArr
.
length
;
j
++
,
i
++
)
{
str
=
str
+
"
,
"
+
dataArr
[
i
];
}
console
.
info
(
`
${
testNum
}
`
+
str
);
...
...
@@ -215,623 +292,690 @@ describe('imageYuv', function () {
}
expect
(
data
!=
undefined
).
assertTrue
();
done
();
}).
catch
(
error
=>
{
console
.
log
(
`
${
testNum
}
error: `
+
error
);
expect
(
false
).
assertTrue
();
done
();
})
});
}
}
}
}
async
function
yuvToJpegByImageSourcePromise_Fail
(
done
,
testNum
,
sourceOptions
,
arg
,
yuvData
)
{
let
imageSource
=
image
.
createImageSource
(
yuvData
,
sourceOptions
);
if
(
imageSource
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImageSource failed`
);
expect
(
false
).
assertTrue
()
done
();
}
else
{
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImagePacker failed`
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imagePackerApi
.
packing
(
imageSource
,
arg
)
.
then
(
data
=>
{
expect
(
data
==
undefined
).
assertTrue
();
done
();
}).
catch
(
error
=>
{
console
.
log
(
`
${
testNum
}
error: `
+
error
);
expect
(
true
).
assertTrue
();
done
();
})
}
}
}
async
function
yuvToJpegByImageSourceCallback
(
done
,
testNum
,
sourceOptions
,
arg
,
yuvData
)
{
let
imageSource
=
image
.
createImageSource
(
yuvData
,
sourceOptions
);
if
(
imageSource
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImageSource failed`
);
expect
(
false
).
assertTrue
()
done
();
}
else
{
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImagePacker failed`
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imagePackerApi
.
packing
(
imageSource
,
arg
,
(
err
,
data
)
=>
{
if
(
err
!=
undefined
)
{
expect
(
false
).
assertTrue
();
done
();
return
;
}
var
dataArr
=
new
Uint8Array
(
data
);
console
.
info
(
`
${
testNum
}
dataArr.length=`
+
dataArr
.
length
);
for
(
var
i
=
0
;
i
<
dataArr
.
length
;
i
++
)
{
var
str
=
`dataArr[`
+
i
+
`]=`
;
for
(
var
j
=
0
;
((
j
<
20
)
&&
(
i
<
dataArr
.
length
));
j
++
,
i
++
)
{
str
=
str
+
"
,
"
+
dataArr
[
i
];
}
console
.
info
(
`
${
testNum
}
`
+
str
);
i
--
;
}
expect
(
data
!=
undefined
).
assertTrue
();
done
();
})
}
}
}
async
function
yuvToJpegByImageSourceCallback_Fail
(
done
,
testNum
,
sourceOptions
,
arg
,
yuvData
)
{
let
imageSource
=
image
.
createImageSource
(
yuvData
,
sourceOptions
);
if
(
imageSource
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImageSource failed`
);
expect
(
false
).
assertTrue
()
done
();
}
else
{
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImagePacker failed`
);
async
function
yuvToJpegByImageSourceCallback_Fail
(
done
,
testNum
,
sourceOptions
,
arg
,
yuvData
)
{
let
imageSource
=
image
.
createImageSource
(
yuvData
,
sourceOptions
);
if
(
imageSource
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImageSource failed`
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imagePackerApi
.
packing
(
imageSource
,
arg
,
(
err
,
data
)
=>
{
expect
(
err
!=
undefined
||
data
==
undefined
).
assertTrue
();
const
imagePackerApi
=
image
.
createImagePacker
();
if
(
imagePackerApi
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create ImagePacker failed`
);
expect
(
false
).
assertTrue
();
done
();
})
}
else
{
imagePackerApi
.
packing
(
imageSource
,
arg
,
(
err
,
data
)
=>
{
expect
(
err
!=
undefined
||
data
==
undefined
).
assertTrue
();
done
();
});
}
}
}
}
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0100
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0100
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
8
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapPromise
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0100
'
,
sourceOptions
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0200
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0200
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0200
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
9
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapPromise
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0200
'
,
sourceOptions
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0300
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0300 - Promise - wrong buffer
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0300
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
new
ArrayBuffer
(
5
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
8
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapPromise
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0300
'
,
sourceOptions
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0400
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0400 - Promise - wrong width
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0400
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
8
,
sourceSize
:
{
height
:
4
,
width
:
5
}
};
yuvToJpegByPixelMapPromise_Fail
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0400
'
,
sourceOptions
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0500
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0500 - Promise - wrong buffer
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0500
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
new
ArrayBuffer
(
5
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
9
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapPromise
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0500
'
,
sourceOptions
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0600
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0600 - Promise - wrong width
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0600
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
9
,
sourceSize
:
{
height
:
4
,
width
:
5
}
};
yuvToJpegByPixelMapPromise_Fail
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0600
'
,
sourceOptions
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0700
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0700 - Promise - wrong format
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0700
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
10
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapPromise_Fail
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0700
'
,
sourceOptions
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0800
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0800 - Promise - format null
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0800
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapPromise_Fail
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0800
'
,
sourceOptions
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0100
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0100
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0100
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
8
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
yuvToJpegByImageSourcePromise
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0100
'
,
sourceOptions
,
packOpts
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0200
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0200
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0200
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
9
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
yuvToJpegByImageSourcePromise
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0200
'
,
sourceOptions
,
packOpts
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0300
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0300 - Promise - wrong buffer
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0300
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
new
ArrayBuffer
(
5
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
8
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
yuvToJpegByImageSourcePromise
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0300
'
,
sourceOptions
,
packOpts
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0400
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0400 - Promise - wrong width
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0400
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
8
,
sourceSize
:
{
height
:
4
,
width
:
5
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
yuvToJpegByImageSourcePromise_Fail
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0400
'
,
sourceOptions
,
packOpts
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0500
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0500 - Promise - wrong buffer
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0500
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
new
ArrayBuffer
(
5
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
9
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
yuvToJpegByImageSourcePromise
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0500
'
,
sourceOptions
,
packOpts
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0600
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0600 - Promise - wrong width
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0600
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
9
,
sourceSize
:
{
height
:
4
,
width
:
5
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
yuvToJpegByImageSourcePromise_Fail
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0600
'
,
sourceOptions
,
packOpts
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0700
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0700 - Promise - wrong format
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0700
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
10
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
yuvToJpegByImageSourcePromise_Fail
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0700
'
,
sourceOptions
,
packOpts
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0800
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0800 - Promise - format null
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0800
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
yuvToJpegByImageSourcePromise_Fail
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0800
'
,
sourceOptions
,
packOpts
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0100
* @tc.name : SUB_IMAGE_yuv_pixelmap_CB_001
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0100
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
8
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapCallback
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0100
'
,
sourceOptions
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0200
* @tc.name : SUB_IMAGE_yuv_pixelmap_CB_002
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0200
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
9
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapCallback
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0200
'
,
sourceOptions
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0300
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0300 - Promise - wrong buffer
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0300
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
new
ArrayBuffer
(
5
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
8
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapCallback
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0300
'
,
sourceOptions
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0400
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0400 - Promise - wrong width
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0400
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
8
,
sourceSize
:
{
height
:
4
,
width
:
5
}
};
yuvToJpegByPixelMapCallback_Fail
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0400
'
,
sourceOptions
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0500
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0500 - Promise - wrong buffer
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0500
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
new
ArrayBuffer
(
5
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
9
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapCallback
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0500
'
,
sourceOptions
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0600
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0600 - Promise - wrong width
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0600
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
9
,
sourceSize
:
{
height
:
4
,
width
:
5
}
};
yuvToJpegByPixelMapCallback_Fail
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0600
'
,
sourceOptions
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0700
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0700 - Promise - wrong format
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0700
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
10
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapCallback_Fail
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0700
'
,
sourceOptions
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0800
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0800 - Promise - format null
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0800
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapCallback_Fail
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0800
'
,
sourceOptions
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0100
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0100
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0100
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
8
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
yuvToJpegByImageSourceCallback
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0100
'
,
sourceOptions
,
packOpts
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0200
* @tc.name : SUB_IMAGE_yuv_imagesource_CB_002
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0200
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
9
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
yuvToJpegByImageSourceCallback
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0200
'
,
sourceOptions
,
packOpts
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0300
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0300 - Promise - wrong buffer
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0300
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
new
ArrayBuffer
(
5
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
8
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
yuvToJpegByImageSourceCallback
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0300
'
,
sourceOptions
,
packOpts
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0400
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0400 - Promise - wrong width
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0400
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
8
,
sourceSize
:
{
height
:
4
,
width
:
5
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
yuvToJpegByImageSourceCallback_Fail
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0400
'
,
sourceOptions
,
packOpts
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0500
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0500 - Promise - wrong buffer
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0500
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
new
ArrayBuffer
(
5
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
9
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
yuvToJpegByImageSourceCallback
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0500
'
,
sourceOptions
,
packOpts
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0600
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0600 - Promise - wrong width
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0600
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
9
,
sourceSize
:
{
height
:
4
,
width
:
5
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
yuvToJpegByImageSourceCallback_Fail
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0600
'
,
sourceOptions
,
packOpts
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0700
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0700 - Promise - wrong format
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0700
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
10
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
yuvToJpegByImageSourceCallback_Fail
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0700
'
,
sourceOptions
,
packOpts
,
yuvData
)
})
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0800
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0800 - Promise - format null
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0800
'
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
}
yuvToJpegByImageSourceCallback_Fail
(
done
,
'
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0800
'
,
sourceOptions
,
packOpts
,
yuvData
)
})
})}
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0100
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0100
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0100
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV21
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0100
"
,
sourceOptions
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0200
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0200
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0200
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV12
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0200
"
,
sourceOptions
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0300
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0300 - Promise - wrong buffer
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0300
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
new
ArrayBuffer
(
5
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV21
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0300
"
,
sourceOptions
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0400
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0400 - Promise - wrong width
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0400
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV21
,
sourceSize
:
{
height
:
4
,
width
:
5
}
};
yuvToJpegByPixelMapPromise_Fail
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0400
"
,
sourceOptions
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0500
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0500 - Promise - wrong buffer
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0500
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
new
ArrayBuffer
(
5
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV12
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapPromise
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0500
"
,
sourceOptions
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0600
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0600 - Promise - wrong width
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0600
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV12
,
sourceSize
:
{
height
:
4
,
width
:
5
}
};
yuvToJpegByPixelMapPromise_Fail
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0600
"
,
sourceOptions
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0700
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0700 - Promise - wrong format
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0700
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
WRONG_FORMAT
,
sourceSize
:
{
height
:
4
,
width
:
6
},
};
yuvToJpegByPixelMapPromise_Fail
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0700
"
,
sourceOptions
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0800
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0800 - Promise - format null
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0800
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapPromise_Fail
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_PROMISE_0800
"
,
sourceOptions
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0100
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0100
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0100
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV21
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
};
yuvToJpegByImageSourcePromise
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0100
"
,
sourceOptions
,
packOpts
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0200
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0200
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0200
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV12
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
};
yuvToJpegByImageSourcePromise
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0200
"
,
sourceOptions
,
packOpts
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0300
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0300 - Promise - wrong buffer
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0300
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
new
ArrayBuffer
(
5
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV21
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
};
yuvToJpegByImageSourcePromise
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0300
"
,
sourceOptions
,
packOpts
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0400
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0400 - Promise - wrong width
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0400
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV21
,
sourceSize
:
{
height
:
4
,
width
:
5
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
};
yuvToJpegByImageSourcePromise_Fail
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0400
"
,
sourceOptions
,
packOpts
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0500
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0500 - Promise - wrong buffer
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0500
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
new
ArrayBuffer
(
5
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV12
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
};
yuvToJpegByImageSourcePromise
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0500
"
,
sourceOptions
,
packOpts
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0600
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0600 - Promise - wrong width
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0600
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV12
,
sourceSize
:
{
height
:
4
,
width
:
5
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
};
yuvToJpegByImageSourcePromise_Fail
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0600
"
,
sourceOptions
,
packOpts
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0700
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0700 - Promise - wrong format
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0700
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
WRONG_FORMAT
,
sourceSize
:
{
height
:
4
,
width
:
6
},
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
};
yuvToJpegByImageSourcePromise_Fail
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0700
"
,
sourceOptions
,
packOpts
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0800
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0800 - Promise - format null
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0800
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
};
yuvToJpegByImageSourcePromise_Fail
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_PROMISE_0800
"
,
sourceOptions
,
packOpts
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0100
* @tc.name : SUB_IMAGE_yuv_pixelmap_CB_001
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0100
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV21
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapCallback
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0100
"
,
sourceOptions
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0200
* @tc.name : SUB_IMAGE_yuv_pixelmap_CB_002
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0200
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV12
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapCallback
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0200
"
,
sourceOptions
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0300
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0300 - Promise - wrong buffer
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0300
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
new
ArrayBuffer
(
5
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV21
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapCallback
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0300
"
,
sourceOptions
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0400
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0400 - Promise - wrong width
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0400
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV21
,
sourceSize
:
{
height
:
4
,
width
:
5
}
};
yuvToJpegByPixelMapCallback_Fail
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0400
"
,
sourceOptions
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0500
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0500 - Promise - wrong buffer
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0500
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
new
ArrayBuffer
(
5
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV12
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapCallback
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0500
"
,
sourceOptions
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0600
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0600 - Promise - wrong width
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0600
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV12
,
sourceSize
:
{
height
:
4
,
width
:
5
}
};
yuvToJpegByPixelMapCallback_Fail
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0600
"
,
sourceOptions
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0700
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0700 - Promise - wrong format
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0700
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
WRONG_FORMAT
,
sourceSize
:
{
height
:
4
,
width
:
6
},
};
yuvToJpegByPixelMapCallback_Fail
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0700
"
,
sourceOptions
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0800
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0800 - Promise - format null
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0800
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
yuvToJpegByPixelMapCallback_Fail
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_PIXELMAP_CB_0800
"
,
sourceOptions
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0100
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0100
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0100
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV21
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
};
yuvToJpegByImageSourceCallback
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0100
"
,
sourceOptions
,
packOpts
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0200
* @tc.name : SUB_IMAGE_yuv_imagesource_CB_002
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0200
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV12
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
};
yuvToJpegByImageSourceCallback
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0200
"
,
sourceOptions
,
packOpts
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0300
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0300 - Promise - wrong buffer
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0300
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
new
ArrayBuffer
(
5
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV21
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
};
yuvToJpegByImageSourceCallback
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0300
"
,
sourceOptions
,
packOpts
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0400
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0400 - Promise - wrong width
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0400
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV21
,
sourceSize
:
{
height
:
4
,
width
:
5
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
};
yuvToJpegByImageSourceCallback_Fail
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0400
"
,
sourceOptions
,
packOpts
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0500
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0500 - Promise - wrong buffer
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0500
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
new
ArrayBuffer
(
5
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV12
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
};
yuvToJpegByImageSourceCallback
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0500
"
,
sourceOptions
,
packOpts
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0600
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0600 - Promise - wrong width
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0600
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
NV12
,
sourceSize
:
{
height
:
4
,
width
:
5
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
};
yuvToJpegByImageSourceCallback_Fail
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0600
"
,
sourceOptions
,
packOpts
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0700
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0700 - Promise - wrong format
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0700
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourcePixelFormat
:
WRONG_FORMAT
,
sourceSize
:
{
height
:
4
,
width
:
6
},
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
};
yuvToJpegByImageSourceCallback_Fail
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0700
"
,
sourceOptions
,
packOpts
,
yuvData
);
});
/**
* @tc.number : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0800
* @tc.name : SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0800 - Promise - format null
* @tc.desc : 1.create ImageSource
* 2.create pixelmap
* 3.create ImagePacker
* 4.call packing
* @tc.size : MEDIUM
* @tc.type : Functional
* @tc.level : level 0
*/
it
(
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0800
"
,
0
,
async
function
(
done
)
{
let
yuvData
=
createBuffer
(
4
,
6
);
let
sourceOptions
=
{
sourceDensity
:
120
,
sourceSize
:
{
height
:
4
,
width
:
6
}
};
let
packOpts
=
{
format
:
"
image/jpeg
"
,
quality
:
99
};
yuvToJpegByImageSourceCallback_Fail
(
done
,
"
SUB_GRAPHIC_IMAGE_YUV_IMAGESOURCE_CB_0800
"
,
sourceOptions
,
packOpts
,
yuvData
);
});
});
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录