Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
316adcf5
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看板
提交
316adcf5
编写于
7月 27, 2022
作者:
Q
qlw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
<image decodingoption用例修改适配开发修改>
Signed-off-by:
N
qlw
<
qinliwen3@huawei.com
>
上级
af82ced3
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
130 addition
and
43 deletion
+130
-43
multimedia/image/image_js_standard/imageDecodeOptions/src/main/js/test/image.test.js
...tandard/imageDecodeOptions/src/main/js/test/image.test.js
+72
-40
multimedia/image/image_js_standard/imageWebp/src/main/js/test/webp.test.js
...image_js_standard/imageWebp/src/main/js/test/webp.test.js
+58
-3
未找到文件。
multimedia/image/image_js_standard/imageDecodeOptions/src/main/js/test/image.test.js
100644 → 100755
浏览文件 @
316adcf5
...
...
@@ -1067,15 +1067,23 @@ describe('Image', function () {
index
:
0
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
TC_050-10 fail
'
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
if
(
pixelmap
==
undefined
)
{
pixelmap
.
getImageInfo
().
then
((
imageInfo
)
=>
{
expect
(
imageInfo
.
size
.
height
==
2
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
1
).
assertTrue
();
console
.
info
(
'
TC_050-10 success
'
);
expect
(
true
).
assertTrue
(
);
console
.
info
(
"
imageInfo height :
"
+
imageInfo
.
size
.
height
+
"
width :
"
+
imageInfo
.
size
.
width
);
done
();
}
else
{
}).
catch
((
err
)
=>
{
console
.
info
(
'
TC_050-10 getimageInfo err
'
+
JSON
.
stringify
(
err
));
expect
(
false
).
assertTrue
();
done
();
})
}
})
}
...
...
@@ -1731,15 +1739,23 @@ describe('Image', function () {
index
:
0
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
TC_067-10 fail
'
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
if
(
pixelmap
==
undefined
)
{
pixelmap
.
getImageInfo
().
then
((
imageInfo
)
=>
{
expect
(
imageInfo
.
size
.
height
==
2
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
1
).
assertTrue
();
console
.
info
(
'
TC_067-10 success
'
);
expect
(
true
).
assertTrue
(
);
console
.
info
(
"
imageInfo height :
"
+
imageInfo
.
size
.
height
+
"
width :
"
+
imageInfo
.
size
.
width
);
done
();
}
else
{
}).
catch
((
err
)
=>
{
console
.
info
(
'
TC_067-10 getimageInfo err
'
+
JSON
.
stringify
(
err
));
expect
(
false
).
assertTrue
();
done
();
})
}
})
}
...
...
@@ -2369,15 +2385,23 @@ describe('Image', function () {
index
:
0
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
TC_068-10 fail
'
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
if
(
pixelmap
==
undefined
)
{
pixelmap
.
getImageInfo
().
then
((
imageInfo
)
=>
{
expect
(
imageInfo
.
size
.
height
==
2
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
1
).
assertTrue
();
console
.
info
(
'
TC_068-10 success
'
);
expect
(
true
).
assertTrue
(
);
console
.
info
(
"
imageInfo height :
"
+
imageInfo
.
size
.
height
+
"
width :
"
+
imageInfo
.
size
.
width
);
done
();
}
else
{
}).
catch
((
err
)
=>
{
console
.
info
(
'
TC_068-10 getimageInfo err
'
+
JSON
.
stringify
(
err
));
expect
(
false
).
assertTrue
();
done
();
})
}
})
}
...
...
@@ -2950,15 +2974,23 @@ describe('Image', function () {
index
:
0
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
TC_163-10 fail
'
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
if
(
pixelmap
==
undefined
)
{
pixelmap
.
getImageInfo
().
then
((
imageInfo
)
=>
{
expect
(
imageInfo
.
size
.
height
==
2
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
1
).
assertTrue
();
console
.
info
(
'
TC_163-10 success
'
);
expect
(
true
).
assertTrue
(
);
console
.
info
(
"
imageInfo height :
"
+
imageInfo
.
size
.
height
+
"
width :
"
+
imageInfo
.
size
.
width
);
done
();
}
else
{
}).
catch
((
err
)
=>
{
console
.
info
(
'
TC_163-10 getimageInfo err
'
+
JSON
.
stringify
(
err
));
expect
(
false
).
assertTrue
();
done
();
})
}
})
}
...
...
multimedia/image/image_js_standard/imageWebp/src/main/js/test/webp.test.js
100644 → 100755
浏览文件 @
316adcf5
...
...
@@ -71,6 +71,34 @@ describe('Image', function () {
}
}
async
function
createPixMapCb
(
done
,
testNum
,
arg
)
{
let
fdNumber
=
fileio
.
openSync
(
pathWebp
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create image source failed`
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imageSourceApi
.
createPixelMap
(
arg
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
`
${
testNum
}
- fail `
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
pixelmap
.
getImageInfo
().
then
((
imageInfo
)
=>
{
expect
(
imageInfo
.
size
.
height
==
2
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
1
).
assertTrue
();
console
.
info
(
`
${
testNum
}
- success `
);
console
.
info
(
"
imageInfo height :
"
+
imageInfo
.
size
.
height
+
"
width :
"
+
imageInfo
.
size
.
width
);
done
();
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
testNum
}
getimageInfo err `
+
JSON
.
stringify
(
err
));
})
}
})
}
}
async
function
createPixMapCbErr
(
done
,
testNum
,
arg
)
{
let
fdNumber
=
fileio
.
openSync
(
pathWebp
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
...
...
@@ -91,6 +119,33 @@ describe('Image', function () {
})
}
}
async
function
createPixMapPromise
(
done
,
testNum
,
arg
)
{
let
fdNumber
=
fileio
.
openSync
(
pathWebp
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
if
(
imageSourceApi
==
undefined
)
{
console
.
info
(
`
${
testNum
}
create image source failed`
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
imageSourceApi
.
createPixelMap
(
arg
).
then
(
pixelmap
=>
{
pixelmap
.
getImageInfo
().
then
((
imageInfo
)
=>
{
expect
(
imageInfo
.
size
.
height
==
2
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
1
).
assertTrue
();
console
.
info
(
`
${
testNum
}
- success `
);
console
.
info
(
"
imageInfo height :
"
+
imageInfo
.
size
.
height
+
"
width :
"
+
imageInfo
.
size
.
width
);
done
();
}).
catch
((
err
)
=>
{
console
.
info
(
`
${
testNum
}
getimageInfo err `
+
JSON
.
stringify
(
err
));
})
}).
catch
(
error
=>
{
console
.
log
(
`
${
testNum
}
fail `
);
expect
(
flase
).
assertTrue
();
done
();
})
}
}
async
function
createPixMapPromiseErr
(
done
,
testNum
,
arg
)
{
let
fdNumber
=
fileio
.
openSync
(
pathWebp
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
...
...
@@ -752,7 +807,7 @@ describe('Image', function () {
desiredRegion
:
{
size
:
{
height
:
10000
,
width
:
10000
},
x
:
0
,
y
:
0
},
index
:
0
};
createPixMapCb
Err
(
done
,
'
wbp_009
'
,
decodingOptions
)
createPixMapCb
(
done
,
'
wbp_009
'
,
decodingOptions
)
})
/**
...
...
@@ -873,7 +928,7 @@ describe('Image', function () {
desiredRegion
:
{
size
:
{
height
:
10000
,
width
:
10000
},
x
:
0
,
y
:
0
},
index
:
0
};
createPixMapPromise
Err
(
done
,
'
wbp_014
'
,
decodingOptions
)
createPixMapPromise
(
done
,
'
wbp_014
'
,
decodingOptions
)
})
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录