Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
587002bd
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看板
未验证
提交
587002bd
编写于
7月 28, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 28, 2023
浏览文件
操作
浏览文件
下载
差异文件
!9556 Add error message for Ndk & Js
Merge pull request !9556 from 黄开兴/OpenHarmony-4.0-Beta2
上级
900d53da
f6537163
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
26 addition
and
34 deletion
+26
-34
multimedia/image/image_js_standard/crossplatform/image/src/main/ets/test/ImageSource.test.ets
...rossplatform/image/src/main/ets/test/ImageSource.test.ets
+2
-2
multimedia/image/image_js_standard/imageGif/src/main/js/test/imageGif.test.js
...ge_js_standard/imageGif/src/main/js/test/imageGif.test.js
+2
-2
multimedia/image/image_js_standard/imagePixelMapNDK/entry/src/main/cpp/napi/image_pixel_map_imgndk_test.cpp
...K/entry/src/main/cpp/napi/image_pixel_map_imgndk_test.cpp
+10
-15
multimedia/image/image_js_standard/imagePixelMapNDK/entry/src/main/cpp/napi/image_pixel_map_imgndk_test.h
...NDK/entry/src/main/cpp/napi/image_pixel_map_imgndk_test.h
+1
-4
multimedia/image/image_js_standard/imageReceiverNDK/entry/src/main/cpp/napi/image_receiver_mdk_test.cpp
...erNDK/entry/src/main/cpp/napi/image_receiver_mdk_test.cpp
+11
-11
未找到文件。
multimedia/image/image_js_standard/crossplatform/image/src/main/ets/test/ImageSource.test.ets
浏览文件 @
587002bd
...
...
@@ -239,7 +239,7 @@ export default function ImageSource() {
}
else
{
try
{
console
.
info
(
`${testNum} getDelayTimePromise create imagesource success`
);
let
delayTimes
=
await
imageSourceApi
.
getDelayTime
();
let
delayTimes
=
await
imageSourceApi
.
getDelayTime
List
();
if
(
delayTimes
!=
undefined
)
{
console
.
info
(
`${testNum} getDelayTimePromise getDelayTime success`
);
expect
(
true
)
.
assertTrue
();
...
...
@@ -270,7 +270,7 @@ export default function ImageSource() {
done
();
}
else
{
console
.
info
(
`${testNum} getDelayTimeCallBack create imagesource success`
);
imageSourceApi
.
getDelayTime
((
err
,
delayTimes
)
=>
{
imageSourceApi
.
getDelayTime
List
((
err
,
delayTimes
)
=>
{
if
(
err
!=
undefined
)
{
console
.
info
(
`${testNum} getDelayTimeCallBack getDelayTime failed err: ${err}`
);
expect
(
false
)
.
assertTrue
();
...
...
multimedia/image/image_js_standard/imageGif/src/main/js/test/imageGif.test.js
浏览文件 @
587002bd
...
...
@@ -115,7 +115,7 @@ export default function imageGif() {
}
else
{
try
{
console
.
info
(
`
${
testNum
}
getDelayTimePromise create imagesource success`
);
let
delayTimes
=
await
imageSourceApi
.
getDelayTime
();
let
delayTimes
=
await
imageSourceApi
.
getDelayTime
List
();
if
(
delayTimes
!=
undefined
)
{
console
.
info
(
`
${
testNum
}
getDelayTimePromise getDelayTime success`
);
expect
(
true
).
assertTrue
();
...
...
@@ -147,7 +147,7 @@ export default function imageGif() {
done
();
}
else
{
console
.
info
(
`
${
testNum
}
getDelayTimeCallBack create imagesource success`
);
imageSourceApi
.
getDelayTime
((
err
,
delayTimes
)
=>
{
imageSourceApi
.
getDelayTime
List
((
err
,
delayTimes
)
=>
{
if
(
err
!=
undefined
)
{
console
.
info
(
`
${
testNum
}
getDelayTimeCallBack getDelayTime failed err:
${
err
}
`
);
expect
(
false
).
assertTrue
();
...
...
multimedia/image/image_js_standard/imagePixelMapNDK/entry/src/main/cpp/napi/image_pixel_map_imgndk_test.cpp
浏览文件 @
587002bd
...
...
@@ -15,7 +15,6 @@
#include "image_pixel_map_imgndk_test.h"
#include "node_api.h"
#include "image_pixel_map_napi.h"
namespace
{
constexpr
uint32_t
NUM_0
=
0
;
...
...
@@ -26,8 +25,6 @@ namespace {
constexpr
uint32_t
NUM_5
=
5
;
}
namespace
OHOS
{
namespace
Media
{
#define STATIC_FUNCTION(n, f) { (n), nullptr, (f), nullptr, nullptr, nullptr, napi_static, nullptr }
napi_value
ImagePixelMapNDKTest
::
Init
(
napi_env
env
,
napi_value
exports
)
...
...
@@ -163,7 +160,7 @@ napi_value ImagePixelMapNDKTest::CreatePixelMap(napi_env env, napi_callback_info
return
udfVar
;
}
int32_t
res
=
OH_PixelMap_CreatePixelMap
(
env
,
createOps
,
buffer
,
bufferSize
,
&
pixelmap
);
if
(
res
!=
OHOS_
IMAGE_RESULT_SUCCESS
||
pixelmap
==
nullptr
)
{
if
(
res
!=
IMAGE_RESULT_SUCCESS
||
pixelmap
==
nullptr
)
{
return
udfVar
;
}
return
pixelmap
;
...
...
@@ -185,7 +182,7 @@ napi_value ImagePixelMapNDKTest::CreateAlphaPixelMap(napi_env env, napi_callback
return
udfVar
;
}
int32_t
res
=
OH_PixelMap_CreateAlphaPixelMap
(
env
,
argValue
[
NUM_0
],
&
alphaPixelmap
);
if
(
res
!=
OHOS_
IMAGE_RESULT_SUCCESS
||
alphaPixelmap
==
nullptr
)
{
if
(
res
!=
IMAGE_RESULT_SUCCESS
||
alphaPixelmap
==
nullptr
)
{
return
udfVar
;
}
return
alphaPixelmap
;
...
...
@@ -213,7 +210,7 @@ napi_value ImagePixelMapNDKTest::InitNativePixelMap(napi_env env, napi_callback_
return
result
;
}
napi_create_int32
(
env
,
OHOS_
IMAGE_RESULT_SUCCESS
,
&
result
);
napi_create_int32
(
env
,
IMAGE_RESULT_SUCCESS
,
&
result
);
return
result
;
}
...
...
@@ -229,7 +226,7 @@ napi_value ImagePixelMapNDKTest::GetBytesNumberPerRow(napi_env env, napi_callbac
int32_t
rowBytes
=
NUM_0
;
int32_t
res
=
OH_PixelMap_GetBytesNumberPerRow
(
native
,
&
rowBytes
);
if
(
res
!=
OHOS_
IMAGE_RESULT_SUCCESS
||
rowBytes
==
NUM_0
)
{
if
(
res
!=
IMAGE_RESULT_SUCCESS
||
rowBytes
==
NUM_0
)
{
return
result
;
}
...
...
@@ -249,7 +246,7 @@ napi_value ImagePixelMapNDKTest::GetIsEditable(napi_env env, napi_callback_info
int32_t
editable
=
NUM_0
;
int32_t
res
=
OH_PixelMap_GetIsEditable
(
native
,
&
editable
);
if
(
res
!=
OHOS_
IMAGE_RESULT_SUCCESS
)
{
if
(
res
!=
IMAGE_RESULT_SUCCESS
)
{
return
result
;
}
...
...
@@ -269,7 +266,7 @@ napi_value ImagePixelMapNDKTest::IsSupportAlpha(napi_env env, napi_callback_info
int32_t
supportAlpha
=
NUM_0
;
int32_t
res
=
OH_PixelMap_IsSupportAlpha
(
native
,
&
supportAlpha
);
if
(
res
!=
OHOS_
IMAGE_RESULT_SUCCESS
)
{
if
(
res
!=
IMAGE_RESULT_SUCCESS
)
{
return
result
;
}
...
...
@@ -316,7 +313,7 @@ napi_value ImagePixelMapNDKTest::GetDensity(napi_env env, napi_callback_info inf
int32_t
density
=
NUM_0
;
int32_t
res
=
OH_PixelMap_GetDensity
(
native
,
&
density
);
if
(
res
!=
OHOS_
IMAGE_RESULT_SUCCESS
)
{
if
(
res
!=
IMAGE_RESULT_SUCCESS
)
{
return
result
;
}
...
...
@@ -564,9 +561,9 @@ napi_value ImagePixelMapNDKTest::GetImageInfo(napi_env env, napi_callback_info i
return
result
;
}
OhosPixelMapInfo
pixelmapInfo
;
OhosPixelMapInfo
s
pixelmapInfo
;
int32_t
res
=
OH_PixelMap_GetImageInfo
(
native
,
&
pixelmapInfo
);
if
(
res
!=
OHOS_
IMAGE_RESULT_SUCCESS
)
{
if
(
res
!=
IMAGE_RESULT_SUCCESS
)
{
return
result
;
}
napi_create_object
(
env
,
&
result
);
...
...
@@ -589,7 +586,7 @@ napi_value ImagePixelMapNDKTest::AccessPixels(napi_env env, napi_callback_info i
void
*
pixelAddr
=
nullptr
;
int32_t
res
=
OH_PixelMap_AccessPixels
(
native
,
&
pixelAddr
);
if
(
res
!=
OHOS_
IMAGE_RESULT_SUCCESS
||
pixelAddr
==
nullptr
)
{
if
(
res
!=
IMAGE_RESULT_SUCCESS
||
pixelAddr
==
nullptr
)
{
return
result
;
}
napi_create_int32
(
env
,
res
,
&
result
);
...
...
@@ -633,5 +630,3 @@ __attribute__((constructor)) void RegisterModule(void)
napi_module_register
(
&
demoModule
);
}
EXTERN_C_END
}
}
\ No newline at end of file
multimedia/image/image_js_standard/imagePixelMapNDK/entry/src/main/cpp/napi/image_pixel_map_imgndk_test.h
浏览文件 @
587002bd
...
...
@@ -20,10 +20,9 @@
#include <string>
#include "napi/native_api.h"
#include "image_pixel_map_mdk.h"
#include "image_pixel_map_napi.h"
namespace
OHOS
{
namespace
Media
{
class
ImagePixelMapNDKTest
{
public:
static
napi_value
Init
(
napi_env
env
,
napi_value
exports
);
...
...
@@ -47,6 +46,4 @@ public:
static
napi_value
UnAccessPixels
(
napi_env
env
,
napi_callback_info
info
);
private:
};
}
// namespace Media
}
// namespace OHOS
#endif
\ No newline at end of file
multimedia/image/image_js_standard/imageReceiverNDK/entry/src/main/cpp/napi/image_receiver_mdk_test.cpp
浏览文件 @
587002bd
...
...
@@ -88,7 +88,7 @@ napi_value ImageReceiverNDKTest::JsCreateImageReceiver(napi_env env, napi_callba
return
udfVar
;
}
int32_t
res
=
OH_Image_Receiver_CreateImageReceiver
(
env
,
receiverInfo
,
&
receiver
);
if
(
res
!=
OHOS_
IMAGE_RESULT_SUCCESS
||
receiver
==
nullptr
)
{
if
(
res
!=
IMAGE_RESULT_SUCCESS
||
receiver
==
nullptr
)
{
return
udfVar
;
}
return
receiver
;
...
...
@@ -118,7 +118,7 @@ napi_value ImageReceiverNDKTest::JsGetReceivingSurfaceId(napi_env env, napi_call
}
char
buf
[
ID_SIZE
]
=
{
0
};
int32_t
res
=
OH_Image_Receiver_GetReceivingSurfaceId
(
native
,
buf
,
ID_SIZE
);
if
(
res
!=
OHOS_
IMAGE_RESULT_SUCCESS
)
{
if
(
res
!=
IMAGE_RESULT_SUCCESS
)
{
return
result
;
}
HiviewDFX
::
HiLog
::
Debug
(
LABEL
,
"JsGetReceivingSurfaceId IN [%{public}x]"
,
buf
[
0
]);
...
...
@@ -139,7 +139,7 @@ napi_value ImageReceiverNDKTest::JsReadLatestImage(napi_env env, napi_callback_i
}
int32_t
res
=
OH_Image_Receiver_ReadLatestImage
(
native
,
&
result
);
if
(
res
!=
OHOS_
IMAGE_RESULT_SUCCESS
)
{
if
(
res
!=
IMAGE_RESULT_SUCCESS
)
{
napi_get_undefined
(
env
,
&
result
);
return
result
;
}
...
...
@@ -157,7 +157,7 @@ napi_value ImageReceiverNDKTest::JsReadNextImage(napi_env env, napi_callback_inf
}
int32_t
res
=
OH_Image_Receiver_ReadNextImage
(
native
,
&
result
);
if
(
res
!=
OHOS_
IMAGE_RESULT_SUCCESS
)
{
if
(
res
!=
IMAGE_RESULT_SUCCESS
)
{
napi_get_undefined
(
env
,
&
result
);
return
result
;
}
...
...
@@ -228,7 +228,7 @@ napi_value ImageReceiverNDKTest::JsGetSize(napi_env env, napi_callback_info info
}
struct
OhosImageSize
size
;
int32_t
res
=
OH_Image_Receiver_GetSize
(
native
,
&
size
);
if
(
res
!=
OHOS_
IMAGE_RESULT_SUCCESS
)
{
if
(
res
!=
IMAGE_RESULT_SUCCESS
)
{
return
result
;
}
...
...
@@ -249,7 +249,7 @@ napi_value ImageReceiverNDKTest::JsGetCapacity(napi_env env, napi_callback_info
}
int32_t
capacity
;
int32_t
res
=
OH_Image_Receiver_GetCapacity
(
native
,
&
capacity
);
if
(
res
!=
OHOS_
IMAGE_RESULT_SUCCESS
)
{
if
(
res
!=
IMAGE_RESULT_SUCCESS
)
{
return
result
;
}
napi_create_int32
(
env
,
capacity
,
&
result
);
...
...
@@ -267,7 +267,7 @@ napi_value ImageReceiverNDKTest::JsGetFormat(napi_env env, napi_callback_info in
}
int32_t
format
;
int32_t
res
=
OH_Image_Receiver_GetFormat
(
native
,
&
format
);
if
(
res
!=
OHOS_
IMAGE_RESULT_SUCCESS
)
{
if
(
res
!=
IMAGE_RESULT_SUCCESS
)
{
return
result
;
}
napi_create_int32
(
env
,
format
,
&
result
);
...
...
@@ -321,7 +321,7 @@ napi_value ImageReceiverNDKTest::JsImageClipRect(napi_env env, napi_callback_inf
}
struct
OhosImageRect
rect
;
int32_t
res
=
OH_Image_ClipRect
(
native
,
&
rect
);
if
(
res
!=
OHOS_
IMAGE_RESULT_SUCCESS
)
{
if
(
res
!=
IMAGE_RESULT_SUCCESS
)
{
return
result
;
}
...
...
@@ -344,7 +344,7 @@ napi_value ImageReceiverNDKTest::JsImageSize(napi_env env, napi_callback_info in
}
struct
OhosImageSize
size
;
int32_t
res
=
OH_Image_Size
(
native
,
&
size
);
if
(
res
!=
OHOS_
IMAGE_RESULT_SUCCESS
)
{
if
(
res
!=
IMAGE_RESULT_SUCCESS
)
{
return
result
;
}
napi_create_object
(
env
,
&
result
);
...
...
@@ -364,7 +364,7 @@ napi_value ImageReceiverNDKTest::JsImageFormat(napi_env env, napi_callback_info
}
int32_t
format
;
int32_t
res
=
OH_Image_Format
(
native
,
&
format
);
if
(
res
!=
OHOS_
IMAGE_RESULT_SUCCESS
)
{
if
(
res
!=
IMAGE_RESULT_SUCCESS
)
{
return
result
;
}
napi_create_uint32
(
env
,
format
,
&
result
);
...
...
@@ -393,7 +393,7 @@ napi_value ImageReceiverNDKTest::JsImageGetComponent(napi_env env, napi_callback
struct
OhosImageComponent
component
;
int32_t
res
=
OH_Image_GetComponent
(
native
,
componentType
,
&
component
);
if
(
res
!=
OHOS_
IMAGE_RESULT_SUCCESS
)
{
if
(
res
!=
IMAGE_RESULT_SUCCESS
)
{
return
result
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录