Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
cc83d098
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看板
未验证
提交
cc83d098
编写于
7月 28, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 28, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4660 image decodingoption用例修改适配开发修改
Merge pull request !4660 from 秦莉文/OpenHarmony-3.2-Beta2
上级
fa192d9e
316adcf5
变更
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
浏览文件 @
cc83d098
...
@@ -1067,15 +1067,23 @@ describe('Image', function () {
...
@@ -1067,15 +1067,23 @@ describe('Image', function () {
index
:
0
index
:
0
};
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
TC_050-10 fail
'
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
globalpixelmap
=
pixelmap
;
pixelmap
.
getImageInfo
().
then
((
imageInfo
)
=>
{
if
(
pixelmap
==
undefined
)
{
expect
(
imageInfo
.
size
.
height
==
2
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
1
).
assertTrue
();
console
.
info
(
'
TC_050-10 success
'
);
console
.
info
(
'
TC_050-10 success
'
);
expect
(
true
).
assertTrue
(
);
console
.
info
(
"
imageInfo height :
"
+
imageInfo
.
size
.
height
+
"
width :
"
+
imageInfo
.
size
.
width
);
done
();
done
();
}
else
{
}).
catch
((
err
)
=>
{
console
.
info
(
'
TC_050-10 getimageInfo err
'
+
JSON
.
stringify
(
err
));
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
done
();
})
}
}
})
})
}
}
...
@@ -1731,15 +1739,23 @@ describe('Image', function () {
...
@@ -1731,15 +1739,23 @@ describe('Image', function () {
index
:
0
index
:
0
};
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
TC_067-10 fail
'
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
globalpixelmap
=
pixelmap
;
pixelmap
.
getImageInfo
().
then
((
imageInfo
)
=>
{
if
(
pixelmap
==
undefined
)
{
expect
(
imageInfo
.
size
.
height
==
2
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
1
).
assertTrue
();
console
.
info
(
'
TC_067-10 success
'
);
console
.
info
(
'
TC_067-10 success
'
);
expect
(
true
).
assertTrue
(
);
console
.
info
(
"
imageInfo height :
"
+
imageInfo
.
size
.
height
+
"
width :
"
+
imageInfo
.
size
.
width
);
done
();
done
();
}
else
{
}).
catch
((
err
)
=>
{
console
.
info
(
'
TC_067-10 getimageInfo err
'
+
JSON
.
stringify
(
err
));
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
done
();
})
}
}
})
})
}
}
...
@@ -2369,15 +2385,23 @@ describe('Image', function () {
...
@@ -2369,15 +2385,23 @@ describe('Image', function () {
index
:
0
index
:
0
};
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
TC_068-10 fail
'
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
globalpixelmap
=
pixelmap
;
pixelmap
.
getImageInfo
().
then
((
imageInfo
)
=>
{
if
(
pixelmap
==
undefined
)
{
expect
(
imageInfo
.
size
.
height
==
2
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
1
).
assertTrue
();
console
.
info
(
'
TC_068-10 success
'
);
console
.
info
(
'
TC_068-10 success
'
);
expect
(
true
).
assertTrue
(
);
console
.
info
(
"
imageInfo height :
"
+
imageInfo
.
size
.
height
+
"
width :
"
+
imageInfo
.
size
.
width
);
done
();
done
();
}
else
{
}).
catch
((
err
)
=>
{
console
.
info
(
'
TC_068-10 getimageInfo err
'
+
JSON
.
stringify
(
err
));
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
done
();
})
}
}
})
})
}
}
...
@@ -2950,15 +2974,23 @@ describe('Image', function () {
...
@@ -2950,15 +2974,23 @@ describe('Image', function () {
index
:
0
index
:
0
};
};
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
imageSourceApi
.
createPixelMap
(
decodingOptions
,
(
err
,
pixelmap
)
=>
{
if
(
err
)
{
console
.
info
(
'
TC_163-10 fail
'
);
expect
(
false
).
assertTrue
();
done
();
}
else
{
globalpixelmap
=
pixelmap
;
globalpixelmap
=
pixelmap
;
pixelmap
.
getImageInfo
().
then
((
imageInfo
)
=>
{
if
(
pixelmap
==
undefined
)
{
expect
(
imageInfo
.
size
.
height
==
2
).
assertTrue
();
expect
(
imageInfo
.
size
.
width
==
1
).
assertTrue
();
console
.
info
(
'
TC_163-10 success
'
);
console
.
info
(
'
TC_163-10 success
'
);
expect
(
true
).
assertTrue
(
);
console
.
info
(
"
imageInfo height :
"
+
imageInfo
.
size
.
height
+
"
width :
"
+
imageInfo
.
size
.
width
);
done
();
done
();
}
else
{
}).
catch
((
err
)
=>
{
console
.
info
(
'
TC_163-10 getimageInfo err
'
+
JSON
.
stringify
(
err
));
expect
(
false
).
assertTrue
();
expect
(
false
).
assertTrue
();
done
();
done
();
})
}
}
})
})
}
}
...
...
multimedia/image/image_js_standard/imageWebp/src/main/js/test/webp.test.js
100644 → 100755
浏览文件 @
cc83d098
...
@@ -71,6 +71,34 @@ describe('Image', function () {
...
@@ -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
)
{
async
function
createPixMapCbErr
(
done
,
testNum
,
arg
)
{
let
fdNumber
=
fileio
.
openSync
(
pathWebp
);
let
fdNumber
=
fileio
.
openSync
(
pathWebp
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
...
@@ -91,6 +119,33 @@ describe('Image', function () {
...
@@ -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
)
{
async
function
createPixMapPromiseErr
(
done
,
testNum
,
arg
)
{
let
fdNumber
=
fileio
.
openSync
(
pathWebp
);
let
fdNumber
=
fileio
.
openSync
(
pathWebp
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
const
imageSourceApi
=
image
.
createImageSource
(
fdNumber
);
...
@@ -752,7 +807,7 @@ describe('Image', function () {
...
@@ -752,7 +807,7 @@ describe('Image', function () {
desiredRegion
:
{
size
:
{
height
:
10000
,
width
:
10000
},
x
:
0
,
y
:
0
},
desiredRegion
:
{
size
:
{
height
:
10000
,
width
:
10000
},
x
:
0
,
y
:
0
},
index
:
0
index
:
0
};
};
createPixMapCb
Err
(
done
,
'
wbp_009
'
,
decodingOptions
)
createPixMapCb
(
done
,
'
wbp_009
'
,
decodingOptions
)
})
})
/**
/**
...
@@ -873,7 +928,7 @@ describe('Image', function () {
...
@@ -873,7 +928,7 @@ describe('Image', function () {
desiredRegion
:
{
size
:
{
height
:
10000
,
width
:
10000
},
x
:
0
,
y
:
0
},
desiredRegion
:
{
size
:
{
height
:
10000
,
width
:
10000
},
x
:
0
,
y
:
0
},
index
:
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录