Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
d4026a9b
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看板
未验证
提交
d4026a9b
编写于
7月 26, 2022
作者:
O
openharmony_ci
提交者:
Gitee
7月 26, 2022
浏览文件
操作
浏览文件
下载
差异文件
!4589 Image 3.2beta 新增NDK接口用例
Merge pull request !4589 from 秦莉文/OpenHarmony-3.2-Beta2
上级
ce52d14a
febd9184
变更
17
隐藏空白更改
内联
并排
Showing
17 changed file
with
675 addition
and
0 deletion
+675
-0
multimedia/BUILD.gn
multimedia/BUILD.gn
+1
-0
multimedia/image/image_js_standard/image_ndk_test/BUILD.gn
multimedia/image/image_js_standard/image_ndk_test/BUILD.gn
+38
-0
multimedia/image/image_js_standard/image_ndk_test/Test.json
multimedia/image/image_js_standard/image_ndk_test/Test.json
+20
-0
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/config.json
...age_js_standard/image_ndk_test/entry/src/main/config.json
+99
-0
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/cpp/BUILD.gn
...ge_js_standard/image_ndk_test/entry/src/main/cpp/BUILD.gn
+52
-0
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/cpp/napi/imagePixelmap.cpp
.../image_ndk_test/entry/src/main/cpp/napi/imagePixelmap.cpp
+100
-0
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/ets/MainAbility/app.ets
...ard/image_ndk_test/entry/src/main/ets/MainAbility/app.ets
+33
-0
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/ets/MainAbility/pages/index.ets
...e_ndk_test/entry/src/main/ets/MainAbility/pages/index.ets
+37
-0
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/ets/TestAbility/app.ets
...ard/image_ndk_test/entry/src/main/ets/TestAbility/app.ets
+33
-0
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/ets/TestAbility/pages/index.ets
...e_ndk_test/entry/src/main/ets/TestAbility/pages/index.ets
+50
-0
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...st/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+78
-0
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/ets/test/List.test.ets
...dard/image_ndk_test/entry/src/main/ets/test/List.test.ets
+19
-0
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/ets/test/NativeApiTest.ets
.../image_ndk_test/entry/src/main/ets/test/NativeApiTest.ets
+93
-0
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/resources/base/element/string.json
...dk_test/entry/src/main/resources/base/element/string.json
+20
-0
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/resources/base/media/icon.png
...age_ndk_test/entry/src/main/resources/base/media/icon.png
+0
-0
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/resources/rawfile/test/aa.xml
...age_ndk_test/entry/src/main/resources/rawfile/test/aa.xml
+2
-0
multimedia/image/image_js_standard/image_ndk_test/signature/openharmony_sx.p7b
...e_js_standard/image_ndk_test/signature/openharmony_sx.p7b
+0
-0
未找到文件。
multimedia/BUILD.gn
浏览文件 @
d4026a9b
...
...
@@ -29,6 +29,7 @@ group("multimedia") {
"image/image_js_standard/imagePixelMapFramework:image_pixelmapframework_js_hap",
"image/image_js_standard/imageReceiver:image_receiver_js_hap",
"image/image_js_standard/imageWebp:image_webp_js_hap",
"image/image_js_standard/image_ndk_test:image_pixelmap_ndk_hap",
"image/image_js_standard/imageYUV:image_yuv_js_hap",
"media/media_js_standard/audioPlayer:audio_player_js_hap",
"media/media_js_standard/audioRecorder:audio_recorder_js_hap",
...
...
multimedia/image/image_js_standard/image_ndk_test/BUILD.gn
0 → 100644
浏览文件 @
d4026a9b
# 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("//build/ohos.gni")
import("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("image_pixelmap_ndk_hap") {
hap_profile = "./entry/src/main/config.json"
deps = [
":pixelmap_ets_assets",
":pixelmap_ets_resources",
":pixelmap_ets_test_assets",
]
ets2abc = true
certificate_profile = "./signature/openharmony_sx.p7b"
hap_name = "ActsPixelMapNapiEtsTest"
shared_libraries = [ "./entry/src/main/cpp:imagePixelmap" ]
}
ohos_js_assets("pixelmap_ets_assets") {
source_dir = "./entry/src/main/ets/MainAbility"
}
ohos_js_assets("pixelmap_ets_test_assets") {
source_dir = "./entry/src/main/ets/TestAbility"
}
ohos_resources("pixelmap_ets_resources") {
sources = [ "./entry/src/main/resources" ]
hap_profile = "./entry/src/main/config.json"
}
multimedia/image/image_js_standard/image_ndk_test/Test.json
0 → 100644
浏览文件 @
d4026a9b
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"600000"
,
"bundle-name"
:
"ohos.image.napitest"
,
"package-name"
:
"ohos.image.napitest"
,
"shell-timeout"
:
"600000"
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsPixelMapNapiEtsTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
}
]
}
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/config.json
0 → 100644
浏览文件 @
d4026a9b
{
"app"
:
{
"bundleName"
:
"ohos.image.napitest"
,
"vendor"
:
"open"
,
"version"
:
{
"code"
:
1000000
,
"name"
:
"1.0.0"
},
"apiVersion"
:
{
"compatible"
:
7
,
"releaseType"
:
"Release"
,
"target"
:
8
}
},
"deviceConfig"
:
{},
"module"
:
{
"package"
:
"ohos.image.napitest"
,
"name"
:
".MyApplication"
,
"mainAbility"
:
"ohos.image.napitest.MainAbility"
,
"deviceType"
:
[
"phone"
],
"distro"
:
{
"deliveryWithInstall"
:
true
,
"moduleName"
:
"entry"
,
"moduleType"
:
"entry"
,
"installationFree"
:
false
},
"abilities"
:
[
{
"skills"
:
[
{
"entities"
:
[
"entity.system.home"
],
"actions"
:
[
"action.system.home"
]
}
],
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"MainAbility"
,
"name"
:
".MainAbility"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:description_mainability"
,
"formsEnabled"
:
false
,
"label"
:
"$string:entry_MainAbility"
,
"type"
:
"page"
,
"launchType"
:
"standard"
},
{
"orientation"
:
"unspecified"
,
"visible"
:
true
,
"srcPath"
:
"TestAbility"
,
"name"
:
".TestAbility"
,
"srcLanguage"
:
"ets"
,
"icon"
:
"$media:icon"
,
"description"
:
"$string:TestAbility_desc"
,
"formsEnabled"
:
false
,
"label"
:
"$string:TestAbility_label"
,
"type"
:
"page"
,
"launchType"
:
"standard"
}
],
"js"
:
[
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
],
"name"
:
".MainAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
},
{
"mode"
:
{
"syntax"
:
"ets"
,
"type"
:
"pageAbility"
},
"pages"
:
[
"pages/index"
],
"name"
:
".TestAbility"
,
"window"
:
{
"designWidth"
:
720
,
"autoDesignWidth"
:
false
}
}
]
}
}
\ No newline at end of file
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/cpp/BUILD.gn
0 → 100644
浏览文件 @
d4026a9b
# 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("//build/config/ohos/config.gni")
import("//build/ohos.gni")
import("//foundation/arkui/napi/napi.gni")
config("config") {
visibility = [ ":*" ]
cflags = [
"-Wall",
"-Werror",
"-g3",
"-Wunused-variable",
]
}
config("public_config") {
}
ohos_shared_library("imagePixelmap") {
sources = [ "./napi/imagePixelmap.cpp" ]
if (!(product_name == "m40")) {
if (target_cpu == "arm") {
libs = [ "${clang_base_path}/../libcxx-ndk/lib/arm-linux-ohos/c++/libc++_shared.so" ]
} else if (target_cpu == "arm64") {
libs = [ "${clang_base_path}/../libcxx-ndk/lib/aarch64-linux-ohos/c++/libc++_shared.so" ]
} else {
libs = []
}
}
include_dirs = [ "//test/xts/acts/multimedia/image/image_js_standard/image_ndk_test/entry/src/main/cpp" ]
configs = [ ":config" ]
deps = [
"//foundation/arkui/napi:ace_napi",
"//foundation/multimedia/image_standard/frameworks/kits/js/common/pixelmap_ndk:pixelmap_ndk",
]
output_extension = "so"
}
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/cpp/napi/imagePixelmap.cpp
0 → 100644
浏览文件 @
d4026a9b
/*
* 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.
*/
#include "napi/native_api.h"
#include "image_pixel_map_napi.h"
constexpr
int
TEST_ARG_SUM
=
1
;
static
napi_value
TestGetImageInfo
(
napi_env
env
,
napi_callback_info
info
)
{
napi_value
result
=
nullptr
;
napi_get_undefined
(
env
,
&
result
);
napi_value
thisVar
=
nullptr
;
napi_value
argValue
[
TEST_ARG_SUM
]
=
{
0
};
size_t
argCount
=
TEST_ARG_SUM
;
napi_get_cb_info
(
env
,
info
,
&
argCount
,
argValue
,
&
thisVar
,
nullptr
);
OHOS
::
Media
::
OhosPixelMapInfo
pixelMapInfo
;
OHOS
::
Media
::
OH_GetImageInfo
(
env
,
argValue
[
0
],
&
pixelMapInfo
);
return
result
;
}
static
napi_value
TestAccessPixels
(
napi_env
env
,
napi_callback_info
info
)
{
napi_value
result
=
nullptr
;
napi_get_undefined
(
env
,
&
result
);
napi_value
thisVar
=
nullptr
;
napi_value
argValue
[
TEST_ARG_SUM
]
=
{
0
};
size_t
argCount
=
TEST_ARG_SUM
;
napi_get_cb_info
(
env
,
info
,
&
argCount
,
argValue
,
&
thisVar
,
nullptr
);
void
*
addrPtr
=
nullptr
;
OHOS
::
Media
::
OH_AccessPixels
(
env
,
argValue
[
0
],
&
addrPtr
);
return
result
;
}
static
napi_value
TestUnAccessPixels
(
napi_env
env
,
napi_callback_info
info
)
{
napi_value
result
=
nullptr
;
napi_get_undefined
(
env
,
&
result
);
napi_value
thisVar
=
nullptr
;
napi_value
argValue
[
TEST_ARG_SUM
]
=
{
0
};
size_t
argCount
=
TEST_ARG_SUM
;
napi_get_cb_info
(
env
,
info
,
&
argCount
,
argValue
,
&
thisVar
,
nullptr
);
OHOS
::
Media
::
OH_UnAccessPixels
(
env
,
argValue
[
0
]);
return
result
;
}
EXTERN_C_START
static
napi_value
Init
(
napi_env
env
,
napi_value
exports
)
{
napi_property_descriptor
desc
[]
=
{
{
"testGetImageInfo"
,
nullptr
,
TestGetImageInfo
,
nullptr
,
nullptr
,
nullptr
,
napi_default
,
nullptr
},
{
"testAccessPixels"
,
nullptr
,
TestAccessPixels
,
nullptr
,
nullptr
,
nullptr
,
napi_default
,
nullptr
},
{
"testUnAccessPixels"
,
nullptr
,
TestUnAccessPixels
,
nullptr
,
nullptr
,
nullptr
,
napi_default
,
nullptr
},
};
napi_define_properties
(
env
,
exports
,
sizeof
(
desc
)
/
sizeof
(
desc
[
0
]),
desc
);
return
exports
;
}
EXTERN_C_END
/*
* module define
*/
static
napi_module
g_module
=
{
.
nm_version
=
1
,
.
nm_flags
=
0
,
.
nm_filename
=
nullptr
,
.
nm_register_func
=
Init
,
.
nm_modname
=
"imagePixelmap"
,
.
nm_priv
=
((
void
*
)
0
),
.
reserved
=
{
0
}
};
/*
* module register
*/
extern
"C"
__attribute__
((
constructor
))
void
MyPixelMapRegisterModule
(
void
)
{
napi_module_register
(
&
g_module
);
}
\ No newline at end of file
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/ets/MainAbility/app.ets
0 → 100644
浏览文件 @
d4026a9b
// @ts-nocheck
/**
* 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('Application onCreate')
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info('Application onDestroy')
},
}
\ No newline at end of file
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/ets/MainAbility/pages/index.ets
0 → 100644
浏览文件 @
d4026a9b
// @ts-nocheck
/**
* 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.
*/
@Entry
@Component
struct MyComponent {
aboutToAppear() {
}
build() {
Flex({
direction: FlexDirection.Column,
alignItems: ItemAlign.Center,
justifyContent: FlexAlign.Center
}) {
Text('IMAGE ETS TEST')
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
.height('100%')
}
}
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/ets/TestAbility/app.ets
0 → 100644
浏览文件 @
d4026a9b
// @ts-nocheck
/**
* 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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from 'hypium/index'
import testsuite from '../test/List.test'
export default {
onCreate() {
console.info('Application onCreate')
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
},
onDestroy() {
console.info('Application onDestroy')
},
}
\ No newline at end of file
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/ets/TestAbility/pages/index.ets
0 → 100644
浏览文件 @
d4026a9b
// @ts-nocheck
/**
* 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 router from '@system.router';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('TestAbility index aboutToAppear')
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
0 → 100644
浏览文件 @
d4026a9b
// @ts-nocheck
/**
* 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
TestRunner
from
'
@ohos.application.testRunner
'
import
AbilityDelegatorRegistry
from
'
@ohos.application.abilityDelegatorRegistry
'
var
abilityDelegator
=
undefined
var
abilityDelegatorArguments
=
undefined
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
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
+=
'
'
+
key
+
'
'
+
parameters
[
key
]
}
}
return
targetParams
.
trim
()
}
async
function
onAbilityCreateCallback
()
{
console
.
log
(
'
onAbilityCreateCallback
'
);
}
async
function
addAbilityMonitorCallback
(
err
:
any
)
{
console
.
info
(
'
addAbilityMonitorCallback :
'
+
JSON
.
stringify
(
err
))
}
export
default
class
OpenHarmonyTestRunner
implements
TestRunner
{
constructor
()
{
}
onPrepare
()
{
console
.
info
(
'
OpenHarmonyTestRunner OnPrepare
'
)
}
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
var
testAbilityName
=
abilityDelegatorArguments
.
parameters
[
'
-p
'
]
+
'
.MainAbility
'
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a
'
+
testAbilityName
+
'
-b
'
+
abilityDelegatorArguments
.
bundleName
cmd
+=
'
'
+
translateParamsToString
(
abilityDelegatorArguments
.
parameters
)
console
.
info
(
'
cmd :
'
+
cmd
)
abilityDelegator
.
executeShellCommand
(
cmd
,
(
err
:
any
,
d
:
any
)
=>
{
console
.
info
(
'
executeShellCommand : err :
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
stdResult
);
console
.
info
(
'
executeShellCommand : data :
'
+
d
.
exitCode
);
})
console
.
info
(
'
OpenHarmonyTestRunner onRun call abilityDelegator.getAppContext
'
)
var
context
=
abilityDelegator
.
getAppContext
()
console
.
info
(
'
getAppContext :
'
+
JSON
.
stringify
(
context
))
console
.
info
(
'
OpenHarmonyTestRunner onRun end
'
)
}
};
\ No newline at end of file
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/ets/test/List.test.ets
0 → 100644
浏览文件 @
d4026a9b
/*
* 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 napiTest from './NativeApiTest'
export default function testsuite() {
napiTest()
}
\ No newline at end of file
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/ets/test/NativeApiTest.ets
0 → 100644
浏览文件 @
d4026a9b
/*
* 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.
*/
// @ts-nocheck
import image from '@ohos.multimedia.image'
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium/index'
import mypixelmap from "libimagePixelmap.so"
export default function nativeApiImageJsunit() {
describe('napiTest', function () {
beforeAll(function () {
console.info('beforeAll case');
})
beforeEach(function () {
isTimeOut = false;
console.info('beforeEach case');
})
afterEach(function () {
console.info('afterEach case');
})
afterAll(function () {
console.info('afterAll case');
})
/* *
* @tc.number : TC_001
* @tc.name : Test OH_GetImageInfo, OH_AccessPixels, OH_UnAccessPixels
* @tc.desc :
* @tc.size :
* @tc.type : Functional
* @tc.level : FWK Layer
*/
it('TC_001', 0, async function (done) {
const color = new ArrayBuffer(96);
let opts = { alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: { height: 4, width: 6 } }
image.createPixelMap(color, opts)
.then( pixelmap => {
if (pixelmap == null) {
console.info('TC_001 createPixelMap failed');
expect(false).assertTrue()
done();
return;
}
console.info('TC_001 test |begin');
console.info('TC_001 test |GetImageInfo');
mypixelmap.testGetImageInfo(pixelmap);
console.info('TC_001 test |AccessPixels');
mypixelmap.testAccessPixels(pixelmap);
console.info('TC_001 test |release begin');
pixelmap.release();
console.info('TC_001 test |release end');
console.info('TC_001 test |UnAccessPixels');
mypixelmap.testUnAccessPixels(pixelmap);
console.info('TC_001 test |release again begin');
pixelmap.release();
console.info('TC_001 test |release again end');
expect(true).assertTrue();
done();
console.info('TC_001 test |end');
})
.catch(error => {
console.log('TC_001 error: ' + error);
expect().assertFail();
done();
})
})
})
}
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/resources/base/element/string.json
0 → 100644
浏览文件 @
d4026a9b
{
"string"
:
[
{
"name"
:
"entry_MainAbility"
,
"value"
:
"entry_MainAbility"
},
{
"name"
:
"description_mainability"
,
"value"
:
"ETS_Empty Ability"
},
{
"name"
:
"TestAbility_desc"
,
"value"
:
"description"
},
{
"name"
:
"TestAbility_label"
,
"value"
:
"label"
}
]
}
\ No newline at end of file
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/resources/base/media/icon.png
0 → 100644
浏览文件 @
d4026a9b
6.6 KB
multimedia/image/image_js_standard/image_ndk_test/entry/src/main/resources/rawfile/test/aa.xml
0 → 100644
浏览文件 @
d4026a9b
<!--test/aa.xml dcaea123-->
<!--ggg-->
multimedia/image/image_js_standard/image_ndk_test/signature/openharmony_sx.p7b
0 → 100644
浏览文件 @
d4026a9b
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录