提交 d60d9d3d 编写于 作者: C chengxingzhen
上级 aa311c36
......@@ -21,6 +21,7 @@ group("ability_runtime") {
"abilitymanager:actsabilitymanagertest",
"abilitymontior:ActsAbilityMonitorTest",
"abilitymultiinstance:abilitymultiinstance",
"abilitystagemonitor:abilitystagemonitor",
"actsabilitydelegatorcase:ActsAbilityDelegatorCaseTest",
"actsabilitymanageretstest:ActsAbilityManagerEtsTest",
"actsabilityusertest:ActsAbilityuserTest",
......
# 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("//test/xts/tools/build/suite.gni")
group("abilitystagemonitor") {
testonly = true
if (is_standard_system) {
deps = [
"abilitystagemonitorassista:AbilityStageMonitorAssistA",
"abilitystagemonitorassistc:AbilityStageMonitorAssistC",
"abilitystagemonitorassistd:AbilityStageMonitorAssistD",
"abilitystagemonitorassiste:AbilityStageMonitorAssistE",
"abilitystagemonitorassistf:AbilityStageMonitorAssistF",
"abilitystagemonitorassistg:AbilityStageMonitorAssistG",
"abilitystagemonitorassisth:AbilityStageMonitorAssistH",
"abilitystagemonitortest:ActsAbilityStageMonitorTest"
]
}
}
{
"app": {
"bundleName": "com.example.abilitystagemonitortest",
"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": 9,
"targetAPIVersion": 9,
"car": {
"apiCompatibleVersion": 9,
"singleUser": false
}
}
}
# 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_hap_assist_suite("AbilityStageMonitorAssistA") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":abilitystagemonitorassista_js_assets",
":abilitystagemonitorassista_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "AbilityStageMonitorAssistA"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("abilitystagemonitorassista_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("abilitystagemonitorassista_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("abilitystagemonitorassista_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":abilitystagemonitorassista_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
\ No newline at end of file
/*
* 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"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.info("MyAbilityStageMonitor onCreate")
}
}
\ No newline at end of file
/*
* 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 MainAbility extends Ability {
onCreate(want, launchParam) {
console.info('MainAbilityMonitor onCreate')
}
onDestroy() {
console.info('MainAbilityMonitor onDestroy')
}
onWindowStageCreate(windowStage) {
console.info('MainAbilityMonitor onWindowStageCreate')
windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
globalThis.abilityContext = this.context;
}
onWindowStageDestroy() {
console.info('MainAbilityMonitor onWindowStageDestroy')
}
onForeground() {
console.info('MainAbilityMonitor onForeground')
}
onBackground() {
console.info('MainAbilityMonitor onBackground')
}
};
\ No newline at end of file
/*
* 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 {
aboutToAppear() {
console.info('MainAbility index aboutToAppear')
console.info('start run testcase!!!')
}
@State message: string = 'MainAbility Hello'
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
{
"module": {
"name": "feature_assista",
"type": "feature",
"srcEntrance": "./ets/Application/MyAbilityStage.ts",
"description": "$string:entry_test_desc",
"mainElement": "MainAbility",
"deviceTypes": [
"phone",
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"uiSyntax": "ets",
"abilities": [
{
"name": "MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:MainAbility_desc",
"icon": "$media:icon",
"label": "$string:MainAbility_label",
"visible": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
]
}
]
}
}
\ No newline at end of file
{
"string": [
{
"name": "entry_test_desc",
"value": "description"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "assista"
},
{
"name": "app_name",
"value": "AACommandtest"
},
{
"name": "description_application",
"value": "demo for test"
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.abilitystagemonitortest",
"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": 9,
"targetAPIVersion": 9,
"car": {
"apiCompatibleVersion": 9,
"singleUser": false
}
}
}
# 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_hap_assist_suite("AbilityStageMonitorAssistC") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":abilitystagemonitorassistc_js_assets",
":abilitystagemonitorassistc_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "AbilityStageMonitorAssistC"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("abilitystagemonitorassistc_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("abilitystagemonitorassistc_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("abilitystagemonitorassistc_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":abilitystagemonitorassistc_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
\ No newline at end of file
/*
* 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"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.info("MyAbilityStageMonitor onCreate")
}
}
\ No newline at end of file
/*
* 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 MainAbility extends Ability {
onCreate(want, launchParam) {
console.info('MainAbilityMonitor onCreate')
}
onDestroy() {
console.info('MainAbilityMonitor onDestroy')
}
onWindowStageCreate(windowStage) {
console.info('MainAbilityMonitor onWindowStageCreate')
windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
globalThis.abilityContext = this.context;
}
onWindowStageDestroy() {
console.info('MainAbilityMonitor onWindowStageDestroy')
}
onForeground() {
console.info('MainAbilityMonitor onForeground')
}
onBackground() {
console.info('MainAbilityMonitor onBackground')
}
};
\ No newline at end of file
/*
* 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 {
aboutToAppear() {
console.info('MainAbility index aboutToAppear')
console.info('start run testcase!!!')
}
@State message: string = 'MainAbility2 Hello'
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
{
"module": {
"name": "feature_assistc",
"type": "feature",
"srcEntrance": "./ets/Application/MyAbilityStage.ts",
"description": "$string:entry_test_desc",
"mainElement": "MainAbility2",
"deviceTypes": [
"phone",
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"uiSyntax": "ets",
"abilities": [
{
"name": "MainAbility2",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:MainAbility_desc",
"icon": "$media:icon",
"label": "$string:MainAbility_label",
"visible": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
]
}
]
}
}
\ No newline at end of file
{
"string": [
{
"name": "entry_test_desc",
"value": "description"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "assistc"
},
{
"name": "app_name",
"value": "AACommandtest"
},
{
"name": "description_application",
"value": "demo for test"
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.abilitystagemonitortest",
"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": 9,
"targetAPIVersion": 9,
"car": {
"apiCompatibleVersion": 9,
"singleUser": false
}
}
}
# 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_hap_assist_suite("AbilityStageMonitorAssistD") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":abilitystagemonitorassistd_js_assets",
":abilitystagemonitorassistd_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "AbilityStageMonitorAssistD"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("abilitystagemonitorassistd_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("abilitystagemonitorassistd_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("abilitystagemonitorassistd_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":abilitystagemonitorassistd_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
\ No newline at end of file
/*
* 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"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.info("MyAbilityStageMonitor onCreate")
}
}
\ No newline at end of file
/*
* 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 MainAbility extends Ability {
onCreate(want, launchParam) {
console.info('MainAbilityMonitor onCreate')
}
onDestroy() {
console.info('MainAbilityMonitor onDestroy')
}
onWindowStageCreate(windowStage) {
console.info('MainAbilityMonitor onWindowStageCreate')
windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
globalThis.abilityContext = this.context;
}
onWindowStageDestroy() {
console.info('MainAbilityMonitor onWindowStageDestroy')
}
onForeground() {
console.info('MainAbilityMonitor onForeground')
}
onBackground() {
console.info('MainAbilityMonitor onBackground')
}
};
\ No newline at end of file
/*
* 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 {
aboutToAppear() {
console.info('MainAbility index aboutToAppear')
console.info('start run testcase!!!')
}
@State message: string = 'MainAbility3 Hello'
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
{
"module": {
"name": "feature_assistd",
"type": "feature",
"srcEntrance": "./ets/Application/MyAbilityStage.ts",
"description": "$string:entry_test_desc",
"mainElement": "MainAbility3",
"deviceTypes": [
"phone",
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"uiSyntax": "ets",
"abilities": [
{
"name": "MainAbility3",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:MainAbility_desc",
"icon": "$media:icon",
"label": "$string:MainAbility_label",
"visible": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
]
}
]
}
}
\ No newline at end of file
{
"string": [
{
"name": "entry_test_desc",
"value": "description"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "assistd"
},
{
"name": "app_name",
"value": "AACommandtest"
},
{
"name": "description_application",
"value": "demo for test"
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.abilitystagemonitortest",
"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": 9,
"targetAPIVersion": 9,
"car": {
"apiCompatibleVersion": 9,
"singleUser": false
}
}
}
# 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_hap_assist_suite("AbilityStageMonitorAssistE") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":abilitystagemonitorassiste_js_assets",
":abilitystagemonitorassiste_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "AbilityStageMonitorAssistE"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("abilitystagemonitorassiste_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("abilitystagemonitorassiste_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("abilitystagemonitorassiste_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":abilitystagemonitorassiste_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
\ No newline at end of file
/*
* 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"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.info("MyAbilityStageMonitor onCreate")
}
}
\ No newline at end of file
/*
* 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 MainAbility extends Ability {
onCreate(want, launchParam) {
console.info('MainAbilityMonitor onCreate')
}
onDestroy() {
console.info('MainAbilityMonitor onDestroy')
}
onWindowStageCreate(windowStage) {
console.info('MainAbilityMonitor onWindowStageCreate')
windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
globalThis.abilityContext = this.context;
}
onWindowStageDestroy() {
console.info('MainAbilityMonitor onWindowStageDestroy')
}
onForeground() {
console.info('MainAbilityMonitor onForeground')
}
onBackground() {
console.info('MainAbilityMonitor onBackground')
}
};
\ No newline at end of file
/*
* 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 {
aboutToAppear() {
console.info('MainAbility index aboutToAppear')
console.info('start run testcase!!!')
}
@State message: string = 'MainAbility4 Hello'
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
{
"module": {
"name": "feature_assiste",
"type": "feature",
"srcEntrance": "./ets/Application/MyAbilityStage.ts",
"description": "$string:entry_test_desc",
"mainElement": "MainAbility4",
"deviceTypes": [
"phone",
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"uiSyntax": "ets",
"abilities": [
{
"name": "MainAbility4",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:MainAbility_desc",
"icon": "$media:icon",
"label": "$string:MainAbility_label",
"visible": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
]
}
]
}
}
\ No newline at end of file
{
"string": [
{
"name": "entry_test_desc",
"value": "description"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "assiste"
},
{
"name": "app_name",
"value": "AACommandtest"
},
{
"name": "description_application",
"value": "demo for test"
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.abilitystagemonitortest",
"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": 9,
"targetAPIVersion": 9,
"car": {
"apiCompatibleVersion": 9,
"singleUser": false
}
}
}
# 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_hap_assist_suite("AbilityStageMonitorAssistF") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":abilitystagemonitorassistf_js_assets",
":abilitystagemonitorassistf_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "AbilityStageMonitorAssistF"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("abilitystagemonitorassistf_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("abilitystagemonitorassistf_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("abilitystagemonitorassistf_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":abilitystagemonitorassistf_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
\ No newline at end of file
/*
* 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"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.info("MyAbilityStageMonitor onCreate")
}
}
\ No newline at end of file
/*
* 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 MainAbility extends Ability {
onCreate(want, launchParam) {
console.info('MainAbilityMonitor onCreate')
}
onDestroy() {
console.info('MainAbilityMonitor onDestroy')
}
onWindowStageCreate(windowStage) {
console.info('MainAbilityMonitor onWindowStageCreate')
windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
globalThis.abilityContext = this.context;
}
onWindowStageDestroy() {
console.info('MainAbilityMonitor onWindowStageDestroy')
}
onForeground() {
console.info('MainAbilityMonitor onForeground')
}
onBackground() {
console.info('MainAbilityMonitor onBackground')
}
};
\ No newline at end of file
/*
* 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 {
aboutToAppear() {
console.info('MainAbility index aboutToAppear')
console.info('start run testcase!!!')
}
@State message: string = 'MainAbilityf5 Hello'
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
{
"module": {
"name": "feature_assistf",
"type": "feature",
"srcEntrance": "./ets/Application/MyAbilityStage.ts",
"description": "$string:entry_test_desc",
"mainElement": "MainAbilityf5",
"deviceTypes": [
"phone",
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"uiSyntax": "ets",
"abilities": [
{
"name": "MainAbilityf5",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:MainAbility_desc",
"icon": "$media:icon",
"label": "$string:MainAbility_label",
"visible": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
]
}
]
}
}
\ No newline at end of file
{
"string": [
{
"name": "entry_test_desc",
"value": "description"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "assistf"
},
{
"name": "app_name",
"value": "AACommandtest"
},
{
"name": "description_application",
"value": "demo for test"
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.abilitystagemonitortest",
"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": 9,
"targetAPIVersion": 9,
"car": {
"apiCompatibleVersion": 9,
"singleUser": false
}
}
}
# 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_hap_assist_suite("AbilityStageMonitorAssistG") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":abilitystagemonitorassistg_js_assets",
":abilitystagemonitorassistg_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "AbilityStageMonitorAssistG"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("abilitystagemonitorassistg_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("abilitystagemonitorassistg_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("abilitystagemonitorassistg_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":abilitystagemonitorassistg_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
\ No newline at end of file
/*
* 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"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.info("MyAbilityStageMonitor onCreate")
}
}
\ No newline at end of file
/*
* 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 MainAbility extends Ability {
onCreate(want, launchParam) {
console.info('MainAbilityMonitor onCreate')
}
onDestroy() {
console.info('MainAbilityMonitor onDestroy')
}
onWindowStageCreate(windowStage) {
console.info('MainAbilityMonitor onWindowStageCreate')
windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
globalThis.abilityContext = this.context;
}
onWindowStageDestroy() {
console.info('MainAbilityMonitor onWindowStageDestroy')
}
onForeground() {
console.info('MainAbilityMonitor onForeground')
}
onBackground() {
console.info('MainAbilityMonitor onBackground')
}
};
\ No newline at end of file
/*
* 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 {
aboutToAppear() {
console.info('MainAbility index aboutToAppear')
console.info('start run testcase!!!')
}
@State message: string = 'MainAbility6 Hello'
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
{
"module": {
"name": "feature_assistg",
"type": "feature",
"srcEntrance": "./ets/Application/MyAbilityStage.ts",
"description": "$string:entry_test_desc",
"mainElement": "MainAbility6",
"deviceTypes": [
"phone",
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"uiSyntax": "ets",
"abilities": [
{
"name": "MainAbility6",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:MainAbility_desc",
"icon": "$media:icon",
"label": "$string:MainAbility_label",
"visible": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
]
}
]
}
}
\ No newline at end of file
{
"string": [
{
"name": "entry_test_desc",
"value": "description"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "assistg"
},
{
"name": "app_name",
"value": "AACommandtest"
},
{
"name": "description_application",
"value": "demo for test"
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.abilitystagemonitortest",
"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": 9,
"targetAPIVersion": 9,
"car": {
"apiCompatibleVersion": 9,
"singleUser": false
}
}
}
# 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_hap_assist_suite("AbilityStageMonitorAssistH") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":abilitystagemonitorassisth_js_assets",
":abilitystagemonitorassisth_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "AbilityStageMonitorAssistH"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("abilitystagemonitorassisth_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("abilitystagemonitorassisth_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("abilitystagemonitorassisth_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":abilitystagemonitorassisth_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
\ No newline at end of file
/*
* 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"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.info("MyAbilityStageMonitor onCreate")
}
}
\ No newline at end of file
/*
* 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 MainAbility extends Ability {
onCreate(want, launchParam) {
console.info('MainAbilityMonitor onCreate')
}
onDestroy() {
console.info('MainAbilityMonitor onDestroy')
}
onWindowStageCreate(windowStage) {
console.info('MainAbilityMonitor onWindowStageCreate')
windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
globalThis.abilityContext = this.context;
}
onWindowStageDestroy() {
console.info('MainAbilityMonitor onWindowStageDestroy')
}
onForeground() {
console.info('MainAbilityMonitor onForeground')
}
onBackground() {
console.info('MainAbilityMonitor onBackground')
}
};
\ No newline at end of file
/*
* 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 {
aboutToAppear() {
console.info('MainAbility index aboutToAppear')
console.info('start run testcase!!!')
}
@State message: string = 'MainAbility7 Hello'
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
{
"module": {
"name": "feature_assistg",
"type": "feature",
"srcEntrance": "./ets/Application/MyAbilityStage.ts",
"description": "$string:entry_test_desc",
"mainElement": "MainAbility7",
"deviceTypes": [
"phone",
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"uiSyntax": "ets",
"abilities": [
{
"name": "MainAbility7",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:MainAbility_desc",
"icon": "$media:icon",
"label": "$string:MainAbility_label",
"visible": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
]
}
]
}
}
\ No newline at end of file
{
"string": [
{
"name": "entry_test_desc",
"value": "description"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "assisth"
},
{
"name": "app_name",
"value": "AACommandtest"
},
{
"name": "description_application",
"value": "demo for test"
}
]
}
\ No newline at end of file
{
"app": {
"bundleName": "com.example.abilitystagemonitortest",
"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": 9,
"targetAPIVersion": 9,
"car": {
"apiCompatibleVersion": 9,
"singleUser": false
}
}
}
# 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("ActsAbilityStageMonitorTest") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
deps = [
":abilitystagemonitor_js_assets",
":abilitystagemonitor_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
hap_name = "ActsAbilityStageMonitorTest"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("abilitystagemonitor_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("abilitystagemonitor_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("abilitystagemonitor_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":abilitystagemonitor_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
{
"description": "Configuration for aceceshi Tests",
"driver": {
"type": "OHJSUnitTest",
"test-timeout": "600000",
"bundle-name": "com.example.abilitystagemonitortest",
"module-name": "entry_test",
"shell-timeout": "600000",
"testcase-timeout": "7000"
},
"kits": [
{
"test-file-name": [
"ActsAbilityStageMonitorTest.hap",
"AbilityStageMonitorAssistA.hap",
"AbilityStageMonitorAssistC.hap",
"AbilityStageMonitorAssistD.hap",
"AbilityStageMonitorAssistE.hap",
"AbilityStageMonitorAssistF.hap",
"AbilityStageMonitorAssistG.hap",
"AbilityStageMonitorAssistH.hap"
],
"type": "AppInstallKit",
"cleanup-apps": true
}
]
}
/*
* 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"
export default class MyAbilityStage extends AbilityStage {
onCreate() {
console.info("MyAbilityStageMonitor onCreate")
}
}
\ No newline at end of file
/*
* 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'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
import { Hypium } from '@ohos/hypium'
import testsuite from '../test/List.test'
export default class TestAbility extends Ability {
onCreate(want, launchParam) {
console.info('TestAbility onCreate')
let abilityDelegatorArguments: any
let abilityDelegator: any
abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments()
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}
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
/*
* 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 {
aboutToAppear() {
console.info('TestAbility index aboutToAppear')
}
@State message: string = 'TestAbility Hello'
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
/*
* 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'
let abilityDelegator = undefined
let 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',
'-s dryRun'
])
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()
globalThis.abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator()
let testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility'
let lMonitor = {
abilityName: testAbilityName,
onAbilityCreate: onAbilityCreateCallback,
};
abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback)
let cmd = 'aa start -d 0 -a TestAbility' + ' -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
/*
* 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'
import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
let abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator();
let moduleName1: any
let monitor: any
let want: any
let timeout = 3000;
function sleep(delay) {
let start = (new Date()).getTime();
while ((new Date()).getTime() - start < delay) {
continue;
}
}
function test(time) {
sleep(time);
}
export default function abilityStageMonitorTest() {
describe('ActsAbilityTest', function () {
/**
* @tc.number: SUB_AA_AbilityStageMonitor_0100
* @tc.name: Call waitAbilityStageMonitor in the form of callback, and enter the monitor
* @tc.desc: Verify that the callback form of waitAbilityStageMonitor can get the abilityStage instance
* @tc.level: 1
*/
it('SUB_AA_AbilityStageMonitor_0100', 0, async function (done) {
console.info("SUB_AA_AbilityStage_0100 begin")
monitor = {
moduleName: "feature_assista",
srcEntrance: "./ets/Application/MyAbilityStage.ts",
}
try {
console.info("SUB_AA_AbilityStage_0100 wait abilityStage");
abilityDelegator.waitAbilityStageMonitor(monitor, (err, data) => {
console.log("SUB_AA_AbilityStage_0100 waitAbilityStageMonitor callback " +
"err = " + err + ", data = " + JSON.stringify(data));
moduleName1 = data.context.currentHapModuleInfo.name;
expect(moduleName1).assertEqual(monitor.moduleName)
done();
});
} catch (error) {
console.info("SUB_AA_AbilityStage_0100 waitAbilityStageMonitor callback err: " + JSON.stringify(error));
expect().assertFail()
done()
}
console.info("SUB_AA_AbilityStage_0100 start ability");
want = {
bundleName: "com.example.abilitystagemonitortest",
abilityName: "MainAbility"
};
try {
abilityDelegator.startAbility(want, (err, data) => {
console.info("SUB_AA_AbilityStage_0100 startAbility callback err: " + JSON.stringify(err) + "data: " + JSON.stringify(data));
});
} catch (error) {
console.info("SUB_AA_AbilityStage_0100 startAbility callback err: " + JSON.stringify(error));
expect().assertFail()
done()
}
})
/**
* @tc.number: SUB_AA_AbilityStageMonitor_0200
* @tc.name: Call waitAbilityStageMonitor in the form of a promise, and enter the monitor
* @tc.desc: Verify that the promise form of waitAbilityStageMonitor can get the abilityStage instance
* @tc.level: 3
*/
it('SUB_AA_AbilityStageMonitor_0200', 0, async function (done) {
console.log("SUB_AA_AbilityStage_0100 begin")
monitor = {
moduleName: "feature_assistd",
srcEntrance: "./ets/Application/MyAbilityStage.ts",
}
console.log("SUB_AA_AbilityStageMonitor_0200 wait abilityStage");
abilityDelegator.waitAbilityStageMonitor(monitor).then((abilityStage) => {
console.log("SUB_AA_AbilityStageMonitor_0200 waitAbilityStageMonitor promise " +
"abilityStage: " + JSON.stringify(abilityStage));
moduleName1 = abilityStage.context.currentHapModuleInfo.name;
expect(moduleName1).assertEqual(monitor.moduleName)
done();
}).catch((err) => {
console.log("SUB_AA_AbilityStageMonitor_0200 waitAbilityStageMonitor err: " + JSON.stringify(err));
expect().assertFail()
done()
})
console.log("SUB_AA_AbilityStageMonitor_0200 start ability");
want = {
bundleName: "com.example.abilitystagemonitortest",
abilityName: "MainAbility3"
};
try {
abilityDelegator.startAbility(want, (err, data) => {
console.log("SUB_AA_AbilityStageMonitor_0200 startAbility callback err: " +
JSON.stringify(err) + "data: " + JSON.stringify(data));
});
} catch (error) {
console.log("SUB_AA_AbilityStageMonitor_0200 startAbility callback err: " + JSON.stringify(error));
expect().assertFail()
done()
}
})
/**
* @tc.number: SUB_AA_AbilityStageMonitor_0300
* @tc.name: Call waitAbilityStageMonitor in the form of callBack, enter the monitor, timeout
* @tc.desc: Verify that the callback form of waitAbilityStageMonitor can get the abilityStage instance
* @tc.level: 3
*/
it('SUB_AA_AbilityStageMonitor_0300', 0, async function (done) {
console.info("SUB_AA_AbilityStageMonitor_0300 begin")
monitor = {
moduleName: "feature_assistf",
srcEntrance: "./ets/Application/MyAbilityStage.ts",
}
try {
console.info("SUB_AA_AbilityStageMonitor_0300 wait abilityStage");
abilityDelegator.waitAbilityStageMonitor(monitor, timeout, (err, data) => {
moduleName1 = data.context.currentHapModuleInfo.name;
console.info("SUB_AA_AbilityStageMonitor_0300 waitAbilityStageMonitor callback, err: " +
err + ", data =" + JSON.stringify(data));
expect(moduleName1).assertEqual(monitor.moduleName)
done();
});
} catch (error) {
console.info("SUB_AA_AbilityStageMonitor_0300 waitAbilityStageMonitor callback err: " + JSON.stringify(error));
expect().assertFail()
done()
}
console.info("SUB_AA_AbilityStageMonitor_0300 start ability");
want = {
bundleName: "com.example.abilitystagemonitortest",
abilityName: "MainAbilityf5"
};
try {
abilityDelegator.startAbility(want, (err, data) => {
console.info("SUB_AA_AbilityStageMonitor_0300 startAbility callback err: " +
JSON.stringify(err) + "data: " + JSON.stringify(data));
});
} catch (error) {
console.info("SUB_AA_AbilityStageMonitor_0300 startAbility callback err: " + JSON.stringify(error));
expect().assertFail()
done()
}
})
/**
* @tc.number: SUB_AA_AbilityStageMonitor_0400
* @tc.name: Call waitAbilityStageMonitor in the form of promise, input monitor, timeout
* @tc.desc: Verify that the promise form of waitAbilityStageMonitor can get the abilityStage instance
* @tc.level: 3
*/
it('SUB_AA_AbilityStageMonitor_0400', 0, async function (done) {
console.info("SUB_AA_AbilityStageMonitor_0400 begin")
monitor = {
moduleName: "feature_assistc",
srcEntrance: "./ets/Application/MyAbilityStage.ts",
}
console.info("SUB_AA_AbilityStageMonitor_0400 wait abilityStage");
await abilityDelegator.waitAbilityStageMonitor(monitor, timeout).then((abilityStage) => {
moduleName1 = abilityStage.context.currentHapModuleInfo.name;
console.info("stageMonitor waitAbilityStageMonitor callback, abilityStage: " +
JSON.stringify(abilityStage));
expect(moduleName1).assertEqual(monitor.moduleName)
done();
}).catch((err) => {
console.info("SUB_AA_AbilityStageMonitor_0400 waitAbilityStageMonitor err: " + JSON.stringify(err));
expect().assertFail()
done()
})
console.info("SUB_AA_AbilityStageMonitor_0400 start ability");
test(1000)
want = {
bundleName: "com.example.abilitystagemonitortest",
abilityName: "MainAbility2"
};
try {
abilityDelegator.startAbility(want, (err, data) => {
console.info("SUB_AA_AbilityStageMonitor_0400 startAbility callback err: " +
JSON.stringify(err) + "data: " + JSON.stringify(data));
});
} catch (error) {
console.info("SUB_AA_AbilityStageMonitor_0400 startAbility callback err: " + JSON.stringify(error));
expect().assertFail()
done()
}
})
/**
* @tc.number: SUB_AA_AbilityStageMonitor_0500
* @tc.name: Call waitAbilityStageMonitor, the moduleName in the parameter monitor does not exist
* @tc.desc: Verify that the moduleName passed in by waitAbilityStageMonitor
* does not exist and throw an exception
* @tc.level: 3
*/
it('SUB_AA_AbilityStageMonitor_0500', 0, async function (done) {
console.info("SUB_AA_AbilityStageMonitor_0500 begin")
monitor = {
moduleName: "feature_as1",
srcEntrance: "./ets/Application/MyAbilityStage.ts",
}
console.info("SUB_AA_AbilityStageMonitor_0500 wait abilityStage");
await abilityDelegator.waitAbilityStageMonitor(monitor).then((abilityStage) => {
console.info("stageMonitor waitAbilityStageMonitor callback, abilityStage = " + JSON.stringify(abilityStage));
expect().assertFail()
done()
}).catch((err) => {
console.info("SUB_AA_AbilityStageMonitor_0500 waitAbilityStageMonitor err: " + JSON.stringify(err));
expect(err.code).assertEqual(-1)
done()
})
console.info("SUB_AA_AbilityStageMonitor_0500 start ability");
want = {
bundleName: "com.example.abilitystagemonitortest",
abilityName: "MainAbility4"
};
try {
abilityDelegator.startAbility(want, (err, data) => {
console.info("SUB_AA_AbilityStageMonitor_0500 startAbility callback err: " +
JSON.stringify(err) + "data: " + JSON.stringify(data));
});
} catch (error) {
console.info("SUB_AA_AbilityStageMonitor_0500 startAbility callback err: " + JSON.stringify(error));
expect().assertFail()
done()
}
})
/**
* @tc.number: SUB_AA_AbilityStageMonitor_0600
* @tc.name: Call waitAbilityStageMonitor, the srcEntrance in the parameter monitor does not exist
* @tc.desc: Verify that the srcEntrance passed in by waitAbilityStageMonitor
* does not exist and throw an exception
* @tc.level: 3
*/
it('SUB_AA_AbilityStageMonitor_0600', 0, async function (done) {
console.info("SUB_AA_AbilityStageMonitor_0600 begin")
monitor = {
moduleName: "feature_assistg",
srcEntrance: "./ets/Application/AbilityStageA.ts",
}
console.info("SUB_AA_AbilityStageMonitor_0600 wait abilityStage");
await abilityDelegator.waitAbilityStageMonitor(monitor).then((abilityStage) => {
console.info("stageMonitor waitAbilityStageMonitor callback, abilityStage: " + JSON.stringify(abilityStage));
}).catch((err) => {
console.info("SUB_AA_AbilityStageMonitor_0600 waitAbilityStageMonitor err: " + JSON.stringify(err));
expect(err.code).assertEqual(-1)
done()
})
console.info("SUB_AA_AbilityStageMonitor_0600 start ability");
want = {
bundleName: "com.example.abilitystagemonitortest",
abilityName: "MainAbility6"
};
try {
abilityDelegator.startAbility(want, (err, data) => {
console.info("SUB_AA_AbilityStageMonitor_0600 startAbility callback err: " +
JSON.stringify(err) + "data: " + JSON.stringify(data));
});
} catch (error) {
console.info("SUB_AA_AbilityStageMonitor_0600 startAbility callback err: " + JSON.stringify(error));
expect().assertFail()
done()
}
})
/**
* @tc.number: SUB_AA_AbilityStageMonitor_0700
* @tc.name: Call the promise form of addAbilityStageMonitor to add monitoring,
* and call the promise form of removeAbilityStageMonitor to cancel monitoring
* @tc.desc: Verify that addAbilityStageMonitor can add monitoring,
* verify that removeAbilityStageMonitor can cancel monitoring
* @tc.level: 3
*/
it('SUB_AA_AbilityStageMonitor_0700', 0, async function (done) {
console.info("SUB_AA_AbilityStageMonitor_0700 begin")
monitor = {
moduleName: "feature_assisth",
srcEntrance: "./ets/Application/MyAbilityStage.ts",
}
console.info("SUB_AA_AbilityStageMonitor_0700 wait abilityStage");
await abilityDelegator.addAbilityStageMonitor(monitor).then((data) => {
console.info("stageMonitor addAbilityStageMonitor promise, data = " + data);
}).catch((err) => {
console.info("SUB_AA_AbilityStageMonitor_0700 addAbilityStageMonitor err: " + JSON.stringify(err));
expect().assertFail()
done()
});
await abilityDelegator.waitAbilityStageMonitor(monitor).then((abilityStage) => {
console.info("stageMonitor waitAbilityStageMonitor callback, abilityStage: " + JSON.stringify(abilityStage));
}).catch((err) => {
console.info("SUB_AA_AbilityStageMonitor_0600 waitAbilityStageMonitor err: " + JSON.stringify(err));
expect(err.code).assertEqual(-1)
done()
})
console.info("SUB_AA_AbilityStageMonitor_0700 removeAbilityStageMonitor");
await abilityDelegator.removeAbilityStageMonitor(monitor).then((data) => {
console.info("stageMonitor addAbilityStageMonitor promise, data = " + data);
}).catch((err) => {
console.info("SUB_AA_AbilityStageMonitor_0700 removeAbilityStageMonitor err: " + JSON.stringify(err));
expect().assertFail()
done()
});
})
/**
* @tc.number: SUB_AA_AbilityStageMonitor_0800
* @tc.name: Call the callback form of addAbilityStageMonitor to add monitoring,
* and call the callback form of removeAbilityStageMonitor to cancel monitoring
* @tc.desc: Verify that addAbilityStageMonitor can add monitoring,
* verify that removeAbilityStageMonitor can cancel monitoring
* @tc.level: 3
*/
it('SUB_AA_AbilityStageMonitor_0800', 0, async function (done) {
console.info("SUB_AA_AbilityStageMonitor_0800 begin")
monitor = {
moduleName: "feature_assisti",
srcEntrance: "./ets/Application/AbilityStage.ts",
}
console.info("SUB_AA_AbilityStageMonitor_0800 wait abilityStage");
try {
abilityDelegator.addAbilityStageMonitor(monitor, (err, data) => {
console.info("SUB_AA_AbilityStageMonitor_0800 addAbilityStageMonitor callback, data = " + data +
"err: " + err);
})
} catch (error) {
console.log("SUB_AA_AbilityStageMonitor_0800 addAbilityStageMonitor callback err: " + error);
expect().assertFail()
done()
}
await abilityDelegator.waitAbilityStageMonitor(monitor).then((abilityStage) => {
console.info("stageMonitor waitAbilityStageMonitor callback, abilityStage: " + JSON.stringify(abilityStage));
}).catch((err) => {
console.info("SUB_AA_AbilityStageMonitor_0600 waitAbilityStageMonitor err: " + JSON.stringify(err));
expect(err.code).assertEqual(-1)
done()
})
try {
console.info("SUB_AA_AbilityStageMonitor_0800 removeAbilityStageMonitor");
abilityDelegator.removeAbilityStageMonitor(monitor, (err, data) => {
console.info("SUB_AA_AbilityStageMonitor_0800 removeAbilityStageMonitor callback, data = " +
data + "err: " + err);
})
} catch (error) {
console.log("SUB_AA_AbilityStageMonitor_0800 removeAbilityStageMonitor callback err: " + error);
expect().assertFail()
done()
}
})
/**
* @tc.number: SUB_AA_AbilityStageMonitor_0900
* @tc.name: Call waitAbilityStageMonitor, input monitor, timeout is 3 seconds
* @tc.desc: Verify that waitAbilityStageMonitor is
* created after listening for less than 3 seconds
* @tc.level: 3
*/
it('SUB_AA_AbilityStageMonitor_0900', 0, async function (done) {
console.info("SUB_AA_AbilityStageMonitor_0900 begin")
monitor = {
moduleName: "feature_assisth",
srcEntrance: "./ets/Application/MyAbilityStage.ts",
}
console.info("SUB_AA_AbilityStageMonitor_0900 wait abilityStage");
await abilityDelegator.waitAbilityStageMonitor(monitor, timeout).then((abilityStage) => {
console.info("SUB_AA_AbilityStageMonitor_0900 waitAbilityStageMonitor promise, abilityStage: " +
JSON.stringify(abilityStage));
expect().assertFail()
done();
}).catch((err) => {
console.info("stageMonitor waitAbilityStageMonitor err = " + JSON.stringify(err));
expect(err.code).assertEqual(-1)
done();
})
test(3000)
console.info("SUB_AA_AbilityStageMonitor_0900 start ability");
want = {
bundleName: "com.example.abilitystagemonitortest",
abilityName: "MainAbility7"
};
try {
abilityDelegator.startAbility(want, (err, data) => {
console.info("SUB_AA_AbilityStageMonitor_0900 startAbility callback err: " +
JSON.stringify(err) + "data: " + JSON.stringify(data));
});
} catch (error) {
console.info("SUB_AA_AbilityStageMonitor_0900 startAbility callback err: " + JSON.stringify(error));
expect().assertFail()
done()
}
})
/**
* @tc.number: SUB_AA_AbilityStageMonitor_1000
* @tc.name: Call the promise form of addAbilityStageMonitor to add monitoring,
* call the promise form of removeAbilityStageMonitor to cancel monitoring,
* and the moduleName in the parameter monitor does not exist
* @tc.desc: Verify that addAbilityStageMonitor can add monitoring,
* verify that removeAbilityStageMonitor can cancel monitoring
* @tc.level: 3
*/
it('SUB_AA_AbilityStageMonitor_1000', 0, async function (done) {
console.info("SUB_AA_AbilityStageMonitor_1000 begin")
let addMonitor = false;
let removeMonitor = true;
monitor = {
moduleName: "feature_assa",
srcEntrance: "./ets/Application/MyAbilityStage.ts",
}
console.info("SUB_AA_AbilityStageMonitor_1000 wait abilityStage");
await abilityDelegator.addAbilityStageMonitor(monitor).then((data) => {
console.info("SUB_AA_AbilityStageMonitor_1000 addAbilityStageMonitor promise, data = " + data);
addMonitor = true;
}).catch((err) => {
console.info("SUB_AA_AbilityStageMonitor_1000 removeAbilityStageMonitor err: " + JSON.stringify(err));
expect().assertFail()
done()
});
console.info("stageMonitor removeAbilityStageMonitor");
await abilityDelegator.removeAbilityStageMonitor(monitor).then((data) => {
console.info("SUB_AA_AbilityStageMonitor_1000 addAbilityStageMonitor promise, data = " + data);
removeMonitor = true;
}).catch((err) => {
console.info("SUB_AA_AbilityStageMonitor_1000 removeAbilityStageMonitor err: " + JSON.stringify(err));
expect().assertFail()
done()
});
expect(addMonitor).assertTrue();
expect(removeMonitor).assertTrue();
done()
})
})
};
\ No newline at end of file
/*
* 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 abilityStageMonitorTest from './AbilityStageMonitor.test'
export default function testsuite() {
abilityStageMonitorTest()
}
\ No newline at end of file
{
"module": {
"name": "entry_test",
"type": "entry",
"srcEntrance": "./ets/Application/TestAbilityStage.ts",
"description": "$string:entry_test_desc",
"mainElement": "TestAbility",
"deviceTypes": [
"phone",
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"uiSyntax": "ets",
"abilities": [
{
"name": "TestAbility",
"srcEntrance": "./ets/TestAbility/TestAbility.ts",
"description": "$string:TestAbility_desc",
"icon": "$media:icon",
"label": "$string:TestAbility_label",
"visible": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
]
}
]
}
}
\ No newline at end of file
{
"string": [
{
"name": "entry_test_desc",
"value": "description"
},
{
"name": "app_name",
"value": "AACommandtest"
},
{
"name": "description_application",
"value": "demo for test"
},
{
"name": "TestAbility_desc",
"value": "description"
},
{
"name": "TestAbility_label",
"value": "label"
}
]
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册