diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/app.json b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/app.json deleted file mode 100644 index 7df200e766149905fe00e1c52ef302b29c4bdfe1..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsextensionconnectabilitytest", - "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 - } - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/element/string.json deleted file mode 100644 index be09cccde1bc7369ef47a5cd45d2b06884c88602..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/BUILD.gn b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/BUILD.gn deleted file mode 100644 index 97b76848edb5c1e09fea2a893e3a36ba67da05a2..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/BUILD.gn +++ /dev/null @@ -1,41 +0,0 @@ -# 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("ActsExtensionConnectAbilityTest") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":actsextensionconnectabilitytest_js_assets", - ":actsextensionconnectabilitytest_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsExtensionConnectAbilityTest" -} - -ohos_app_scope("actsextensionconnectabilitytest_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actsextensionconnectabilitytest_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("actsextensionconnectabilitytest_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":actsextensionconnectabilitytest_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/Test.json b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/Test.json deleted file mode 100644 index 71a06299005d6470db0803a144526723674ab829..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/Test.json +++ /dev/null @@ -1,42 +0,0 @@ - -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "120000", - "package": "com.example.actsextensionconnectabilitytest", - "shell-timeout": "60000" - }, - "kits": [ - { - "type": "ShellKit", - "run-command": [ - "acm create -n 101 -t normal", - "acm switch -i 101" - ], - "teardown-command":[ - "acm delete -i 101" - ] - }, - { - "test-file-name": [ - "ActsExtensionConnectAbilityTest.hap", - "actsServiceAbilityRelyHap.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "PushKit", - "push": [ - "actsServiceAbilityRelyHap.hap->/data/app/actsServiceAbilityRelyHap.hap"] - }, - { - "type": "ShellKit", - "run-command": [ - "chmod 777 /data/app/*.hap" - ] - } - ] -} - diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index f0bf6d03c42692b93d73f346b44f441fe485ee2d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.startnum = 0 - globalThis.stageContext = this.context; - - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 1ce4bf5e8d26503167a29a3e55e9efe5d79293b2..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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) { - // Ability is creating, initialize resources for this ability - console.log("AbilityMultiInstanceTest onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("AbilityMultiInstanceTest onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("AbilityMultiInstanceTest onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("AbilityMultiInstanceTest onWindowStageDestroy") - } - - - onForeground() { - // Ability has brought to foreground - console.log("AbilityMultiInstanceTest onForeground") - } - - onBackground() { - // Ability has back to background - console.log("AbilityMultiInstanceTest onBackground") -} - -}; diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index fb5e063866f2e4951c81a0c765d23c6a22ef2c1d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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 ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' -import commonEvent from '@ohos.commonEvent' -import Want from '@ohos.application.Want'; -import rpc from '@ohos.rpc'; -function publishCallBackOne () { - console.log("========Publish CallBack AMS_ConnectAbility_0300_commonEvent========"); -} -function onConnectCallback(element) { - console.log('connectAbilityWithAccount onConnect element.bundleName : ' + element.bundleName) - console.log('connectAbilityWithAccount onConnect element.abilityName : ' + element.abilityName) -} - -function onDisconnectCallback(element) { - console.log('connectAbilityWithAccount onDisconnect element.bundleName : ' + element.bundleName) - console.log('connectAbilityWithAccount onDisconnect element.abilityName : ' + element.abilityName) -} - -function onFailedCallback(code) { - console.log('connectAbilityWithAccount onFailed errCode : ' + code) -} -var conn = -1; -export default class ServiceAbility extends ServiceExtensionAbility { - onCreate(want) { - console.log('ServiceAbility onCreate, want: ' + want.abilityName); - } - - onRequest(want, startId) { - console.log('ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId); - - console.log('ServiceAbility registerApplicationStateObserver begin'); - console.log('ServiceAbility registerApplicationStateObserver end, conn: ' + conn); - } - - onConnect(want: Want) { - console.log('ServiceAbility onConnect, want:' + want.abilityName); - let extensionContext = this.context - if (want.action == "Three") { - console.log('connectAbility 111'); - let num = extensionContext.connectAbility( - { - bundleName: 'com.example.actsserviceabilityrelytest', - abilityName: 'com.example.actsserviceabilityrelytest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - },) - setTimeout(()=>{ - extensionContext.disconnectAbility(num).then(()=>{ - console.log('in disconnectAbility'); - }) - },1000) - - }; - commonEvent.publish("AMS_ConnectAbility_0300_commonEvent", publishCallBackOne); - return new rpc.RemoteObject('connect'); - }; - - onDisconnect(want) { - console.log('ServiceAbility onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ServiceAbility onDestroy'); - } -} - diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/service.ts deleted file mode 100644 index 60298e8adaeab8bfa4360309b6f1dc19d161965e..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility/service.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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. - */ -export default { - onStart() { - console.info('ServiceAbility onStart'); - }, - onStop() { - console.info('ServiceAbility onStop'); - }, - onCommand(want, startId) { - console.info('ServiceAbility onCommand'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts deleted file mode 100644 index bf2d6c33446d2bf0a236f8d80c5e2f9740930598..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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 ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' -import commonEvent from '@ohos.commonEvent' -import Want from '@ohos.application.Want'; -import rpc from '@ohos.rpc'; -function publishCallBackOne () { - console.log("========Publish CallBack AMS_ConnectAbility_0400_commonEvent========"); -} -var conn = -1; -function onConnectCallback(element) { - console.log('connectAbilityWithAccount onConnect element.bundleName : ' + element.bundleName) - console.log('connectAbilityWithAccount onConnect element.abilityName : ' + element.abilityName) -} -function onDisconnectCallback(element) { - console.log('connectAbilityWithAccount onDisconnect element.bundleName : ' + element.bundleName) - console.log('connectAbilityWithAccount onDisconnect element.abilityName : ' + element.abilityName) -} -function onFailedCallback(code) { - console.log('connectAbilityWithAccount onFailed errCode : ' + code) -} -export default class ServiceAbility2 extends ServiceExtensionAbility { - onCreate(want) { - console.log('ServiceAbility onCreate, want: ' + want.abilityName); - } - - onRequest(want, startId) { - console.log('ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId); - - console.log('ServiceAbility registerApplicationStateObserver begin'); - console.log('ServiceAbility registerApplicationStateObserver end, conn: ' + conn); - } - - onConnect(want: Want) { - console.log('ServiceAbility onConnect, want:' + want.abilityName); - let extensionContext = this.context - - console.log('connectAbility 222'); - let num = extensionContext.connectAbility( - { - bundleName: 'com.example.actsserviceabilityrelytest', - abilityName: 'com.example.actsserviceabilityrelytest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - },) - setTimeout(()=>{ - extensionContext.disconnectAbility(num).then(()=>{ - console.log('in disconnectAbility2'); - }) - },1000) - commonEvent.publish("AMS_ConnectAbility_0400_commonEvent", publishCallBackOne); - return new rpc.RemoteObject('connect'); - }; - - onDisconnect(want) { - console.log('ServiceAbility onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ServiceAbility onDestroy'); - } -} - diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/service.ts b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/service.ts deleted file mode 100644 index 60298e8adaeab8bfa4360309b6f1dc19d161965e..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/ServiceAbility2/service.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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. - */ -export default { - onStart() { - console.info('ServiceAbility onStart'); - }, - onStop() { - console.info('ServiceAbility onStop'); - }, - onCommand(want, startId) { - console.info('ServiceAbility onCommand'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/pages/index/index.ets deleted file mode 100644 index 0ae20139168905bbf3e17e026acc49b41d5935fa..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/pages/index/index.ets +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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 file from '@system.file'; - -import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index" -import testsuite from "../../test/List.test.ets" - -@Entry -@Component -struct Index { - - aboutToAppear() { - console.info("start run testcase!!!!") - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - const reportExtend = new ReportExtend(file) - - core.addService('report', reportExtend) - core.init() - core.subscribeEvent('task', reportExtend) - const configService = core.getDefaultService('config') - console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters)) - configService.setConfig(globalThis.abilityWant.parameters) - testsuite(globalThis.abilityContext) - core.execute() - } - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World1111111') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/pages/second/second.ets deleted file mode 100644 index 2c768edb999b1b54fef3268922817734b1f1c954..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/pages/second/second.ets +++ /dev/null @@ -1,43 +0,0 @@ -/* -* 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 '@system.router'; - -@Entry -@Component -struct Second { - private content: string = "Second Page" - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text(`${this.content}`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('back to index') - .fontSize(20) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - router.back() - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 755f04974d20a72df6db6b3a0e7dc08ca08c6abd..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 './actsextensionconnectabilitytest.test.ets' -export default function testsuite(context) { - - abilityTest(context) -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/actsextensionconnectabilitytest.test.ets b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/actsextensionconnectabilitytest.test.ets deleted file mode 100644 index 756d950995a805eecab0370001b051e9e92f6de2..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/ets/test/actsextensionconnectabilitytest.test.ets +++ /dev/null @@ -1,291 +0,0 @@ -/* - * 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, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import commonEvent from '@ohos.commonEvent' - - -var subscriberInfoStartAbility_0100 = { - events: ["AMS_ConnectAbility_0100_commonEvent"], -}; -var subscriberInfoStartAbility_0200 = { - events: ["AMS_ConnectAbility_0200_commonEvent"], -}; -var subscriberInfoStartAbility_0300 = { - events: ["AMS_ConnectAbility_0300_commonEvent"], -}; -var subscriberInfoStartAbility_0400 = { - events: ["AMS_ConnectAbility_0400_commonEvent"], -}; -const START_ABILITY_TIMEOUT = 5000; -globalThis.number = 0; - -export default function abilityTest(abilityContext) { - describe('ActsExtensionConnectAbilityTest', function () { - - it('ACTS_ConnectAbility_0300', 0, async function (done) { - console.log('ACTS_ConnectAbility_0300====ACTS_ConnectAbility_0300 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0100_commonEvent"); - console.debug("====>ACTS_ConnectAbility_0300 5 "); - abilityContext.disconnectAbility( - connId, - (err, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + err.code + " data: " + data) - } - ); - console.debug("====>ACTS_ConnectAbility_0300 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - - } - - - commonEvent.createSubscriber(subscriberInfoStartAbility_0100).then(async (data) => { - console.debug("====>ACTS_ConnectAbility_0300 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack) - connId = await abilityContext.connectAbility({ - bundleName: "com.example.actsserviceabilityrelytest", - abilityName: "com.example.actsserviceabilityrelytest.ServiceAbility", - }, (err, data) => { - console.log('ACTS_ProcessManage SystemAppA onShowProcess startAbility startServiceAbility: ' - + JSON.stringify(err) + ", " + JSON.stringify(data)) - }) - }) - - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - - function timeout() { - expect().assertFail(); - console.debug('ACTS_ConnectAbility_0300 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - abilityContext.disconnectAbility( - connId, - (err, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + err.code + " data: " + data) - }); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ConnectAbility_0300 4 "); - - }) - - it('ACTS_ConnectAbility_0400', 0, async function (done) { - console.log('ACTS_ConnectAbility_0400====ACTS_ConnectAbility_0400 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0200_commonEvent"); - console.debug("====>ACTS_ConnectAbility_0400 5 "); - abilityContext.disconnectAbility( - connId, - (err, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + err.code + " data: " + data) - } - ); - console.debug("====>ACTS_ConnectAbility_0400 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - - } - - - commonEvent.createSubscriber(subscriberInfoStartAbility_0200).then(async (data) => { - console.debug("====>ACTS_ConnectAbility_0400 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - console.debug("====>ACTS_ConnectAbility_0400 3 "); - connId = await abilityContext.connectAbility({ - bundleName: "com.example.actsserviceabilityrelytest", - abilityName: "com.example.actsserviceabilityrelytest.ServiceAbility", - }, (err, data) => { - console.log('ACTS_ProcessManage SystemAppA onShowProcess startAbility startServiceAbility: ' - + JSON.stringify(err) + ", " + JSON.stringify(data)) - }) - console.debug("====>ACTS_ConnectAbility_0400 4 "); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - - function timeout() { - expect().assertFail(); - console.debug('ACTS_ConnectAbility_0400 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - abilityContext.disconnectAbility( - connId, - (err, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + err.code + " data: " + data) - }); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - - }) - - it('ACTS_ExtensionConnectAbility_0300', 0, async function (done) { - console.log('ACTS_ExtensionConnectAbility_0300====ACTS_ExtensionConnectAbility_0300 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0300_commonEvent"); - console.debug("====>ACTS_ExtensionConnectAbility_0300 5 "); - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ExtensionConnectAbility_0300 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - - } - - - commonEvent.createSubscriber(subscriberInfoStartAbility_0300).then(async (data) => { - console.debug("====>ACTS_ExtensionConnectAbility_0300 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - connId = await abilityContext.connectAbility( - { - bundleName: "com.example.actsextensionconnectabilitytest", - abilityName: "com.example.actsextensionconnectabilitytest.ServiceAbility", - action:"Three", - }).then(()=>{ - console.debug("====>startAbility end====>"); - }) - console.debug("====>ACTS_ExtensionConnectAbility_0300 4 "); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - - function timeout() { - expect().assertFail(); - console.debug('ACTS_ExtensionConnectAbility_0300 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ExtensionConnectAbility_0300 3 "); - - }) - - it('ACTS_ExtensionConnectAbility_0400', 0, async function (done) { - console.log('ACTS_ExtensionConnectAbility_0400====ACTS_ExtensionConnectAbility_0400 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0400_commonEvent"); - console.debug("====>ACTS_ExtensionConnectAbility_0400 5 "); - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ExtensionConnectAbility_0400 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - - } - - - commonEvent.createSubscriber(subscriberInfoStartAbility_0400).then(async (data) => { - console.debug("====>ACTS_ExtensionConnectAbility_0400 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - console.debug("====>ACTS_ExtensionConnectAbility_0400 3 "); - connId = await abilityContext.connectAbility( - { - bundleName: "com.example.actsextensionconnectabilitytest", - abilityName: "com.example.actsextensionconnectabilitytest.ServiceAbility2", - action:"Four", - }, - ); - console.debug("====>ACTS_ExtensionConnectAbility_0400 4 "); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - - function timeout() { - expect().assertFail(); - console.debug('ACTS_ExtensionConnectAbility_0400 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - - }) - - - - }) -} - - diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/module.json b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/module.json deleted file mode 100644 index c67df1310741ea21e1dfd1e0d7ff80f0cdd11ed7..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/module.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.actsextensionconnectabilitytest.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "name": "com.example.actsextensionconnectabilitytest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - }, - { - "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", - "name": "com.example.actsextensionconnectabilitytest.ServiceAbility2", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } - ], - - "requestPermissions": [ - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.CHANGE_ABILITY_ENABLED_STATE", - "reason":"need use ohos.permission.CHANGE_ABILITY_ENABLED_STATE" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.LISTEN_BUNDLE_CHANGE", - "reason":"need use ohos.permission.LISTEN_BUNDLE_CHANGE" - }, - { - "name":"ohos.permission.INSTALL_BUNDLE", - "reason":"need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name":"ohos.permission.MANAGE_MISSIONS", - "reason":"need use ohos.permission.MANAGE_MISSIONS" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.CLEAN_APPLICATION_DATA", - "reason":"need use ohos.permission.CLEAN_APPLICATION_DATA" - } - ] - } -} diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index d75325f3cf0a50c1dfe4dbc5162c8737276c3dd9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "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" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 6898b31d2085f478ee1ed9d933a5910cbf901d92..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/actsextensionconnectabilitytest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/app.json b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/app.json deleted file mode 100644 index ec8da706d2b5f623da6c5c90ed1b4ce459a12a40..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app":{ - "bundleName":"com.example.actsserviceabilityrelytest", - "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 - } - } -} diff --git a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/resources/base/element/string.json deleted file mode 100644 index ee69f9a861d9dc269ed6638735d52674583498e1..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string":[ - { - "name":"app_name", - "value":"ohosProject" - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index 474a55588fd7216113dd42073aadf254d4dba023..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/BUILD.gn b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/BUILD.gn deleted file mode 100644 index 90a759c0070e40f416be865ff33656a71571ed3b..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/BUILD.gn +++ /dev/null @@ -1,45 +0,0 @@ -# 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("actsServiceAbilityRelyHap") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - hap_name = "actsServiceAbilityRelyHap" - subsystem_name = XTS_SUITENAME - final_hap_path = - "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" - testonly = true - deps = [ - ":actsserviceabilityrelytest_js_assets", - ":actsserviceabilityrelytest_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" -} - -ohos_app_scope("actsserviceabilityrelytest_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actsserviceabilityrelytest_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("actsserviceabilityrelytest_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":actsserviceabilityrelytest_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 51cb02ba3f5c7011c1cd433d07deebd47a195704..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,9 +0,0 @@ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("[Demo] MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} diff --git a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index e2c308b509995093849c0436bd2421ca18a804da..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,45 +0,0 @@ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' -function publishCallBackOne () { - console.log("========Publish CallBack AMS_ConnectAbility_0200_commonEvent========"); -} -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("AbilityMultiInstanceTest onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("AbilityMultiInstanceTest onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("AbilityMultiInstanceTest onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("AbilityMultiInstanceTest onWindowStageDestroy") - } - - - onForeground() { - // Ability has brought to foreground - console.log("AbilityMultiInstanceTest onForeground") - commonEvent.publish("AMS_ConnectAbility_0200_commonEvent", publishCallBackOne); - } - - onBackground() { - // Ability has back to background - console.log("AbilityMultiInstanceTest onBackground") -} - -}; diff --git a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index 62a126278e7f96180c50dd09154e882fb107bbb1..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' -import commonEvent from '@ohos.commonEvent' -import Want from '@ohos.application.Want'; -import rpc from '@ohos.rpc'; -function publishCallBackOne () { - console.log("========Publish CallBack AMS_ConnectAbility_0100_commonEvent========"); -} -function publishCallBackTwo () { - console.log("========Publish CallBack AMS_ConnectAbility_0200_commonEvent========"); -} - -export default class ServiceAbility extends ServiceExtensionAbility { - onCreate(want) { - console.log('ServiceAbility onCreate, want: ' + want.abilityName); - } - - onRequest(want, startId) { - console.log('ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId); - } - - onConnect(want: Want) { - console.log('ServiceAbility onConnect, want:' + want.abilityName); - commonEvent.publish("AMS_ConnectAbility_0100_commonEvent", publishCallBackOne); - commonEvent.publish("AMS_ConnectAbility_0200_commonEvent", publishCallBackTwo); - return new rpc.RemoteObject('connect'); - }; - - onDisconnect(want) { - console.log('ServiceAbility onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ServiceAbility onDestroy'); - } -} - diff --git a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/service.ts deleted file mode 100644 index c35a26328215e619862c418e9d92a11e6fc85241..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/ServiceAbility/service.ts +++ /dev/null @@ -1,28 +0,0 @@ - -/* - * 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. -*/ - -export default { - onStart() { - console.info('ACTS_ProcessManage ServiceAbility onStart'); - }, - onStop() { - console.info('ACTS_ProcessManage ServiceAbility onStop'); - }, - onCommand(want, startId) { - console.info('ACTS_ProcessManage ServiceAbility onCommand'); - }, - -}; \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/pages/index/index.ets deleted file mode 100644 index 69c07eb11c8e08a10c8377085e96916868439d9d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/pages/index/index.ets +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 file from '@system.file'; - -import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index" - - -@Entry -@Component -struct Index { - - aboutToAppear(){ - console.info("start run testcase!!!!") - } - - 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 diff --git a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/pages/second/second.ets deleted file mode 100644 index 1c1c727ff11ecc97909f482c35268db87ae23bb4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/ets/pages/second/second.ets +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import router from '@system.router'; - -@Entry -@Component -struct Second { - private content: string = "Second Page" - - build() { - Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text(`${this.content}`) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('back to index') - .fontSize(20) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - router.back() - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/module.json b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/module.json deleted file mode 100644 index 1312f59ebb9294e6e4e4bc8a1c9491054b946c8f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/module.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.actsserviceabilityrelytest.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities":[ - "entity.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "name": "com.example.actsserviceabilityrelytest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } - ] - - } -} diff --git a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 2977b612ec4595b13eaaffe3e8fc578e83c42d48..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/element/string.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "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" - } - ] -} diff --git a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index 474a55588fd7216113dd42073aadf254d4dba023..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 6898b31d2085f478ee1ed9d933a5910cbf901d92..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "pages/index/index", - "pages/second/second" - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/actsserviceabilityrelytest/signature/openharmony_sx.p7b deleted file mode 100644 index 66b4457a8a81fb8d3356cf46d67226c850944858..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/actsserviceabilityrelytest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/apicover/BUILD.gn b/ability/ability_runtime/apicover/BUILD.gn index fa3b98b09ddcf2ccf5d8014a64a2b7ea2f032285..7fa479f195bbbbd40427a53a64448a793b0f9d87 100644 --- a/ability/ability_runtime/apicover/BUILD.gn +++ b/ability/ability_runtime/apicover/BUILD.gn @@ -17,7 +17,7 @@ group("apicover") { testonly = true if (is_standard_system) { deps = [ - "apicoverhaptest:ApiCoverhapTest", + "apicoverhaptest:ActsApiCoverhapTest", "fasupplement:FaSupplement", "formmodule:FormModule", "stagesupplement:StageSupplement", diff --git a/ability/ability_runtime/apicover/apicoverhaptest/BUILD.gn b/ability/ability_runtime/apicover/apicoverhaptest/BUILD.gn index cf7b2d518ce7ba836f0230680a5bc5cd293cb1a0..64212951a9b672d08eaf575e9a143b9fa9df92a8 100644 --- a/ability/ability_runtime/apicover/apicoverhaptest/BUILD.gn +++ b/ability/ability_runtime/apicover/apicoverhaptest/BUILD.gn @@ -13,7 +13,7 @@ import("//test/xts/tools/build/suite.gni") -ohos_js_hap_suite("ApiCoverhapTest") { +ohos_js_hap_suite("ActsApiCoverhapTest") { hap_profile = "entry/src/main/module.json" js_build_mode = "debug" deps = [ @@ -22,7 +22,7 @@ ohos_js_hap_suite("ApiCoverhapTest") { ] ets2abc = true certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ApiCoverhapTest" + hap_name = "ActsApiCoverhapTest" } ohos_app_scope("apicoverhaptest_app_profile") { diff --git a/ability/ability_runtime/apicover/apicoverhaptest/Test.json b/ability/ability_runtime/apicover/apicoverhaptest/Test.json index 7d0f4631ae2906b504fae442132f41518a0d3dea..b315fe95b93cf419df159adb6dcc96da6b799ee6 100644 --- a/ability/ability_runtime/apicover/apicoverhaptest/Test.json +++ b/ability/ability_runtime/apicover/apicoverhaptest/Test.json @@ -9,7 +9,7 @@ "kits": [ { "test-file-name": [ - "ApiCoverhapTest.hap", + "ActsApiCoverhapTest.hap", "FaSupplement.hap", "StageSupplement.hap", "FormModule.hap" diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js index af4bb8374836a54dbb6a38f53780a56cb2759277..fce9888d7ad8ef22729e92f873b43dac478adb40 100644 --- a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js +++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js @@ -18,9 +18,7 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from let resultCode = 123; let bundleName = 'ohso.act.aafwk'; let mainAbilityName = 'ohos.acts.aafwk.jsap'; -const errCode = -104; -const errCode1 = 2097152; -const errCode2 = 29360157; +const errCode = 1; describe('ConnectAbilityTest', function () { @@ -38,7 +36,7 @@ describe('ConnectAbilityTest', function () { expect().assertFail() }).catch((error) => { console.log('testAbility0100 error: ' + JSON.stringify(error)) - expect(errCode1).assertEqual(error.code) + expect(errCode).assertEqual(error.code) }) done() }) @@ -55,7 +53,7 @@ describe('ConnectAbilityTest', function () { featureAbility.startAbility(parameter, (error, data) => { console.log('testAbility0200 data: ' + JSON.stringify(data)) console.log('testAbility0200 error: ' + JSON.stringify(error)) - expect(errCode1).assertEqual(error.code) + expect(errCode).assertEqual(error.code) done(); }) }) @@ -119,7 +117,7 @@ describe('ConnectAbilityTest', function () { expect().assertFail() }).catch((error) => { console.log('testAblity0500 error: ' + JSON.stringify(error)) - expect(errCode1).assertEqual(error.code) + expect(errCode).assertEqual(error.code) }) done() }) @@ -141,7 +139,7 @@ describe('ConnectAbilityTest', function () { featureAbility.startAbility((parameter), (error, data) => { console.log('testAbility0600 data: ' + JSON.stringify(data)) console.log('testAbility0600 error: ' + JSON.stringify(error)) - expect(errCode1).assertEqual(error.code) + expect(errCode).assertEqual(error.code) done() }) }) @@ -163,7 +161,7 @@ describe('ConnectAbilityTest', function () { expect().assertFail() }).catch((error) => { console.log('testAblity0700 error: ' + JSON.stringify(error)) - expect(errCode1).assertEqual(error.code) + expect(errCode).assertEqual(error.code) }) done() }) @@ -183,7 +181,7 @@ describe('ConnectAbilityTest', function () { featureAbility.startAbility((parameter), (error, data) => { console.log('testAblity0800 data: ' + JSON.stringify(data)) console.log('testAblity0800 error: ' + JSON.stringify(error)) - expect(errCode1).assertEqual(error.code) + expect(errCode).assertEqual(error.code) done() }) }) @@ -310,7 +308,39 @@ describe('ConnectAbilityTest', function () { expect.assertFail() }).catch((error) => { console.log('testAblity1500' + JSON.stringify(error)); - expect().assertEqual(error.code) + expect(errCode).assertEqual(error.code) + }) + done() + }) + + /* + * @tc.number: SUB_AA_JsApi_Ability_1600 + * @tc.name: testAblity1600. + * @tc.desc: startAbilityForResult: The input parameter want is not configured (the value is {}).(by callback) + */ + it("SUB_AA_JsApi_Ability_1600", 0, async function (done) { + let parameter = {} + featureAbility.startAbilityForResult(parameter, (error, data) => { + console.log('testAblity1600 data: ' + JSON.stringify(data)) + console.log('testAblity1600 error: ' + JSON.stringify(error)) + expect(errCode).assertEqual(error.code) + console.log('testAblity1600-1 error: ' + JSON.stringify(error)) + done(); + }) + }) + + /* + * @tc.number: SUB_AA_JsApi_Ability_1700 + * @tc.name: testAblity1700. + * @tc.desc: startAbilityForResult: The input parameter optParam is undefined.(by promise) + */ + it("SUB_AA_JsApi_Ability_1700", 0, async function (done) { + await featureAbility.startAbilityForResult(undefined).then((data) => { + console.log('testAblity1700 data: ' + JSON.stringify(data)) + expect.assertFail() + }).catch((error) => { + console.log('testAblity1700' + JSON.stringify(error)); + expect(errCode).assertEqual(error.code) }) done() }) @@ -323,11 +353,39 @@ describe('ConnectAbilityTest', function () { it("SUB_AA_JsApi_Ability_1800", 0, async function (done) { featureAbility.startAbilityForResult(undefined, (error) => { console.log('testAblity1800' + JSON.stringify(error)); - expect(errCode1).assertEqual(error.code) + expect(errCode).assertEqual(error.code) done() }) }) + /* + * @tc.number: SUB_AA_JsApi_Ability_1900 + * @tc.name: testAblity1900. + * @tc.desc: startAbilityForResult-wrong input parameter format want a layer outside.(by promise) + */ + it("SUB_AA_JsApi_Ability_1900", 0, async function (done) { + let parameter = { + 'StartAbilityParameter': { + 'want': { + 'bundleName': bundleName, + 'abilityName': mainAbilityName, + 'parameters': { + 'key': resultCode, + 'terminate': true + } + } + } + } + await featureAbility.startAbilityForResult(parameter).then((data) => { + console.log('testAblity1900 data: ' + JSON.stringify(data)) + expect.assertFail() + }).catch((error) => { + console.log('testAblity1900 err:' + JSON.stringify(error)); + expect(errCode).assertEqual(error.code) + }) + done() + }) + /* * @tc.number: SUB_AA_JsApi_Ability_2000 * @tc.name: testAblity2000. @@ -348,7 +406,7 @@ describe('ConnectAbilityTest', function () { } featureAbility.startAbilityForResult(parameter, (error, data) => { console.log('testAblity2000' + JSON.stringify(error)); - expect(errCode1).assertEqual(error.code) + expect(errCode).assertEqual(error.code) done() }) }) @@ -375,8 +433,32 @@ describe('ConnectAbilityTest', function () { expect.assertFail() }).catch((error) => { console.log('testAblity2100' + JSON.stringify(error)); - expect(undefined).assertEqual(error.code) + expect(errCode).assertEqual(error.code) }) done() }) + + /* + * @tc.number: SUB_AA_JsApi_Ability_2200 + * @tc.name: testAblity2200. + * @tc.desc: startAbilityForResult-want-Set bundleName and abilityName+flag-flag to character strings.(by callback) + */ + it("SUB_AA_JsApi_Ability_2200", 0, async function (done) { + let parameter = { + 'want': { + 'bundleName': bundleName, + 'abilityName': mainAbilityName, + 'flages': 'abc', + 'parameters': { + 'key': resultCode, + 'terminate': true + } + } + } + featureAbility.startAbilityForResult(parameter, (error, data) => { + console.log('testAblity2200' + JSON.stringify(error)); + expect(errCode).assertEqual(error.code) + done() + }) + }) })