diff --git a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/AppScope/app.json b/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/AppScope/app.json deleted file mode 100644 index 48b20682440c5e7c6c00965ae17a40ea0aa96cfe..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.extensionconnectabilitytest", - "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/ActsAmsExtensionConnectAbilitytest/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/AppScope/resources/base/element/string.json deleted file mode 100644 index be09cccde1bc7369ef47a5cd45d2b06884c88602..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/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/ActsAmsExtensionConnectAbilitytest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/BUILD.gn b/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/BUILD.gn deleted file mode 100644 index bf95b90e1da7907175f773b099f402c45d56dddd..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/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("ActsAmsExtensionConnectAbilitytest") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":actsamsextensionconnectabilitytest_js_assets", - ":actsamsextensionconnectabilitytest_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAmsExtensionConnectAbilitytest" -} - -ohos_app_scope("actsamsextensionconnectabilitytest_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actsamsextensionconnectabilitytest_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("actsamsextensionconnectabilitytest_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":actsamsextensionconnectabilitytest_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/Test.json b/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/Test.json deleted file mode 100644 index afe6b8033ff2e4c108ddbee0c018d27d1cd4d0b1..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/Test.json +++ /dev/null @@ -1,32 +0,0 @@ - -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "120000", - "package": "com.example.extensionconnectabilitytest", - "shell-timeout": "60000" - }, - "kits": [ - { - "type": "ShellKit", - "run-command": [ - "acm create -n user101 -t normal", - "acm switch -i 101" - ], - "teardown-command":[ - "acm delete -i 101" - ] - }, - { - "test-file-name": [ - "ActsAmsExtensionConnectAbilitytest.hap", - "ActsAmsUsersApi7AppA.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - - ] -} - diff --git a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 98eb012db14b28a1f92522e305b9d4538e496dd3..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +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.stageContext = this.context; - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index a1713c0c0788aa5456aaf5f5e787703f9c56a8bf..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/MainAbility/MainAbility.ts +++ /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 Ability from '@ohos.application.Ability' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - globalThis.abilityWant = want; - globalThis.abilityContext = this.context - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility onWindowStageCreate") - - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground") - } -}; diff --git a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index bf2004fb52f5a51bbe52da6cc3771adb2e7cd8b3..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,80 +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 ServiceExtension from '@ohos.application.ServiceExtensionAbility' -import rpc from '@ohos.rpc'; - -var conn = -1; - -function onConnectCallback(element, remote) { - console.debug('onConnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - console.debug('onConnectCallback ====> remote=' - + JSON.stringify(remote) + " , " + remote); - } - function onDisconnectCallback(element) { - console.debug('onDisconnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - } - function onFailedCallback(code) { - console.debug('onFailedCallback ====> code=' - + JSON.stringify(code) + " , " + code) - } -export default class ServiceAbility extends ServiceExtension { - onCreate(want) { - console.log('ACTS_ServiceAbility onCreate, want: ' + want.abilityName); - } - - onRequest(want, startId) { - console.log('ACTS_ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId); - - console.log('ACTS_ServiceAbility registerApplicationStateObserver begin'); - console.log('ACTS_ServiceAbility registerApplicationStateObserver end, conn: ' + conn); - } - - onConnect(want) { - console.log('ACTS_ServiceAbility onConnect, want:' + want.abilityName); - let extensionContext = this.context - if (want.action == "Three") { - console.log('ACTS_connectAbility 111'); - let num = this.context.connectAbility( - { - bundleName: 'com.example.userservicesystemapi7', - abilityName: 'com.example.userservicesystemapi7.ServiceAbility' - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - } - ) - setTimeout(()=>{ - this.context.disconnectAbility(num).then(()=>{ - console.log('ACTS_in disconnectAbility'); - }) - },1000) - - }; - return new rpc.RemoteObject('connect'); - }; - - onDisconnect(want) { - console.log('ACTS_ServiceAbility onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ACTS_ServiceAbility onDestroy'); - } -} - diff --git a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/ServiceAbility/service.ts deleted file mode 100644 index b49731a414958a281c2f0c4eab0e7fb408eb2c2f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/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/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts deleted file mode 100644 index 69a682304c93ed56aa572fe9b7141687434fca79..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts +++ /dev/null @@ -1,75 +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 ServiceExtension from '@ohos.application.ServiceExtensionAbility' -import rpc from '@ohos.rpc'; -var conn = -1; -function onConnectCallback(element, remote) { - console.debug('onConnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - console.debug('onConnectCallback ====> remote=' - + JSON.stringify(remote) + " , " + remote); - } - function onDisconnectCallback(element) { - console.debug('onDisconnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - } - function onFailedCallback(code) { - console.debug('onFailedCallback ====> code=' - + JSON.stringify(code) + " , " + code) - } - -export default class ServiceAbility2 extends ServiceExtension { - 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) { - console.log('ServiceAbility onConnect, want:' + want.abilityName); - console.log('connectAbility 222'); - let num = this.context.connectAbility( - { - bundleName: 'com.example.userservicesystemapi7', - abilityName: 'com.example.userservicesystemapi7.ServiceAbility' - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - } - ) - setTimeout(()=>{ - this.context.disconnectAbility(num).then(()=>{ - console.log('in disconnectAbility2'); - }) - },2000) - 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/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/ServiceAbility2/service.ts b/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/ServiceAbility2/service.ts deleted file mode 100644 index 340a610cb718c70c98add0b5d052bb4589185174..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/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('ServiceAbility2 onStart'); - }, - onStop() { - console.info('ServiceAbility2 onStop'); - }, - onCommand(want, startId) { - console.info('ServiceAbility2 onCommand'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/pages/index/index.ets deleted file mode 100644 index fd39208788d8fdb66d3c7fbff8afefb2763dda90..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/pages/index/index.ets +++ /dev/null @@ -1,50 +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" -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) - console.info("subscribeEvent run !!!!") - const configService = core.getDefaultService('config') - globalThis.abilityWant.parameters['timeout'] = 10000 - 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('MainAbility') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/pages/second/second.ets deleted file mode 100644 index 2c768edb999b1b54fef3268922817734b1f1c954..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/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/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index f5923665570101769b9a6aff451f7c50cc3f6e52..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/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 './manyusersabilitytest.test.ets' -export default function testsuite(context) { - - abilityTest(context) -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/test/manyusersabilitytest.test.ets b/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/test/manyusersabilitytest.test.ets deleted file mode 100644 index 97e2fe25da8ef62279dba9ba3d4f67fb3ff5bfd5..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/ets/test/manyusersabilitytest.test.ets +++ /dev/null @@ -1,373 +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: ["ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"], -}; -var subscriberInfoStartAbility_0200 = { - events: ["ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"], -}; -var subscriberInfoStartAbility_0300 = { - events: ["ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"], -}; -var subscriberInfoStartAbility_0400 = { - events: ["ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"], -}; -const START_ABILITY_TIMEOUT = 5000; - -export default function abilityTest(abilityContext) { - describe('ActsmanyuserAystemAbilityTest', function () { - beforeEach(async (done) => { - setTimeout(function () { - done(); - }, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number : ACTS_ConnectAbility_0300 - * @tc.name : Connect ability - * @tc.desc : Connecting ability succeeded. - */ - 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("ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"); - console.debug("====>ACTS_ConnectAbility_0300 5 "); - abilityContext.disconnectAbility( - connId, - (err, data) => { - console.log('ACTS_ConnectAbility_0300 featureAbilityTest DisconnectAbility result errCode : ' - + err.code + " data: " + data) - } - ); - console.debug("====>ACTS_ConnectAbility_0300 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - - function onConnectCallback(element, remote) { - console.debug('ACTS_ConnectAbility_0300 _onConnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - console.debug('ACTS_ConnectAbility_0300 _onConnectCallback ====> remote=' - + JSON.stringify(remote) + " , " + remote); - } - - function onDisconnectCallback(element) { - console.debug('ACTS_ConnectAbility_0300 _onDisconnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - } - - function onFailedCallback(code) { - console.debug('ACTS_ConnectAbility_0300 _onFailedCallback ====> code=' - + JSON.stringify(code) + " , " + code) - } - - commonEvent.createSubscriber(subscriberInfoStartAbility_0100).then(async (data) => { - console.debug("====>ACTS_ConnectAbility_0300 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack) - connId = abilityContext.connectAbility({ - bundleName: "com.example.userservicesystemapi7", - abilityName: "com.example.userservicesystemapi7.ServiceAbility", - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - } - ) - }) - - 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 "); - }) - - /* - * @tc.number : ACTS_ConnectAbility_0400 - * @tc.name : Connect ability - * @tc.desc : Connecting ability succeeded. - */ - it('ACTS_ConnectAbility_0400', 0, async function (done) { - console.log('ACTS_ConnectAbility_0400==== element=' - + JSON.stringify(element) + " , " + element); - console.debug('ACTS_ConnectAbility_0400 _onConnectCallback ====> remote=' - + JSON.stringify(remote) + " , " + remote); - } - - function onDisconnectCallback(element) { - console.debug('ACTS_ConnectAbility_0400 _onDisconnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - } - - function onFailedCallback(code) { - console.debug('ACTS_ConnectAbility_0400 _onFailedCallback ====> code=' - + JSON.stringify(code) + " , " + code) - } - function subscribeCallBack(err, data) { - console.debug("====>ACTS_ConnectAbility_0400 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("ACTS_InterfaceMultiUsers_0100_Start_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.userservicesystemapi7", - abilityName: "com.example.userservicesystemapi7.ServiceAbility", - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - }) - 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); - - }) - - /* - * @tc.number : ACTS_ExtensionConnectAbility_0300 - * @tc.name : Connect ability - * @tc.desc : Connecting ability succeeded. - */ - 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("ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"); - console.debug("====>ACTS_ExtensionConnectAbility_0300 5 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - function onConnectCallback(element, remote) { - console.debug('ACTS_ExtensionConnectAbility_0300 _onConnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - console.debug('ACTS_ExtensionConnectAbility_0300 _onConnectCallback ====> remote=' - + JSON.stringify(remote) + " , " + remote); - } - function onDisconnectCallback(element) { - console.debug('ACTS_ExtensionConnectAbility_0300 _onDisconnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - } - function onFailedCallback(code) { - console.debug('ACTS_ExtensionConnectAbility_0300 _onFailedCallback ====> code=' - + JSON.stringify(code) + " , " + code) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_0300).then(async (data) => { - console.debug("====>ACTS_ExtensionConnectAbility_0300 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - connId = abilityContext.connectAbility( - { - bundleName: "com.example.extensionconnectabilitytest", - abilityName: "com.example.extensionconnectabilitytest.ServiceAbility", - action:"Three", - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - } - ) - console.debug("====>ACTS_ExtensionConnectAbility_0300 4 "); - }) - - function unSubscribeCallback() { - abilityContext.disconnectAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ExtensionConnectAbility_0300 6 "); - 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 "); - - }) - - /* - * @tc.number : ACTS_ExtensionConnectAbility_0400 - * @tc.name : Connect ability - * @tc.desc : Connecting ability succeeded. - */ - 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("ACTS_InterfaceMultiUsers_0100_Start_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) - } - function onConnectCallback(element, remote) { - console.debug('ACTS_ExtensionConnectAbility_0400_onConnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - console.debug('ACTS_ExtensionConnectAbility_0400_onConnectCallback ====> remote=' - + JSON.stringify(remote) + " , " + remote); - } - function onDisconnectCallback(element) { - console.debug('ACTS_ExtensionConnectAbility_0400_onDisconnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - } - function onFailedCallback(code) { - console.debug('ACTS_ExtensionConnectAbility_0400_onFailedCallback ====> code=' - + JSON.stringify(code) + " , " + code) - } - await 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 = abilityContext.connectAbility( - { - bundleName: "com.example.extensionconnectabilitytest", - abilityName: "com.example.extensionconnectabilitytest.ServiceAbility2", - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - } - ); - 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/ActsAmsExtensionConnectAbilitytest/entry/src/main/module.json b/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/module.json deleted file mode 100644 index ba9ea265a4bcc2d612f388f798e85cb5aae51deb..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/module.json +++ /dev/null @@ -1,91 +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.extensionconnectabilitytest.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.extensionconnectabilitytest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - }, - { - "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", - "name": "com.example.extensionconnectabilitytest.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.INSTALL_BUNDLE", - "reason": "need use ohos.permission.INSTALL_BUNDLE" - }, - { - "name": "ohos.permission.GET_BUNDLE_INFO", - "reason": "need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name": "ohos.permission.UPDATE_CONFIGURATION", - "reason": "need use ohos.permission.UPDATE_CONFIGURATION" - }, - { - "name": "ohos.permission.MANAGE_MISSIONS", - "reason": "need use ohos.permission.MANAGE_MISSIONS" - }, - { - "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" - } - ] - } -} diff --git a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index d75325f3cf0a50c1dfe4dbc5162c8737276c3dd9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/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/ActsAmsExtensionConnectAbilitytest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 6898b31d2085f478ee1ed9d933a5910cbf901d92..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/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/ActsAmsExtensionConnectAbilitytest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/signature/openharmony_sx.p7b deleted file mode 100755 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/ActsAmsExtensionConnectAbilitytest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/actsusers/BUILD.gn b/ability/ability_runtime/actsusers/BUILD.gn index d3c5dc29fa51f979ca677b6f87cda9a9d0070dd3..48b6afef0c6d58085b7e0f7b50022c80fea8bbe8 100644 --- a/ability/ability_runtime/actsusers/BUILD.gn +++ b/ability/ability_runtime/actsusers/BUILD.gn @@ -17,7 +17,6 @@ group("actsusers") { testonly = true if (is_standard_system) { deps = [ - "ActsAmsExtensionConnectAbilitytest:ActsAmsExtensionConnectAbilitytest", "ActsAmsUsersApi7AppA:ActsAmsUsersApi7AppA", "ActsAmsUsersExtensionSystemTest:ActsAmsUsersExtensionSystemTest", "ActsAmsUsersExtensionThirdTest:ActsAmsUsersExtensionThirdTest",