Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
2571a676
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看板
提交
2571a676
编写于
12月 10, 2022
作者:
C
chengxingzhen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xts签名文件整改
Signed-off-by:
N
chengxingzhen
<
chengxingzhen@huawei.com
>
上级
e469f5f4
变更
25
隐藏空白更改
内联
并排
Showing
25 changed file
with
3 addition
and
1010 deletion
+3
-1010
ability/ability_runtime/BUILD.gn
ability/ability_runtime/BUILD.gn
+0
-2
ability/ability_runtime/actscalltest/BUILD.gn
ability/ability_runtime/actscalltest/BUILD.gn
+0
-23
ability/ability_runtime/actscalltest/systemcallentrytest/AppScope/app.json
...untime/actscalltest/systemcallentrytest/AppScope/app.json
+0
-21
ability/ability_runtime/actscalltest/systemcallentrytest/AppScope/resources/base/element/string.json
...callentrytest/AppScope/resources/base/element/string.json
+0
-8
ability/ability_runtime/actscalltest/systemcallentrytest/AppScope/resources/base/media/app_icon.png
...mcallentrytest/AppScope/resources/base/media/app_icon.png
+0
-0
ability/ability_runtime/actscalltest/systemcallentrytest/BUILD.gn
...ability_runtime/actscalltest/systemcallentrytest/BUILD.gn
+0
-43
ability/ability_runtime/actscalltest/systemcallentrytest/Test.json
...bility_runtime/actscalltest/systemcallentrytest/Test.json
+0
-26
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/Application/AbilityStage.ts
...lentrytest/entry/src/main/ets/Application/AbilityStage.ts
+0
-23
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/MainAbility/MainAbility.ts
...llentrytest/entry/src/main/ets/MainAbility/MainAbility.ts
+0
-91
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/MainAbility/pages/index/index.ets
...test/entry/src/main/ets/MainAbility/pages/index/index.ets
+0
-55
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/MainAbility/pages/second/second.ets
...st/entry/src/main/ets/MainAbility/pages/second/second.ets
+0
-27
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/TestAbility/TestAbility.ts
...llentrytest/entry/src/main/ets/TestAbility/TestAbility.ts
+0
-44
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/TestAbility/pages/index.ets
...lentrytest/entry/src/main/ets/TestAbility/pages/index.ets
+0
-48
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
...st/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
+0
-72
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets
...temcallentrytest/entry/src/main/ets/test/Ability.test.ets
+0
-303
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/List.test.ets
...systemcallentrytest/entry/src/main/ets/test/List.test.ets
+0
-22
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/module.json
...tscalltest/systemcallentrytest/entry/src/main/module.json
+0
-39
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/resources/base/element/string.json
...trytest/entry/src/main/resources/base/element/string.json
+0
-32
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/resources/base/media/icon.png
...allentrytest/entry/src/main/resources/base/media/icon.png
+0
-0
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/resources/base/profile/main_pages.json
...est/entry/src/main/resources/base/profile/main_pages.json
+0
-6
ability/ability_runtime/actscalltest/systemcallentrytest/signature/openharmony_sx.p7b
...calltest/systemcallentrytest/signature/openharmony_sx.p7b
+0
-0
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
...ptest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
+0
-64
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
...rhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
+0
-51
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/module.json
...ntime/apicover/apicoverhaptest/entry/src/main/module.json
+0
-8
ability/ability_runtime/apicover/stagesupplement/entry/src/main/ets/MainAbility3/MainAbility3.ts
...upplement/entry/src/main/ets/MainAbility3/MainAbility3.ts
+3
-2
未找到文件。
ability/ability_runtime/BUILD.gn
浏览文件 @
2571a676
...
...
@@ -26,8 +26,6 @@ group("ability_runtime") {
"actsabilitymanageretstest:ActsAbilityManagerEtsTest",
"actsabilityusertest:ActsAbilityuserTest",
"actscalldataabilitytest:ActsCallDataAbilityTest",
"actscalldataabilitytest:ActsCallDataAbilityTest",
"actscalltest:actscalltest",
"actsdataabilityaccessdatasharetest:dataabilityaccessdatashare",
"actsfwkdataaccessortest:dataability",
"actsqueryfunctiontest:actsqueryfunctiontest",
...
...
ability/ability_runtime/actscalltest/BUILD.gn
已删除
100644 → 0
浏览文件 @
e469f5f4
# 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("//test/xts/tools/build/suite.gni")
group("actscalltest") {
testonly = true
if (is_standard_system) {
deps = [
"systemcallentrytest:ActsCallTestEntryTest",
]
}
}
ability/ability_runtime/actscalltest/systemcallentrytest/AppScope/app.json
已删除
100644 → 0
浏览文件 @
e469f5f4
{
"app"
:{
"bundleName"
:
"com.example.systemcalltest"
,
"vendor"
:
"huawei"
,
"versionCode"
:
1000000
,
"versionName"
:
"1.0.0"
,
"debug"
:
false
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:app_name"
,
"description"
:
"$string:description_application"
,
"distributedNotificationEnabled"
:
true
,
"keepAlive"
:
true
,
"singleUser"
:
true
,
"minAPIVersion"
:
8
,
"targetAPIVersion"
:
8
,
"car"
:{
"apiCompatibleVersion"
:
8
,
"singleUser"
:
false
}
}
}
ability/ability_runtime/actscalltest/systemcallentrytest/AppScope/resources/base/element/string.json
已删除
100644 → 0
浏览文件 @
e469f5f4
{
"string"
:[
{
"name"
:
"app_name"
,
"value"
:
"ohosProject"
}
]
}
\ No newline at end of file
ability/ability_runtime/actscalltest/systemcallentrytest/AppScope/resources/base/media/app_icon.png
已删除
100644 → 0
浏览文件 @
e469f5f4
15.1 KB
ability/ability_runtime/actscalltest/systemcallentrytest/BUILD.gn
已删除
100644 → 0
浏览文件 @
e469f5f4
# 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("//test/xts/tools/build/suite.gni")
ohos_js_hap_suite("ActsCallTestEntryTest") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":systemcallentrytest_js_assets",
":systemcallentrytest_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsCallTestEntryTest"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("systemcallentrytest_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("systemcallentrytest_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("systemcallentrytest_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":systemcallentrytest_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
ability/ability_runtime/actscalltest/systemcallentrytest/Test.json
已删除
100644 → 0
浏览文件 @
e469f5f4
{
"description"
:
"Configuration for hjunit demo Tests"
,
"driver"
:
{
"type"
:
"OHJSUnitTest"
,
"test-timeout"
:
"300000"
,
"bundle-name"
:
"com.example.systemcalltest"
,
"module-name"
:
"com.example.systemcalltest"
,
"shell-timeout"
:
"600000"
,
"testcase-timeout"
:
70000
},
"kits"
:
[
{
"test-file-name"
:
[
"ActsCallTestEntryTest.hap"
],
"type"
:
"AppInstallKit"
,
"cleanup-apps"
:
true
},
{
"type"
:
"ShellKit"
,
"run-command"
:
[
"remount"
]
}
]
}
\ No newline at end of file
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/Application/AbilityStage.ts
已删除
100644 → 0
浏览文件 @
e469f5f4
/*
* 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
AbilityStage
from
"
@ohos.application.AbilityStage
"
var
onAcceptWantCalledSeq
;
export
default
class
MyAbilityStage
extends
AbilityStage
{
onCreate
()
{
console
.
log
(
"
SystemCallTest MyAbilityStage onCreate
"
)
}
}
\ No newline at end of file
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/MainAbility/MainAbility.ts
已删除
100644 → 0
浏览文件 @
e469f5f4
/*
* 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
Ability
from
'
@ohos.application.Ability
'
class
MySequenceable
{
num
:
number
=
0
;
str
:
String
=
""
;
result
:
String
=
""
;
constructor
(
num
,
string
,
result
)
{
this
.
num
=
num
;
this
.
str
=
string
;
this
.
result
=
result
;
}
setMySequence
(
num
,
string
,
result
)
{
this
.
num
=
num
;
this
.
str
=
string
;
this
.
result
=
result
;
}
marshalling
(
messageParcel
)
{
messageParcel
.
writeInt
(
this
.
num
);
messageParcel
.
writeString
(
this
.
str
);
messageParcel
.
writeString
(
this
.
result
);
return
true
;
}
unmarshalling
(
messageParcel
)
{
this
.
num
=
messageParcel
.
readInt
();
this
.
str
=
messageParcel
.
readString
();
this
.
result
=
messageParcel
.
readString
();
return
true
;
}
}
export
default
class
MainAbility
extends
Ability
{
test2100
(
data
)
{
console
.
log
(
"
SystemCallTest MainAbility test2100 begin
"
);
let
recvData
=
new
MySequenceable
(
0
,
''
,
''
);
data
.
readSequenceable
(
recvData
);
return
new
MySequenceable
(
recvData
.
num
+
1
,
recvData
.
str
+
"
Main
"
,
recvData
.
result
);
}
onCreate
(
want
,
launchParam
)
{
// Ability is creating, initialize resources for this ability
console
.
log
(
"
SystemCallTest MainAbility onCreate
"
)
globalThis
.
abilityWant
=
want
;
globalThis
.
callee
=
this
.
callee
;
this
.
callee
.
on
(
'
test2100
'
,
this
.
test2100
);
}
onDestroy
()
{
// Ability is destroying, release resources for this ability
console
.
log
(
"
SystemCallTest MainAbility onDestroy
"
)
}
onWindowStageCreate
(
windowStage
)
{
// Main window is created, set main page for this ability
console
.
log
(
"
SystemCallTest MainAbility onWindowStageCreate
"
)
globalThis
.
abilityContext
=
this
.
context
windowStage
.
setUIContent
(
this
.
context
,
"
MainAbility/pages/index/index
"
,
null
)
}
onWindowStageDestroy
()
{
// Main window is destroyed, release UI related resources
console
.
log
(
"
SystemCallTest MainAbility onWindowStageDestroy
"
)
}
onForeground
()
{
// Ability has brought to foreground
console
.
log
(
"
SystemCallTest MainAbility onForeground
"
)
}
onBackground
()
{
// Ability has back to background
console
.
log
(
"
SystemCallTest MainAbility onBackground
"
)
}
};
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/MainAbility/pages/index/index.ets
已删除
100644 → 0
浏览文件 @
e469f5f4
/*
* 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'
@Entry
@Component
struct Index {
aboutToAppear(){
console.info("start run testcase!!!!")
var abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
var abilityDelegatorArguments: any
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
console.info('start run testcase!!!')
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
build() {
Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Hello World')
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(25)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
})
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/MainAbility/pages/second/second.ets
已删除
100644 → 0
浏览文件 @
e469f5f4
/*
* 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.
*/
@Entry
@Component
struct Index {
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('SystemCallTest SecondAbility)')
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
.height('100%')
}
}
\ No newline at end of file
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/TestAbility/TestAbility.ts
已删除
100644 → 0
浏览文件 @
e469f5f4
/*
* 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
Ability
from
'
@ohos.application.Ability
'
export
default
class
TestAbility
extends
Ability
{
onCreate
(
want
,
launchParam
)
{
console
.
log
(
'
TestAbility onCreate
'
)
}
onDestroy
()
{
console
.
log
(
'
TestAbility onDestroy
'
)
}
onWindowStageCreate
(
windowStage
)
{
console
.
log
(
'
TestAbility onWindowStageCreate
'
)
windowStage
.
setUIContent
(
this
.
context
,
'
TestAbility/pages/index
'
,
null
)
globalThis
.
abilityContext
=
this
.
context
;
}
onWindowStageDestroy
()
{
console
.
log
(
'
TestAbility onWindowStageDestroy
'
)
}
onForeground
()
{
console
.
log
(
'
TestAbility onForeground
'
)
}
onBackground
()
{
console
.
log
(
'
TestAbility onBackground
'
)
}
};
\ No newline at end of file
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/TestAbility/pages/index.ets
已删除
100644 → 0
浏览文件 @
e469f5f4
/*
* 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 router from '@ohos.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
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts
已删除
100644 → 0
浏览文件 @
e469f5f4
/*
* 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
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 it
'
,
'
-s level
'
,
'
-s testType
'
,
'
-s size
'
,
'
-s timeout
'
])
let
targetParams
=
''
;
for
(
const
key
in
parameters
)
{
if
(
keySet
.
has
(
key
))
{
targetParams
=
`
${
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
"
)
}
async
onRun
()
{
console
.
log
(
'
OpenHarmonyTestRunner onRun run
'
)
abilityDelegatorArguments
=
AbilityDelegatorRegistry
.
getArguments
()
abilityDelegator
=
AbilityDelegatorRegistry
.
getAbilityDelegator
()
var
testAbilityName
=
abilityDelegatorArguments
.
bundleName
+
'
.MainAbility
'
let
lMonitor
=
{
abilityName
:
testAbilityName
,
onAbilityCreate
:
onAbilityCreateCallback
,
};
abilityDelegator
.
addAbilityMonitor
(
lMonitor
,
addAbilityMonitorCallback
)
var
cmd
=
'
aa start -d 0 -a com.example.systemcalltest.MainAbility
'
+
'
-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 end
'
)
}
};
\ No newline at end of file
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets
已删除
100644 → 0
浏览文件 @
e469f5f4
/*
* 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 { describe, it, expect } from "@ohos/hypium"
const ERROR_CODE_INVALID_PARAM = 401;
const ERROR_CODE_FUNC_REGISTERED = 16200004;
const ERROR_CODE_FUNC_NOT_EXIST = 16200005;
export default function abilityTest() {
describe('ActsAbilityTest', function () {
/**
* @tc.number: ACTS_CommonComponent_Call_3100
* @tc.name: The parameter method of the Callee.on function is an empty string.
* @tc.desc: Verify that the parameter method of the Callee.on function is an empty string.
*/
it('ACTS_CommonComponent_Call_3100', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_3100 begin');
function onTest(data) {
console.log('ACTS_CommonComponent_Call_3100 onTest');
}
let finishFlag = 0;
try {
globalThis.callee.on('', onTest);
} catch (err) {
console.log('ACTS_CommonComponent_Call_3100 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INVALID_PARAM);
finishFlag = 1;
}
expect(finishFlag).assertEqual(1);
done();
})
/**
* @tc.number: ACTS_CommonComponent_Call_3200
* @tc.name: The parameter method of the Callee.on function is null.
* @tc.desc: Verify that the parameter method of the Callee.on function is null.
*/
it('ACTS_CommonComponent_Call_3200', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_3200 begin');
function onTest(data) {
console.log('ACTS_CommonComponent_Call_3200 onTest');
}
let finishFlag = 0;
try {
globalThis.callee.on(null, onTest);
} catch (err) {
console.log('ACTS_CommonComponent_Call_3200 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INVALID_PARAM);
finishFlag = 1;
}
expect(finishFlag).assertEqual(1);
done();
})
/**
* @tc.number: ACTS_CommonComponent_Call_3300
* @tc.name: The parameter method of the Caller.callWithResult function is undefined.
* @tc.desc: Verify that the parameter method of the Caller.callWithResult function is undefined.
*/
it('ACTS_CommonComponent_Call_3300', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_3300 begin');
function onTest(data) {
console.log('ACTS_CommonComponent_Call_3300 onTest');
}
let finishFlag = 0;
try {
globalThis.callee.on(undefined, onTest);
} catch (err) {
console.log('ACTS_CommonComponent_Call_3300 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INVALID_PARAM);
finishFlag = 1;
}
expect(finishFlag).assertEqual(1);
done();
})
/**
* @tc.number: ACTS_CommonComponent_Call_3400
* @tc.name: The parameter "method" of the Callee.off function is an empty string.
* @tc.desc: Verify that the parameter "method" of the Callee.off function is an empty string.
*/
it('ACTS_CommonComponent_Call_3400', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_3400 begin');
let finishFlag = 0;
try {
globalThis.callee.off('');
} catch (err) {
console.log('ACTS_CommonComponent_Call_3400 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INVALID_PARAM);
finishFlag = 1;
}
expect(finishFlag).assertEqual(1);
done();
})
/**
* @tc.number: ACTS_CommonComponent_Call_3500
* @tc.name: The parameter "method" of the Callee.off function is null.
* @tc.desc: Verify that the parameter "method" of the Callee.off function is null.
*/
it('ACTS_CommonComponent_Call_3500', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_3500 begin');
let finishFlag = 0;
try {
globalThis.callee.off(null);
} catch (err) {
console.log('ACTS_CommonComponent_Call_3500 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INVALID_PARAM);
finishFlag = 1;
}
expect(finishFlag).assertEqual(1);
done();
})
/**
* @tc.number: ACTS_CommonComponent_Call_3600
* @tc.name: The parameter “method” of the Callee.off function is undefined.
* @tc.desc: Verify that the parameter “method” of the Callee.off function is undefined.
*/
it('ACTS_CommonComponent_Call_3600', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_3600 begin');
let finishFlag = 0;
try {
globalThis.callee.off(undefined);
} catch (err) {
console.log('ACTS_CommonComponent_Call_3600 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INVALID_PARAM);
finishFlag = 1;
}
expect(finishFlag).assertEqual(1);
done();
})
/*
* @tc.number: ACTS_CommonComponent_Call_4300
* @tc.name: Connects a service ability, which is used to start a cloned page ability.
* @tc.desc: Check the event data of executor page ability publishes
*/
it('ACTS_CommonComponent_Call_4300', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_4300 begin');
let finishFlag = 0;
try {
globalThis.callee.on('testCall', "");
} catch (err) {
console.log('ACTS_CommonComponent_Call_4300 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INVALID_PARAM);
finishFlag = 1;
}
expect(finishFlag).assertEqual(1);
done();
})
/*
* @tc.number: ACTS_CommonComponent_Call_4400
* @tc.name: Connects a service ability, which is used to start a cloned page ability.
* @tc.desc: Check the event data of executor page ability publishes
*/
it('ACTS_CommonComponent_Call_4400', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_4400 begin');
let finishFlag = 0;
try {
globalThis.callee.on('testCall', null);
} catch (err) {
console.log('ACTS_CommonComponent_Call_4400 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INVALID_PARAM);
finishFlag = 1;
}
expect(finishFlag).assertEqual(1);
done();
})
/*
* @tc.number: ACTS_CommonComponent_Call_4500
* @tc.name: Connects a service ability, which is used to start a cloned page ability.
* @tc.desc: Check the event data of executor page ability publishes
*/
it('ACTS_CommonComponent_Call_4500', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_4500 begin');
let finishFlag = 0;
try {
globalThis.callee.on('testCall', undefined);
} catch (err) {
console.log('ACTS_CommonComponent_Call_4500 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_INVALID_PARAM);
finishFlag = 1;
}
expect(finishFlag).assertEqual(1);
done();
})
/*
* @tc.number: ACTS_CommonComponent_Call_5000
* @tc.name: Connects a service ability, which is used to start a cloned page ability.
* @tc.desc: Check the event data of executor page ability publishes
*/
it('ACTS_CommonComponent_Call_5000', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_5000 begin');
let finishFlag = 0;
function testCallback_5100() {
console.log('ACTS_CommonComponent_Call_5000 testCallback');
}
try {
globalThis.callee.on('ACTS_CommonComponent_Call_5000', testCallback_5100);
} catch (err) {
console.log('ACTS_CommonComponent_Call_5000 call err' + err);
expect().assertFail();
globalThis.callee.off('ACTS_CommonComponent_Call_5000');
done();
}
try {
globalThis.callee.on('ACTS_CommonComponent_Call_5000', testCallback_5100);
} catch (err) {
console.log('ACTS_CommonComponent_Call_5000 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_FUNC_REGISTERED);
finishFlag = 1;
}
expect(finishFlag).assertEqual(1);
globalThis.callee.off('ACTS_CommonComponent_Call_5000');
console.log('ACTS_CommonComponent_Call_5000 finished');
done();
})
/*
* @tc.number: ACTS_CommonComponent_Call_5100
* @tc.name: Connects a service ability, which is used to start a cloned page ability.
* @tc.desc: Check the event data of executor page ability publishes
*/
it('ACTS_CommonComponent_Call_5100', 0, async function (done) {
console.log('ACTS_CommonComponent_Call_5100 begin');
let finishFlag = 0;
function testCallback_5100() {
console.log('ACTS_CommonComponent_Call_5100 testCallback');
}
try {
globalThis.callee.on('ACTS_CommonComponent_Call_5100', testCallback_5100);
globalThis.callee.off('ACTS_CommonComponent_Call_5100');
} catch (err) {
console.log('ACTS_CommonComponent_Call_5100 first step err' + err);
expect().assertFail();
globalThis.callee.off('ACTS_CommonComponent_Call_5100');
done();
}
try {
globalThis.callee.off('ACTS_CommonComponent_Call_5100');
} catch (err) {
console.log('ACTS_CommonComponent_Call_5100 call err.code: ' + JSON.stringify(err.code) +
' err.msg: ' + JSON.stringify(err.message));
expect(err.code).assertEqual(ERROR_CODE_FUNC_NOT_EXIST);
finishFlag = 1;
}
expect(finishFlag).assertEqual(1);
console.log('ACTS_CommonComponent_Call_5100 finished');
done();
})
})
}
\ No newline at end of file
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/List.test.ets
已删除
100644 → 0
浏览文件 @
e469f5f4
/*
* 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 abilityTest from './Ability.test.ets'
export default function testsuite() {
abilityTest()
}
\ No newline at end of file
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/module.json
已删除
100644 → 0
浏览文件 @
e469f5f4
{
"module"
:
{
"name"
:
"com.example.systemcalltest"
,
"type"
:
"entry"
,
"srcEntrance"
:
"./ets/Application/AbilityStage.ts"
,
"description"
:
"$string:phone_entry_dsc"
,
"mainElement"
:
"MainAbility"
,
"deviceTypes"
:
[
"default"
,
"tablet"
],
"deliveryWithInstall"
:
true
,
"installationFree"
:
false
,
"uiSyntax"
:
"ets"
,
"pages"
:
"$profile:main_pages"
,
"abilities"
:
[
{
"name"
:
"com.example.systemcalltest.MainAbility"
,
"srcEntrance"
:
"./ets/MainAbility/MainAbility.ts"
,
"description"
:
"$string:phone_entry_main"
,
"icon"
:
"$media:icon"
,
"label"
:
"$string:entry_label"
,
"visible"
:
true
,
"orientation"
:
"portrait"
,
"launchType"
:
"singleton"
,
"skills"
:
[
{
"actions"
:
[
"action.system.home"
],
"entities"
:[
"entity.system.home"
]
}
]
}
]
}
}
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/resources/base/element/string.json
已删除
100644 → 0
浏览文件 @
e469f5f4
{
"string"
:
[
{
"name"
:
"phone_entry_dsc"
,
"value"
:
"i am an entry for phone"
},
{
"name"
:
"phone_entry_main"
,
"value"
:
"the phone entry ability"
},
{
"name"
:
"entry_label"
,
"value"
:
"ActsContextTest"
},
{
"name"
:
"form_description"
,
"value"
:
"my form"
},
{
"name"
:
"serviceability_description"
,
"value"
:
"my whether"
},
{
"name"
:
"description_application"
,
"value"
:
"demo for test"
},
{
"name"
:
"app_name"
,
"value"
:
"Demo"
}
]
}
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/resources/base/media/icon.png
已删除
100644 → 0
浏览文件 @
e469f5f4
15.1 KB
ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/resources/base/profile/main_pages.json
已删除
100644 → 0
浏览文件 @
e469f5f4
{
"src"
:
[
"MainAbility/pages/index/index"
,
"MainAbility/pages/second/second"
]
}
\ No newline at end of file
ability/ability_runtime/actscalltest/systemcallentrytest/signature/openharmony_sx.p7b
已删除
100644 → 0
浏览文件 @
e469f5f4
文件已删除
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts
已删除
100644 → 0
浏览文件 @
e469f5f4
/*
* 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
ServiceExtension
from
'
@ohos.application.ServiceExtensionAbility
'
import
commonEvent
from
"
@ohos.commonEvent
"
;
import
Want
from
'
@ohos.application.Want
'
;
import
rpc
from
'
@ohos.rpc
'
;
export
default
class
ServiceAbility
extends
ServiceExtension
{
onCreate
(
want
:
Want
)
{
globalThis
.
abilityWant
=
want
;
globalThis
.
serviceContext
=
this
.
context
let
direction
=
this
.
context
.
config
.
direction
let
pointerDervice
=
this
.
context
.
config
.
hasPointerDevice
let
AbilityInfo
=
this
.
context
.
extensionAbilityInfo
.
bundleName
console
.
log
(
'
ServiceAbility onCreate, want:
'
+
want
.
abilityName
);
var
CommonEventPublishData
=
{
parameters
:
{
"
config
"
:
direction
,
"
poniterDevices
"
:
pointerDervice
,
"
AbilityInfo
"
:
AbilityInfo
}
}
commonEvent
.
publish
(
"
ExtensionConext_StartAbility
"
,
CommonEventPublishData
,
(
err
)
=>
{
console
.
info
(
"
ExtensionConext_StartAbility onCreate
"
);
});
}
onRequest
(
want
,
startId
)
{
console
.
log
(
'
ServiceAbility onRequest, want:
'
+
want
.
abilityName
+
'
, startId:
'
+
startId
);
console
.
log
(
'
ServiceAbility registerApplicationStateObserver begin
'
);
setTimeout
(()
=>
{
this
.
context
.
terminateSelf
().
then
((
data
)
=>
{
console
.
info
(
"
terminateSelf data =
"
+
JSON
.
stringify
(
data
));
}).
catch
((
err
)
=>
{
console
.
info
(
"
terminateSelf err =
"
+
JSON
.
stringify
(
err
));
});
},
3000
)
}
onConnect
(
want
)
{
console
.
log
(
'
ServiceAbility onConnect, want:
'
+
want
.
abilityName
);
return
null
;
}
onDisconnect
(
want
)
{
console
.
log
(
'
ServiceAbility onDisconnect, want:
'
+
want
.
abilityName
);
}
onDestroy
()
{
console
.
log
(
'
ServiceAbility onDestroy
'
);
}
}
\ No newline at end of file
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/ets/test/ApiCoverAbility.test.ets
浏览文件 @
2571a676
...
...
@@ -679,57 +679,6 @@ export default function ApiCoverTest() {
})
})
/*
* @tc.number SUB_AA_FMS_AbilityStage_0200
* @tc.name Start Service and get config.
* @tc.desc Function test
* @tc.level 3
*/
it
(
'SUB_AA_FMS_AbilityStage_0200'
,
0
,
async
function
(
done
)
{
let
subscriber
=
null
let
subscribeInfo
=
{
events
:
[
"ExtensionConext_StartAbility"
]
}
function
UnSubscribeInfoCallback
(
err
,
data
)
{
console
.
info
(
"SUB_AA_FMS_AbilityStage_0200===UnSubscribeInfoCallback==="
)
}
async
function
SubscribeInfoCallback
(
err
,
data
)
{
console
.
info
(
"SUB_AA_FMS_AbilityStage_0200===SubscribeInfoCallback==="
+
JSON
.
stringify
(
data
))
console
.
info
(
"SUB_AA_FMS_AbilityStage_0200===serviceContext==="
+
JSON
.
stringify
(
globalThis
.
serviceContext
))
console
.
info
(
"SUB_AA_FMS_AbilityStage_0200===config==="
+
JSON
.
stringify
(
globalThis
.
serviceContext
.
config
))
expect
(
data
.
parameters
[
"config"
])
.
assertLess
(
2
)
expect
(
data
.
parameters
[
"poniterDevices"
])
.
assertFalse
()
expect
(
data
.
parameters
[
"AbilityInfo"
])
.
assertEqual
(
"com.example.apicoverhaptest"
)
let
direction
=
globalThis
.
serviceContext
.
config
.
direction
let
pointerDervice
=
globalThis
.
serviceContext
.
config
.
hasPointerDevice
let
AbilityInfo
=
globalThis
.
serviceContext
.
extensionAbilityInfo
.
bundleName
expect
(
direction
)
.
assertLess
(
2
)
expect
(
pointerDervice
)
.
assertFalse
()
expect
(
AbilityInfo
)
.
assertEqual
(
"com.example.apicoverhaptest"
)
commonEvent
.
unsubscribe
(
subscriber
,
UnSubscribeInfoCallback
)
await
sleep
(
4000
)
done
()
}
commonEvent
.
createSubscriber
(
subscribeInfo
,
(
err
,
data
)
=>
{
console
.
info
(
"SUB_AA_FMS_AbilityStage_0200===CreateSubscriberCallback==="
)
subscriber
=
data
commonEvent
.
subscribe
(
subscriber
,
SubscribeInfoCallback
)
})
let
formWant
=
{
deviceId
:
""
,
bundleName
:
"com.example.apicoverhaptest"
,
abilityName
:
"ServiceAbility"
,
}
globalThis
.
abilityContext
.
startAbility
(
formWant
,
(
err
,
data
)
=>
{
if
(
err
.
code
==
0
){
console
.
info
(
"SUB_AA_FMS_AbilityStage_0200===abilityContext startAbility success==="
)
}
else
{
expect
()
.
assertFail
()
done
()
}
})
})
/*
* @tc.number SUB_AA_FMS_AcquireForm_0100
* @tc.name Test startAbility in FormExtensionContext.
...
...
ability/ability_runtime/apicover/apicoverhaptest/entry/src/main/module.json
浏览文件 @
2571a676
...
...
@@ -82,14 +82,6 @@
"resource"
:
"$profile:form_config"
}
]
},
{
"name"
:
"ServiceAbility"
,
"srcEntrance"
:
"./ets/ServiceAbility/ServiceAbility.ts"
,
"label"
:
"$string:MainAbility_label"
,
"description"
:
"$string:MainAbility_desc"
,
"type"
:
"service"
,
"visible"
:
true
}
],
"requestPermissions"
:[
...
...
ability/ability_runtime/apicover/stagesupplement/entry/src/main/ets/MainAbility3/MainAbility3.ts
浏览文件 @
2571a676
...
...
@@ -31,11 +31,12 @@ export default class MainAbility3 extends Ability {
}
onDestroy
()
{
console
.
info
(
printLog3
+
"
onDestroy
"
)
commonEvent
.
publish
(
listPush3
+
"
onDestroy
"
,
(
err
)
=>
{
console
.
info
(
printLog3
+
listPush3
+
"
onDestroy
"
);
});
setTimeout
(()
=>
{
console
.
info
(
printLog3
+
"
onDestroy
"
)
},
1000
)
}
onWindowStageCreate
(
windowStage
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录