diff --git a/ability/ability_runtime/BUILD.gn b/ability/ability_runtime/BUILD.gn index 4fa4688acce3fd87aac2abacc4ba2f6b31f84976..59b0565f3b97e1777d88d5f1e651631ed24034f8 100644 --- a/ability/ability_runtime/BUILD.gn +++ b/ability/ability_runtime/BUILD.gn @@ -54,8 +54,6 @@ group("ability_runtime") { "stage:stage", "want:want", "workercontextcover:workercontextcover", - - #"zidltest:zidltest", ] } } diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/config.json b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/config.json index aab032882573a8bcbd4d3f1cf8ee9cb72d922741..4967aad915912c8765ab05f293ce689c7f6a0ea8 100644 --- a/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/config.json +++ b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/entry/src/main/config.json @@ -18,8 +18,8 @@ "mainAbility": ".MainAbility", "srcPath": "", "deviceType": [ - "default", - "tablet" + "default", + "tablet" ], "distro": { "deliveryWithInstall": true, diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..b36f2bc9d9f2e86047f36f73236632442ae16a43 100644 Binary files a/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/signature/openharmony_sx.p7b and b/ability/ability_runtime/actsusers/ActsAmsUsersApi7AppA/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/app.json b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/app.json deleted file mode 100644 index ac69de9d75e0483c9d396bd8c06ecc7e6996bb4c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.acts.actsinterfacemultiusersextensiontest", - "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/ActsAmsUsersExtensionSystemTest/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/resources/base/element/string.json deleted file mode 100644 index be09cccde1bc7369ef47a5cd45d2b06884c88602..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/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/ActsAmsUsersExtensionSystemTest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/BUILD.gn b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/BUILD.gn deleted file mode 100644 index d290d611a58241e3198723fa25b106805ce13c54..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/BUILD.gn +++ /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("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAmsUsersExtensionSystemTest") { - hap_profile = "./entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":actsamsusersextensionsystemtest_js_assets", - ":actsamsusersextensionsystemtest_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAmsUsersExtensionSystemTest" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("actsamsusersextensionsystemtest_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actsamsusersextensionsystemtest_js_assets") { - source_dir = "./entry/src/main/ets" -} - -ohos_resources("actsamsusersextensionsystemtest_resources") { - sources = [ "./entry/src/main/resources" ] - deps = [ ":actsamsusersextensionsystemtest_app_profile" ] - hap_profile = "./entry/src/main/module.json" -} diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/Test.json b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/Test.json deleted file mode 100644 index 23c3021a3f7e6c9520d14f4c446efa4580c7faf3..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/Test.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "300000", - "bundle-name": "com.acts.actsinterfacemultiusersextensiontest", - "module-name":"phone", - "shell-timeout": "300000", - "testcase-timeout": "30000" - }, - "kits": [ - { - "type": "ShellKit", - "run-command": [ - "acm create -n user101 -t normal", - "acm switch -i 101" - ], - "teardown-command": [ - "acm switch -i 100", - "acm delete -i 101" - ] - }, - { - "test-file-name": [ - "ActsAmsUsersExtensionSystemTest.hap", - "ActsAmsUsersApi7AppA.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 953114c1b479f368cb6c6bd456f0a171a358d148..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/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.app.ability.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 9c42b9840066a6192423dee85df45b408a308a54..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,54 +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.app.ability.UIAbility' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log('MainAbility onCreate') - globalThis.abilityWant = want; - globalThis.abilityContext = this.context; - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - } - - onDestroy() { - console.log('MainAbility onDestroy') - } - - onWindowStageCreate(windowStage) { - console.log('MainAbility onWindowStageCreate') - windowStage.setUIContent(this.context, 'MainAbility/pages/index/index', null) - } - - onWindowStageDestroy() { - console.log('MainAbility onWindowStageDestroy') - } - - onForeground() { - console.log('MainAbility onForeground') - } - - onBackground() { - console.log('MainAbility onBackground') - } - -}; \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility/pages/index/index.ets b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility/pages/index/index.ets deleted file mode 100644 index 3213051cd207a81d45aa7fac27cf772e8eade194..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility/pages/index/index.ets +++ /dev/null @@ -1,31 +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. - */ -@Entry -@Component -struct Index { - @State message: string = 'ActsAmsUsersExtensionSystemTest' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility/pages/second/second.ets b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility/pages/second/second.ets deleted file mode 100644 index f9009a3e8567d1f4557ebc11dded54c7e27c0b0d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility/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/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility2/MainAbility2.ts deleted file mode 100644 index c14e759e1a78d0c30eb2985c9e54aaf21dc6acf6..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/MainAbility2/MainAbility2.ts +++ /dev/null @@ -1,53 +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 Ability from '@ohos.app.ability.UIAbility' -import commonEvent from "@ohos.commonEvent" - -export default class MainAbility2 extends Ability { - - onCreate(want, launchParam) { - console.log("MainAbility2 onCreate"); - globalThis.abilityContext2 = this.context - } - - onDestroy() { - console.log("MainAbility2 onDestroy"); - } - - onWindowStageCreate(windowStage) { - console.log("MainAbility2 onWindowStageCreate"); - windowStage.setUIContent(this.context, "MainAbility/pages/index/second", null); - commonEvent.publish("ACTS_InterfaceMultiUsersExtension_CommonEvent", () => { - console.log("publish Publish ACTS_InterfaceMultiUsersExtension_CommonEvent callback") - globalThis.abilityContext2.terminateSelf().then(() => { - commonEvent.publish("ACTS_TerminateSelf_CommonEvent", ()=>{ - console.log('terminateSelf promise'); - }); - }); - }) - } - - onWindowStageDestroy() { - console.log("MainAbility2 onWindowStageDestroy"); - } - - onForeground() { - console.log("MainAbility2 onForeground"); - } - - onBackground() { - console.log("MainAbility2 onBackground"); - } -}; diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index 9585ba864f16191e33e635e2e1d8336044bcd90d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,246 +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 ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' -import rpc from '@ohos.rpc'; -class Stub extends rpc.RemoteObject { - constructor(des) { - super(des); - } - onRemoteRequest(code, data, reply, option) { - reply.writeNoException(); - reply.writeString("success"); - return true; - } -} -export default class ServiceAbility extends ServiceExtensionAbility { - onCreate(want) { - console.log('ServiceAbility onCreate'); - } - onDestory(){ - console.log('ServiceAbility onDestory'); - } - onRequest(want,startId) { - console.log('ServiceAbility onRequest'); - } - - onConnect(want) { - console.log('ServiceAbility onConnect'); - console.log('globalThis.startnum is' + globalThis.startnum); - switch (globalThis.startnum) { - case 1: - this.context.startAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.MainAbility2' - },{ - windowMode:0 - } - ).then((data) => { - console.debug("====>startAbility end====>"); - console.debug("====>data is====>" + JSON.stringify(data)); - }).catch((err)=>{ - console.debug("==== err is====>"+ JSON.stringify(err)); - console.debug("==== errCode is====>"+ JSON.stringify(err.code)); - }) - break; - case 2: - this.context.startAbility( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.MainAbility2' - },{ - windowMode:0 - }).then(()=>{ - console.debug("====>startAbility end====>"); - }) - console.debug("====>case 2 end====>"); - var myStub1 = new Stub("com.acts.actsinterfacemultiusersextensiontest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub1; - break; - case 3: - this.context.startAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.MainAbility2' - },{ - windowMode:0 - },(err,data) => { - console.debug("==== err is====>"+ JSON.stringify(err)); - console.debug("==== errCode is====>"+ JSON.stringify(err.code)); - console.debug("====>startAbility end====>" ); - }) - var myStub7 = new Stub("com.acts.actsinterfacemultiusersextensiontest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub7; - break; - case 4: - this.context.startAbility( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.MainAbility2' - },{ - windowMode:0 - },(err,data) => { - console.debug("==== err is====>"+ JSON.stringify(err)); - console.debug("==== errCode is====>"+ JSON.stringify(err.code)); - console.debug("====>startAbility end====>" ); - }) - var myStub2 = new Stub("com.acts.actsinterfacemultiusersextensiontest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub2; - break; - case 5: - this.context.startAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility2' - }).then((data)=>{ - console.debug("====>startAbility end====>"); - console.debug("====>data is====>" + JSON.stringify(data)); - }) - break; - case 6: - this.context.startAbility( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.ServiceAbility2' - }).then(()=>{ - console.debug("====>startAbility end====>"); - }) - var myStub3 = new Stub("com.acts.actsinterfacemultiusersextensiontest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub3; - break; - case 7: - this.context.startAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility2' - },(err,data) => { - console.debug("==== err is====>"+ JSON.stringify(err)); - console.debug("==== errCode is====>"+ JSON.stringify(err.code)); - console.debug("====>startAbility end====>" ); - }) - var myStub8 = new Stub("com.acts.actsinterfacemultiusersextensiontest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub8; - break; - case 8: - this.context.startAbility( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.ServiceAbility2' - },(err,data) => { - console.debug("==== err is====>"+ JSON.stringify(err)); - console.debug("==== errCode is====>"+ JSON.stringify(err.code)); - console.debug("====>startAbility end====>" ); - }) - var myStub4 = new Stub("com.acts.actsinterfacemultiusersextensiontest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub4; - break; - case 9: - this.context.startAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility2' - }).then(()=>{ - console.debug("====>startAbility end====>"); - }) - var myStub11 = new Stub("com.acts.actsinterfacemultiusersextensiontest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub11; - break; - case 10: - this.context.startAbility( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.ServiceAbility2' - }).then(()=>{ - console.debug("====>startAbility end====>"); - }) - var myStub5 = new Stub("com.acts.actsinterfacemultiusersextensiontest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub5; - break; - case 11: - this.context.startAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility2' - }).then(()=>{ - console.debug("====>startAbility end====>"); - }) - var myStub12 = new Stub("com.acts.actsinterfacemultiusersextensiontest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub12; - break; - case 12: - this.context.startAbility( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.ServiceAbility2' - },(err,data) => { - console.debug("==== err is====>"+ JSON.stringify(err)); - console.debug("==== errCode is====>"+ JSON.stringify(err.code)); - console.debug("====>startAbility end====>" ); - }) - var myStub6 = new Stub("com.acts.actsinterfacemultiusersextensiontest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub6; - break; - case 13: - this.context.startAbility( - { - bundleName: 'com.example.userservicesystemapi7', - abilityName: 'com.example.userservicesystemapi7.ServiceAbility' - }).then(() => { - console.debug("====>startAbility end====>" ); - }) - var myStub9 = new Stub("com.acts.actsinterfacemultiusersextensiontest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub9; - break; - case 14: - this.context.startAbility( - { - bundleName: 'com.example.userservicesystemapi7', - abilityName: 'com.example.userservicesystemapi7.ServiceAbility' - },(err,data) => { - console.debug("==== err is====>"+ JSON.stringify(err)); - console.debug("==== errCode is====>"+ JSON.stringify(err.code)); - console.debug("====>startAbility end====>" ); - }) - var myStub10 = new Stub("com.acts.actsinterfacemultiusersextensiontest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub10; - break; - default: - break; - } - return new rpc.RemoteObject('connect'); - - } - - onDisconnect(want) { - console.log('ServiceAbility onDisconnect'); - } - - onDestroy() { - console.log('ServiceAbility onDestroy'); - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts deleted file mode 100644 index 9d589e3d095c8c8899b9f412478a188b0bb20651..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts +++ /dev/null @@ -1,53 +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 ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' -import commonEvent from "@ohos.commonEvent" -import rpc from '@ohos.rpc'; - -export default class ServiceAbility2 extends ServiceExtensionAbility { - onCreate(want) { - console.log('ServiceAbility2 onCreate'); - } - - onDestory(){ - console.log('ServiceAbility2 onDestory'); - } - - onRequest(want,startId) { - console.log('ServiceAbility2 onRequest'); - commonEvent.publish("ACTS_InterfaceMultiUsersExtension_CommonEvent", () => { - console.log("publish Publish ACTS_InterfaceMultiUsersExtension_CommonEvent callback") - this.context.terminateSelf().then(() => { - commonEvent.publish("ACTS_TerminateSelf_CommonEvent", ()=>{ - console.log('terminateSelf promise'); - }); - }); - }) - } - - onConnect(want) { - console.log('ServiceAbility2 onConnect'); - return new rpc.RemoteObject('connect'); - } - - onDisconnect(want) { - console.log('ServiceAbility2 onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ServiceAbility2 onDestroy'); - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 9f9cabbe3239cf9f61c388d0912f2373a2aec4f5..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,78 +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 TestRunner from '@ohos.application.testRunner' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -var abilityDelegator = undefined -var abilityDelegatorArguments = undefined - -function translateParamsToString(parameters) { - const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s it', - '-s level', '-s testType', '-s size', '-s timeout', - '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` - } - } - return targetParams.trim() -} - -async function onAbilityCreateCallback() { - console.log("onAbilityCreateCallback"); -} - -async function addAbilityMonitorCallback(err: any) { - console.info("addAbilityMonitorCallback : " + JSON.stringify(err)) -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - console.info("OpenHarmonyTestRunner OnPrepare ") - } - - async onRun() { - console.log('OpenHarmonyTestRunner onRun run') - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility' - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a com.acts.actsinterfacemultiusersextensiontest.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + d.stdResult); - console.info('executeShellCommand : data : ' + d.exitCode); - }) - console.info('OpenHarmonyTestRunner onRun end') - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/test/Ability.test.ets deleted file mode 100644 index a3563c2fa70757ad0b41de076cf92942dc7579c2..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/test/Ability.test.ets +++ /dev/null @@ -1,968 +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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" -import commonEvent from '@ohos.commonEvent' -import osaccount from '@ohos.account.osAccount' - -var subscriberInfo_MainAbility = { - events: ["ACTS_InterfaceMultiUsersExtension_CommonEvent"] -}; -var subscriberInfo_MainAbility2 = { - events: ["ACTS_TerminateSelf_CommonEvent"] -}; -var subscriberInfo_MainAbility3 = { - events: ["ACTS_InterfaceMultiUsers_0100_Start_CommonEvent"] -}; -var osAccountManager -const START_ABILITY_TIMEOUT = 6000; -globalThis.number = 0; -console.debug("====>in Ability.test====>"); -export default function abilityTest() { - console.debug("====>in function abilityTest====>"); - describe('ActsInterfaceMultiUsersExtensionTest', function () { - console.debug("====>in ACTS_InterfaceMultiUsers====>"); - - /* - * @tc.number : ACTS_ExtensionStartAbility_0100 - * @tc.name : start new ability - * @tc.desc : Start an ability with the parameter startability with options succeeded.(promise) - */ - it('ACTS_ExtensionStartAbility_0100', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 1 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack(err, data) { - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent") { - startresult = true - } - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data) => { - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0100start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(() => { - done() - }, 1000) - } - - function timeout() { - console.debug('in ACTS_ExtensionStartAbility_0100 timeout'); - if (flag == true) { - expect().assertFail(); - console.debug('ACTS_ExtensionStartAbility_0100 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number : ACTS_ExtensionStartAbility_0200 - * @tc.name : start new ability - * @tc.desc : Start an ability with the parameter startability with options failed.(promise) - */ - it('ACTS_ExtensionStartAbility_0200', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 2 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack(err, data) { - expect().assertFail(); - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data) => { - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - function onConnectCallback(element, remote) { - console.log(' onConnectCallback====> element=' + JSON.stringify(element)); - console.log(' onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_ExtensionStartAbility_0200 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0200start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_ExtensionStartAbility_0300 - * @tc.name : start new ability - * @tc.desc : Start an ability with the parameter startability with options succeeded.(callback) - */ - it('ACTS_ExtensionStartAbility_0300', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 3 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack(err, data) { - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0300 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent") { - startresult = true - } - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data) => { - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0300start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(() => { - done() - }, 1000) - } - - function timeout() { - console.debug('in ACTS_ExtensionStartAbility_0300 timeout'); - if (flag == true) { - expect().assertFail(); - console.debug('ACTS_ExtensionStartAbility_0300 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number : ACTS_ExtensionStartAbility_0400 - * @tc.name : start new ability - * @tc.desc : Start an ability with the parameter startability with options failed.(callback) - */ - it('ACTS_ExtensionStartAbility_0400', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 4 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack(err, data) { - expect().assertFail(); - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data) => { - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - function onConnectCallback(element, remote) { - console.log(' onConnectCallback====> element=' + JSON.stringify(element)); - console.log(' onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_ExtensionStartAbility_0400 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0400start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - }) - - /* - * @tc.number : ACTS_ExtensionStartAbility_0500 - * @tc.name : start new ability - * @tc.desc : Starting mainability2 with startability succeeded.(promise) - */ - it('ACTS_ExtensionStartAbility_0500', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 5 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack(err, data) { - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0500 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent") { - startresult = true - } - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data) => { - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0500start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(() => { - done() - }, 1000) - } - - function timeout() { - console.debug('in ACTS_ExtensionStartAbility_0500 timeout'); - if (flag == true) { - expect().assertFail(); - console.debug('ACTS_ExtensionStartAbility_0500 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number : ACTS_ExtensionStartAbility_0600 - * @tc.name : start new ability - * @tc.desc : Starting mainability2 with startability failed.(promise) - */ - it('ACTS_ExtensionStartAbility_0600', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 6 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack(err, data) { - expect().assertFail(); - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0600 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data) => { - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - function onConnectCallback(element, remote) { - console.log(' onConnectCallback====> element=' + JSON.stringify(element)); - console.log(' onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_ExtensionStartAbility_0600 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0600start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_ExtensionStartAbility_0700 - * @tc.name : start new ability - * @tc.desc : Starting mainability2 with startability succeeded.(callback) - */ - it('ACTS_ExtensionStartAbility_0700', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 7 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack(err, data) { - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0700 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent") { - startresult = true - } - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data) => { - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0700start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(() => { - done() - }, 1000) - } - - function timeout() { - console.debug('in ACTS_ExtensionStartAbility_0700 timeout'); - if (flag == true) { - expect().assertFail(); - console.debug('ACTS_ExtensionStartAbility_0700 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - - }) - - /* - * @tc.number : ACTS_ExtensionStartAbility_0800 - * @tc.name : start new ability - * @tc.desc : Starting mainability2 with startability failed.(callback) - */ - it('ACTS_ExtensionStartAbility_0800', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 8 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack(err, data) { - expect().assertFail(); - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0800 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data) => { - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - function onConnectCallback(element, remote) { - console.log(' onConnectCallback====> element=' + JSON.stringify(element)); - console.log(' onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_ExtensionStartAbility_0800 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0800start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_ExtensionStartAbility_0900 - * @tc.name : start new ability - * @tc.desc : Starting mainability2 with startability succeeded.(callback) - */ - it('ACTS_ExtensionStartAbility_0900', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 13 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack(err, data) { - expect(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent").assertTrue(); - console.debug("====>0900 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent") { - startresult = true - } - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data) => { - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - commonEvent.createSubscriber(subscriberInfo_MainAbility3).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0900start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(() => { - done() - }, 1000) - } - - function timeout() { - console.debug('in ACTS_ExtensionStartAbility_0900 timeout'); - if (flag == true) { - expect().assertFail(); - console.debug('ACTS_ExtensionStartAbility_0900 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - - }) - - /* - * @tc.number : ACTS_ExtensionStartAbility_1000 - * @tc.name : start new ability - * @tc.desc : Starting mainability2 with startability succeeded.(callback) - */ - it('ACTS_ExtensionStartAbility_1000', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 14 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack(err, data) { - expect(data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent").assertTrue(); - console.debug("====>1000 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ACTS_InterfaceMultiUsers_0100_Start_CommonEvent") { - startresult = true - } - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data) => { - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - commonEvent.createSubscriber(subscriberInfo_MainAbility3).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>1000start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(() => { - done() - }, 1000) - } - - function timeout() { - console.debug('in ACTS_ExtensionStartAbility_1000 timeout'); - if (flag == true) { - expect().assertFail(); - console.debug('ACTS_ExtensionStartAbility_1000 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - - }) - - /* - * @tc.number : ACTS_ExtensionTerminateSelf_0100 - * @tc.name : Use terminateself to terminate ability - * @tc.desc : Starting mainability2 with startAbility then terminateself ability succeeded.(promise) - */ - it('ACTS_ExtensionTerminateSelf_0100', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 9 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack(err, data) { - expect(data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue(); - console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ACTS_TerminateSelf_CommonEvent") { - startresult = true - } - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data) => { - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function onConnectCallback(element, remote) { - console.log('onConnectCallback====> element=' + JSON.stringify(element)); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - commonEvent.createSubscriber(subscriberInfo_MainAbility2).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0100start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(() => { - done() - }, 1000) - } - - function timeout() { - console.debug('in ACTS_ExtensionTerminateSelf_0100 timeout'); - if (flag == true) { - expect().assertFail(); - console.debug('ACTS_ExtensionTerminateSelf_0100 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number : - * @tc.name : Use terminateself to terminate ability - * @tc.desc : Starting mainability2 with startAbility then terminateself ability failed.(promise) - */ - it('ACTS_ExtensionTerminateSelf_0200', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 10 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack(err, data) { - expect().assertFail(); - expect(data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue(); - console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ACTS_TerminateSelf_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data) => { - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - function onConnectCallback(element, remote) { - console.log(' onConnectCallback====> element=' + JSON.stringify(element)); - console.log(' onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug(' - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - commonEvent.createSubscriber(subscriberInfo_MainAbility2).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0200start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - }) - - /* - * @tc.number : ACTS_ExtensionTerminateSelf_0300 - * @tc.name : Use terminateself to terminate ability - * @tc.desc : Starting mainability2 with startAbility then terminateself ability succeeded.(callback) - */ - it('ACTS_ExtensionTerminateSelf_0300', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 11 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack(err, data) { - expect(data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue(); - console.debug("====>0300 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ACTS_TerminateSelf_CommonEvent") { - startresult = true - } - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data) => { - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - commonEvent.createSubscriber(subscriberInfo_MainAbility2).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0300start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(() => { - done() - }, 1000) - } - - function timeout() { - console.debug('in ACTS_ExtensionTerminateSelf_0300 timeout'); - if (flag == true) { - expect().assertFail(); - console.debug('ACTS_ExtensionTerminateSelf_0300 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - - }) - - /* - * @tc.number : ACTS_ExtensionTerminateSelf_0400 - * @tc.name : Use terminateself to terminate ability - * @tc.desc : Starting mainability2 with startAbility then terminateself ability failed.(callback) - */ - it('ACTS_ExtensionTerminateSelf_0400', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 12 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack(err, data) { - expect().assertFail(); - expect(data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue(); - console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ACTS_TerminateSelf_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data) => { - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - function onConnectCallback(element, remote) { - console.log('ACTS_ExtensionTerminateSelf_0400 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_ExtensionTerminateSelf_0400 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_ExtensionTerminateSelf_0400 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - commonEvent.createSubscriber(subscriberInfo_MainAbility2).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0400start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensiontest', - abilityName: 'com.acts.actsinterfacemultiusersextensiontest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - }) -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 87a37045ffc9e7898182239819b483d50d9dafac..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,20 +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 abilityTest from './Ability.test.ets' - -export default function testsuite() { - console.debug("====>in list.test====>"); - abilityTest() -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/module.json b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/module.json deleted file mode 100644 index c72433e358cbfe2390953f60c9d4b8a421913450..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/module.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.acts.actsinterfacemultiusersextensiontest.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" - ] - } - ] - }, - { - "name": "com.acts.actsinterfacemultiusersextensiontest.MainAbility2", - "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait" - } - ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "name": "com.acts.actsinterfacemultiusersextensiontest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - }, - { - "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", - "name": "com.acts.actsinterfacemultiusersextensiontest.ServiceAbility2", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } - ], - "defPermissions": [ - { - "availableScope": [], - "grantMode": "system_grant", - "name": "ohos.permission.MANAGE_LOCAL_ACCOUNTS" - }, - { - "availableScope": [], - "grantMode": "system_grant", - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION" - } - ], - "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.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.MANAGE_LOCAL_ACCOUNTS", - "reason": "need use ohos.permission.MANAGE_LOCAL_ACCOUNTS" - }, - { - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION", - "reason": "need use ohos.permission.MANAGE_LOCAL_ACCOUNTS" - }, - { - "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND", - "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND" - }, - { - "name":"ohos.permission.START_INVISIBLE_ABILITY", - "reason":"need use ohos.permission.START_INVISIBLE_ABILITY" - } - ] - } -} diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index d75325f3cf0a50c1dfe4dbc5162c8737276c3dd9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/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/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 02221db61d317863114ff0ca4dd2b33586abff12..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index/index", - "MainAbility/pages/second/second" - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/signature/openharmony_sx.p7b deleted file mode 100644 index dcec6c9615032c1b48bf185e839d9720dd68aab0..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionSystemTest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/AppScope/app.json b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/AppScope/app.json deleted file mode 100644 index 2dccd99e896b2eaf5691f18ec780f1f5509dbddf..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.acts.actsinterfacemultiusersextensionthirdtest", - "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/ActsAmsUsersExtensionThirdTest/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/AppScope/resources/base/element/string.json deleted file mode 100644 index 0d3507c0d180557b94bc5f0071ba146b4909fe51..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/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/ActsAmsUsersExtensionThirdTest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/BUILD.gn b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/BUILD.gn deleted file mode 100644 index 55d3e644f20fb3c75d9e27a31f187fed014012ca..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/BUILD.gn +++ /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("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAmsUsersExtensionThirdTest") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":actsamsusersextensionthirdtest_js_assets", - ":actsamsusersextensionthirdtest_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAmsUsersExtensionThirdTest" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("actsamsusersextensionthirdtest_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actsamsusersextensionthirdtest_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("actsamsusersextensionthirdtest_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":actsamsusersextensionthirdtest_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/Test.json b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/Test.json deleted file mode 100644 index c63a35a36676032db176e329090140cfd878418f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/Test.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "300000", - "bundle-name": "com.acts.actsinterfacemultiusersextensionthirdtest", - "module-name":"phone", - "shell-timeout": "300000", - "testcase-timeout": "30000" - }, - "kits": [ - { - "type": "ShellKit", - "run-command": [ - "acm create -n user101 -t normal", - "acm switch -i 101" - ], - "teardown-command": [ - "acm switch -i 100", - "acm delete -i 101" - ] - }, - { - "test-file-name": [ - "ActsAmsUsersExtensionThirdTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index bd7db9a9b53d06a4fd6b34944fd9168b0707cee9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/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.app.ability.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/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index c6ec554a30bc434dcaa3f17963727a7c39ecbc96..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,54 +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.app.ability.UIAbility' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' - -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log('MainAbility onCreate') - globalThis.abilityWant = want; - globalThis.abilityContext = this.context; - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - } - - onDestroy() { - console.log('MainAbility onDestroy') - } - - onWindowStageCreate(windowStage) { - console.log('MainAbility onWindowStageCreate') - windowStage.setUIContent(this.context, 'MainAbility/pages/index/index', null) - } - - onWindowStageDestroy() { - console.log('MainAbility onWindowStageDestroy') - } - - onForeground() { - console.log('MainAbility onForeground') - } - - onBackground() { - console.log('MainAbility onBackground') - } - -}; \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/MainAbility/pages/index/index.ets b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/MainAbility/pages/index/index.ets deleted file mode 100644 index 3213051cd207a81d45aa7fac27cf772e8eade194..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/MainAbility/pages/index/index.ets +++ /dev/null @@ -1,31 +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. - */ -@Entry -@Component -struct Index { - @State message: string = 'ActsAmsUsersExtensionSystemTest' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/MainAbility/pages/second/second.ets b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/MainAbility/pages/second/second.ets deleted file mode 100644 index 7d77623164cfc87c809713272776bff63fefbbd9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/MainAbility/pages/second/second.ets +++ /dev/null @@ -1,44 +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/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/MainAbility2/MainAbility2.ts deleted file mode 100644 index e190aecbe9572a30f293a03d27f92737c0092872..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/MainAbility2/MainAbility2.ts +++ /dev/null @@ -1,53 +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.app.ability.UIAbility' -import commonEvent from "@ohos.commonEvent" - -export default class MainAbility2 extends Ability { - - onCreate(want, launchParam) { - console.log("MainAbility2 onCreate"); - globalThis.abilityContext2 = this.context - } - - onDestroy() { - console.log("MainAbility2 onDestroy"); - } - - onWindowStageCreate(windowStage) { - console.log("MainAbility2 onWindowStageCreate"); - windowStage.setUIContent(this.context, "MainAbility/pages/index/second", null); - commonEvent.publish("ACTS_InterfaceMultiUsersExtension_CommonEvent", () => { - console.log("publish Publish ACTS_InterfaceMultiUsersExtension_CommonEvent callback") - globalThis.abilityContext2.terminateSelf().then(() => { - commonEvent.publish("ACTS_TerminateSelf_CommonEvent", ()=>{ - console.log('terminateSelf promise'); - }); - }); - }) - } - - onWindowStageDestroy() { - console.log("MainAbility2 onWindowStageDestroy"); - } - - onForeground() { - console.log("MainAbility2 onForeground"); - } - - onBackground() { - console.log("MainAbility2 onBackground"); - } -}; diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index f363a918d8db101f7e8ac80356b701290fc88e0d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,206 +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 Want from '@ohos.application.Want'; -import rpc from '@ohos.rpc'; -class Stub extends rpc.RemoteObject { - constructor(des) { - super(des); - } - onRemoteRequest(code, data, reply, option) { - reply.writeNoException(); - reply.writeString("success"); - return true; - } -} -export default class ServiceAbility extends ServiceExtensionAbility { - onCreate(want:Want) { - console.log('ServiceAbility onCreate'); - } - onDestory(){ - console.log('ServiceAbility onDestory'); - } - onRequest(want,startId) { - console.log('ServiceAbility onRequest'); - } - - onConnect(want) { - console.log('ServiceAbility onConnect'); - console.log('globalThis.startnum is' + globalThis.startnum); - switch (globalThis.startnum) { - case 1: - this.context.startAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensionthirdtest', - abilityName: 'com.acts.actsinterfacemultiusersextensionthirdtest.MainAbility2' - },{ - windowMode:0 - } - ).then((data) => { - console.debug("====>startAbility end====>"); - console.debug("====>data is====>" + JSON.stringify(data)); - }) - break; - case 2: - this.context.startAbility( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.MainAbility2' - },{ - windowMode:0 - }).then(()=>{ - console.debug("====>startAbility end====>"); - }) - console.debug("====>case 2 end====>"); - var myStub1 = new Stub("com.acts.actsinterfacemultiusersextensionthirdtest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub1; - break; - case 3: - this.context.startAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensionthirdtest', - abilityName: 'com.acts.actsinterfacemultiusersextensionthirdtest.MainAbility2' - },{ - windowMode:0 - },(err,data) => { - console.debug("====>err is====>" + JSON.stringify(err)); - console.debug("====>startAbility end====>" ); - }) - var myStub7 = new Stub("com.acts.actsinterfacemultiusersextensionthirdtest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub7; - break; - case 4: - this.context.startAbility( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.MainAbility2' - },{ - windowMode:0 - },(err,data) => { - console.debug("====>err is====>" + JSON.stringify(err)); - console.debug("====>startAbility end====>" ); - }) - var myStub2 = new Stub("com.acts.actsinterfacemultiusersextensionthirdtest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub2; - break; - case 5: - this.context.startAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensionthirdtest', - abilityName: 'com.acts.actsinterfacemultiusersextensionthirdtest.ServiceAbility2' - }).then((data)=>{ - console.debug("====>startAbility end====>"); - console.debug("====>data is====>" + JSON.stringify(data)); - }) - break; - case 6: - this.context.startAbility( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.ServiceAbility2' - }).then(()=>{ - console.debug("====>startAbility end====>"); - }) - var myStub3 = new Stub("com.acts.actsinterfacemultiusersextensionthirdtest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub3; - break; - case 7: - this.context.startAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensionthirdtest', - abilityName: 'com.acts.actsinterfacemultiusersextensionthirdtest.ServiceAbility2' - },(err,data) => { - console.debug("====>err is====>" + JSON.stringify(err)); - console.debug("====>startAbility end====>" ); - }) - var myStub8 = new Stub("com.acts.actsinterfacemultiusersextensionthirdtest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub8; - break; - case 8: - this.context.startAbility( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.ServiceAbility2' - },(err,data) => { - console.debug("====>err is====>" + JSON.stringify(err)); - console.debug("====>startAbility end====>" ); - }) - var myStub4 = new Stub("com.acts.actsinterfacemultiusersextensionthirdtest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub4; - break; - case 9: - this.context.startAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensionthirdtest', - abilityName: 'com.acts.actsinterfacemultiusersextensionthirdtest.ServiceAbility2' - }).then(()=>{ - console.debug("====>startAbility end====>"); - }) - break; - case 10: - this.context.startAbility( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.ServiceAbility2' - }).then(()=>{ - console.debug("====>startAbility end====>"); - }) - var myStub5 = new Stub("com.acts.actsinterfacemultiusersextensionthirdtest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub5; - break; - case 11: - this.context.startAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensionthirdtest', - abilityName: 'com.acts.actsinterfacemultiusersextensionthirdtest.ServiceAbility2' - }).then(()=>{ - console.debug("====>startAbility end====>"); - }) - break; - case 12: - this.context.startAbility( - { - bundleName: 'com.acts.error', - abilityName: 'com.acts.error.ServiceAbility2' - },(err,data) => { - console.debug("====>err is====>" + JSON.stringify(err)); - console.debug("====>startAbility end====>" ); - }) - var myStub6 = new Stub("com.acts.actsinterfacemultiusersextensionthirdtest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub6; - break; - default: - break; - } - return new rpc.RemoteObject('connect'); - } - - onDisconnect(want) { - console.log('ServiceAbility onDisconnect'); - } - - onDestroy() { - console.log('ServiceAbility onDestroy'); - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts deleted file mode 100644 index d871d5edf1ac0c2fb29fbb88dc33044537aa6c26..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts +++ /dev/null @@ -1,54 +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"; - -export default class ServiceAbility2 extends ServiceExtensionAbility { - onCreate(want:Want) { - console.log('ServiceAbility2 onCreate'); - } - - onDestory(){ - console.log('ServiceAbility2 onDestory'); - } - - onRequest(want,startId) { - console.log('ServiceAbility2 onRequest'); - commonEvent.publish("ACTS_InterfaceMultiUsersExtension_CommonEvent", () => { - console.log("publish Publish ACTS_InterfaceMultiUsersExtension_CommonEvent callback") - this.context.terminateSelf().then(() => { - commonEvent.publish("ACTS_TerminateSelf_CommonEvent", ()=>{ - console.log('terminateSelf promise'); - }); - }); - }) - } - - onConnect(want) { - console.log('ServiceAbility2 onConnect'); - return new rpc.RemoteObject('connect'); - } - - onDisconnect(want) { - console.log('ServiceAbility2 onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ServiceAbility2 onDestroy'); - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/TestAbility/TestAbility.ts b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/TestAbility/TestAbility.ts deleted file mode 100644 index 4f101c99c1576a3b8a17594f6feaaf063a917b5f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/TestAbility/TestAbility.ts +++ /dev/null @@ -1,51 +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.app.ability.UIAbility' - -export default class TestAbility extends Ability { - onCreate(want, launchParam) { - console.log('TestAbility onCreate') - } - - onDestroy() { - console.log('TestAbility onDestroy') - } - - onWindowStageCreate(windowStage) { - console.log('TestAbility onWindowStageCreate') - windowStage.loadContent("TestAbility/pages/index", (err, data) => { - if (err.code) { - console.error('Failed to load the content. Cause:' + JSON.stringify(err)); - return; - } - console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data)) - }); - - globalThis.abilityContext = this.context; - } - - onWindowStageDestroy() { - console.log('TestAbility onWindowStageDestroy') - } - - onForeground() { - console.log('TestAbility onForeground') - } - - onBackground() { - console.log('TestAbility onBackground') - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/TestAbility/pages/index.ets b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/TestAbility/pages/index.ets deleted file mode 100644 index fae969f985ff5bf7432de71e36c792364ebac1f6..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/TestAbility/pages/index.ets +++ /dev/null @@ -1,48 +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 '@ohos.router'; - -@Entry -@Component -struct Index { - aboutToAppear() { - console.info('TestAbility index aboutToAppear') - } - @State message: string = 'Hello World' - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(20) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('35%') - .height('5%') - .onClick(()=>{ - }) - } - .width('100%') - } - .height('100%') - } - } \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 8b106a82e3b4cc5d0d6046651a54aa9a1d7ed46d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,78 +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 TestRunner from '@ohos.application.testRunner' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -var abilityDelegator = undefined -var abilityDelegatorArguments = undefined - -function translateParamsToString(parameters) { - const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s it', - '-s level', '-s testType', '-s size', '-s timeout', - '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` - } - } - return targetParams.trim() -} - -async function onAbilityCreateCallback() { - console.log("onAbilityCreateCallback"); -} - -async function addAbilityMonitorCallback(err: any) { - console.info("addAbilityMonitorCallback : " + JSON.stringify(err)) -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - console.info("OpenHarmonyTestRunner OnPrepare ") - } - - async onRun() { - console.log('OpenHarmonyTestRunner onRun run') - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility' - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a com.acts.actsinterfacemultiusersextensionthirdtest.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + d.stdResult); - console.info('executeShellCommand : data : ' + d.exitCode); - }) - console.info('OpenHarmonyTestRunner onRun end') - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/test/Ability.test.ets deleted file mode 100644 index 8d2b2242e04789b93b87609f71db368c25e9b1d3..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/test/Ability.test.ets +++ /dev/null @@ -1,828 +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 "@ohos/hypium" -import commonEvent from '@ohos.commonEvent' -import osaccount from '@ohos.account.osAccount' - -var subscriberInfo_MainAbility = { - events: ["ACTS_InterfaceMultiUsersExtension_CommonEvent"] -}; -var subscriberInfo_MainAbility2 = { - events: ["ACTS_TerminateSelf_CommonEvent"] -}; -var osAccountManager -const START_ABILITY_TIMEOUT = 6000; -globalThis.number = 0; -console.debug("====>in Ability.test====>"); -export default function abilityTest() { - console.debug("====>in function abilityTest====>"); - describe('ActsInterfaceMultiUsersExtensionThirdTest', function () { - console.debug("====>in ACTS_InterfaceMultiUsers====>"); - - /* - * @tc.number : ACTS_ThirdPartyExtensionStartAbility_0100 - * @tc.name : start new ability - * @tc.desc : Start an ability with the parameter startability with options succeeded.(promise) - */ - it('ACTS_ThirdPartyExtensionStartAbility_0100', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 1 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ - startresult = true - } - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0100start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensionthirdtest', - abilityName: 'com.acts.actsinterfacemultiusersextensionthirdtest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(()=>{ - done() - },1000) - } - - function timeout() { - console.debug('in ACTS_ThirdPartyExtensionStartAbility_0100 timeout'); - if(flag == true) { - expect().assertFail(); - console.debug('ACTS_ThirdPartyExtensionStartAbility_0100 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number : ACTS_ThirdPartyExtensionStartAbility_0200 - * @tc.name : start new ability - * @tc.desc : Start an ability with the parameter startability with options failed.(promise) - */ - it('ACTS_ThirdPartyExtensionStartAbility_0200', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 2 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect().assertFail(); - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(()=>{ - done(); - },1000) - } - function onConnectCallback(element, remote) { - console.log(' onConnectCallback====> element=' + JSON.stringify(element)); - console.log(' onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(()=> { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if(flag == true) { - console.debug('ACTS_ThirdPartyExtensionStartAbility_0200 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0200start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensionthirdtest', - abilityName: 'com.acts.actsinterfacemultiusersextensionthirdtest.ServiceAbility' - },{ - onConnect:onConnectCallback, - onDisconnect:onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_ThirdPartyExtensionStartAbility_0300 - * @tc.name : start new ability - * @tc.desc : Start an ability with the parameter startability with options succeeded.(callback) - */ - it('ACTS_ThirdPartyExtensionStartAbility_0300', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum=3 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0300 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ - startresult = true - } - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0300start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensionthirdtest', - abilityName: 'com.acts.actsinterfacemultiusersextensionthirdtest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(()=>{ - done() - },1000) - } - - function timeout() { - console.debug('in ACTS_ThirdPartyExtensionStartAbility_0300 timeout'); - if(flag == true) { - expect().assertFail(); - console.debug('ACTS_ThirdPartyExtensionStartAbility_0300 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number : ACTS_ThirdPartyExtensionStartAbility_0400 - * @tc.name : start new ability - * @tc.desc : Start an ability with the parameter startability with options failed.(callback) - */ - it('ACTS_ThirdPartyExtensionStartAbility_0400', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 4 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect().assertFail(); - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(()=>{ - done(); - },1000) - } - function onConnectCallback(element, remote) { - console.log(' onConnectCallback====> element=' + JSON.stringify(element)); - console.log(' onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(()=> { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if(flag == true) { - console.debug('ACTS_ThirdPartyExtensionStartAbility_0400 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0400start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensionthirdtest', - abilityName: 'com.acts.actsinterfacemultiusersextensionthirdtest.ServiceAbility' - },{ - onConnect:onConnectCallback, - onDisconnect:onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - }) - - /* - * @tc.number : ACTS_ThirdPartyExtensionStartAbility_0500 - * @tc.name : start new ability - * @tc.desc : Starting mainability2 with startability succeeded.(promise) - */ - it('ACTS_ThirdPartyExtensionStartAbility_0500', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 5 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0500 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ - startresult = true - } - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0500start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensionthirdtest', - abilityName: 'com.acts.actsinterfacemultiusersextensionthirdtest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(()=>{ - done() - },1000) - } - - function timeout() { - console.debug('in ACTS_ThirdPartyExtensionStartAbility_0500 timeout'); - if(flag == true) { - expect().assertFail(); - console.debug('ACTS_ThirdPartyExtensionStartAbility_0500 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number : ACTS_ThirdPartyExtensionStartAbility_0600 - * @tc.name : start new ability - * @tc.desc : Starting mainability2 with startability failed.(promise) - */ - it('ACTS_ThirdPartyExtensionStartAbility_0600', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 6 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect().assertFail(); - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0600 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(()=>{ - done(); - },1000) - } - function onConnectCallback(element, remote) { - console.log(' onConnectCallback====> element=' + JSON.stringify(element)); - console.log(' onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(()=> { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if(flag == true) { - console.debug('ACTS_ThirdPartyExtensionStartAbility_0600 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0600start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensionthirdtest', - abilityName: 'com.acts.actsinterfacemultiusersextensionthirdtest.ServiceAbility' - },{ - onConnect:onConnectCallback, - onDisconnect:onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_ThirdPartyExtensionStartAbility_0700 - * @tc.name : start new ability - * @tc.desc : Starting mainability2 with startability succeeded.(callback) - */ - it('ACTS_ThirdPartyExtensionStartAbility_0700', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum=7 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0700 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ - startresult = true - } - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0700start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensionthirdtest', - abilityName: 'com.acts.actsinterfacemultiusersextensionthirdtest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(()=>{ - done() - },1000) - } - - function timeout() { - console.debug('in ACTS_ThirdPartyExtensionStartAbility_0700 timeout'); - if(flag == true) { - expect().assertFail(); - console.debug('ACTS_ThirdPartyExtensionStartAbility_0700 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - - }) - - /* - * @tc.number : ACTS_ThirdPartyExtensionStartAbility_0800 - * @tc.name : start new ability - * @tc.desc : Starting mainability2 with startability failed.(callback) - */ - it('ACTS_ThirdPartyExtensionStartAbility_0800', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 8 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect().assertFail(); - expect(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent").assertTrue(); - console.debug("====>0800 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_InterfaceMultiUsersExtension_CommonEvent"){ - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(()=>{ - done(); - },1000) - } - function onConnectCallback(element, remote) { - console.log(' onConnectCallback====> element=' + JSON.stringify(element)); - console.log(' onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(()=> { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if(flag == true) { - console.debug('ACTS_ThirdPartyExtensionStartAbility_0800 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - commonEvent.createSubscriber(subscriberInfo_MainAbility).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0800start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensionthirdtest', - abilityName: 'com.acts.actsinterfacemultiusersextensionthirdtest.ServiceAbility' - },{ - onConnect:onConnectCallback, - onDisconnect:onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - /* - * @tc.number : ACTS_ThirdPartyExtensionTerminateSelf_0100 - * @tc.name : Use terminateself to terminate ability - * @tc.desc : Starting mainability2 with startAbility then terminateself ability succeeded.(promise) - */ - it('ACTS_ThirdPartyExtensionTerminateSelf_0100', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 9 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect(data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue(); - console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_TerminateSelf_CommonEvent"){ - startresult = true - } - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - commonEvent.createSubscriber(subscriberInfo_MainAbility2).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0100start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensionthirdtest', - abilityName: 'com.acts.actsinterfacemultiusersextensionthirdtest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(()=>{ - done() - },1000) - } - - function timeout() { - console.debug('in ACTS_ThirdPartyExtensionTerminateSelf_0100 timeout'); - if(flag == true) { - expect().assertFail(); - console.debug('ACTS_ThirdPartyExtensionTerminateSelf_0100 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - /* - * @tc.number : ACTS_ThirdPartyExtensionTerminateSelf_0200 - * @tc.name : Use terminateself to terminate ability - * @tc.desc : Starting mainability2 with startAbility then terminateself ability failed.(promise) - */ - it('ACTS_ThirdPartyExtensionTerminateSelf_0200', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 10 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect().assertFail(); - expect(data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue(); - console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_TerminateSelf_CommonEvent"){ - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(()=>{ - done(); - },1000) - } - function onConnectCallback(element, remote) { - console.log(' onConnectCallback====> element=' + JSON.stringify(element)); - console.log(' onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(()=> { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if(flag == true) { - console.debug(' - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - commonEvent.createSubscriber(subscriberInfo_MainAbility2).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0200start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensionthirdtest', - abilityName: 'com.acts.actsinterfacemultiusersextensionthirdtest.ServiceAbility' - },{ - onConnect:onConnectCallback, - onDisconnect:onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - }) - /* - * @tc.number : ACTS_ThirdPartyExtensionTerminateSelf_0300 - * @tc.name : Use terminateself to terminate ability - * @tc.desc : Starting mainability2 with startAbility then terminateself ability succeeded.(callback) - */ - it('ACTS_ThirdPartyExtensionTerminateSelf_0300', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 11 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect(data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue(); - console.debug("====>0300 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_TerminateSelf_CommonEvent"){ - startresult = true - } - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - commonEvent.createSubscriber(subscriberInfo_MainAbility2).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0300start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensionthirdtest', - abilityName: 'com.acts.actsinterfacemultiusersextensionthirdtest.ServiceAbility' - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - setTimeout(()=>{ - done() - },1000) - } - - function timeout() { - console.debug('in ACTS_ThirdPartyExtensionTerminateSelf_0300 timeout'); - if(flag == true) { - expect().assertFail(); - console.debug('ACTS_ThirdPartyExtensionTerminateSelf_0300 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - - }) - /* - * @tc.number : ACTS_ThirdPartyExtensionTerminateSelf_0400 - * @tc.name : Use terminateself to terminate ability - * @tc.desc : Starting mainability2 with startAbility then terminateself ability failed.(callback) - */ - it('ACTS_ThirdPartyExtensionTerminateSelf_0400', 0, async function (done) { - let Subscriber - var flag = true - var startresult = false - globalThis.startnum = 12 - console.log('====>globalThis.startnum is====>' + globalThis.startnum); - function SubscribeCallBack (err, data) { - expect().assertFail(); - expect(data.event == "ACTS_TerminateSelf_CommonEvent").assertTrue(); - console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); - if(data.event == "ACTS_TerminateSelf_CommonEvent"){ - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - globalThis.abilityContext.disconnectServiceExtensionAbility(globalThis.number).then((data)=>{ - console.debug("====>data is====>" + JSON.stringify(data)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(()=>{ - done(); - },1000) - } - function onConnectCallback(element, remote) { - console.log('ACTS_ThirdPartyExtensionTerminateSelf_0400 onConnectCallback====> element=' - + JSON.stringify(element)); - console.log('ACTS_ThirdPartyExtensionTerminateSelf_0400 onConnectCallback====> remote=' - + JSON.stringify(remote)); - setTimeout(()=> { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if(flag == true) { - console.debug('ACTS_ThirdPartyExtensionTerminateSelf_0400 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - commonEvent.createSubscriber(subscriberInfo_MainAbility2).then(async (data) => { - console.debug("====>Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo)=>{ - console.debug("====>SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>0400start connectAbility====>"); - globalThis.number = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: 'com.acts.actsinterfacemultiusersextensionthirdtest', - abilityName: 'com.acts.actsinterfacemultiusersextensionthirdtest.ServiceAbility' - },{ - onConnect:onConnectCallback, - onDisconnect:onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - }) -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 3a84309ab20a5fdffbd08c23ea8f50735b79ef54..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,20 +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 './Ability.test.ets' - -export default function testsuite() { - console.debug("====>in list.test====>"); - abilityTest() -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/module.json b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/module.json deleted file mode 100644 index 90713d43e62ab49c68b0a6a69b9f7066982acdc4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/module.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.acts.actsinterfacemultiusersextensionthirdtest.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" - ] - } - ] - }, - { - "name": "com.acts.actsinterfacemultiusersextensionthirdtest.MainAbility2", - "srcEntrance": "./ets/MainAbility2/MainAbility2.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait" - } - ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "name": "com.acts.actsinterfacemultiusersextensionthirdtest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - }, - { - "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", - "name": "com.acts.actsinterfacemultiusersextensionthirdtest.ServiceAbility2", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } - ], - "requestPermissions": [ - { - "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND", - "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND" - }, - { - "name":"ohos.permission.START_INVISIBLE_ABILITY", - "reason":"need use ohos.permission.START_INVISIBLE_ABILITY" - } - ] - } -} diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index f03b06594a7d47bd569242c9a9871cd1e11c2d52..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/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/ActsAmsUsersExtensionThirdTest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 010134e5cdcb46ef62097816f127dac0bb93a398..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index/index", - "MainAbility/pages/second/second" - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/signature/openharmony_sx.p7b deleted file mode 100644 index dcec6c9615032c1b48bf185e839d9720dd68aab0..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/ActsAmsUsersExtensionThirdTest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/module.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/module.json index 67b2c81304620a18022d475a056dc31cbf211b2f..9379d6be57731bdf237090b39f3214471960eefe 100644 --- a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/module.json +++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/entry/src/main/module.json @@ -6,8 +6,8 @@ "description": "$string:phone_entry_dsc", "mainElement": "MainAbility", "deviceTypes": [ - "default", - "tablet" + "default", + "tablet" ], "deliveryWithInstall": true, "installationFree": false, diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/signature/openharmony_sx.p7b index f06e218defa7f707e22a3890903c574e1c498217..7607e5e8c608720878fb57de2b9f7b40246b3b5b 100644 Binary files a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/signature/openharmony_sx.p7b and b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/module.json b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/module.json index 548836f3aea379c4abf1763d26fe26327dbfbe15..4c0f769d9cce9fc77350d241db82b7deb03cb443 100644 --- a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/module.json +++ b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/entry/src/main/module.json @@ -6,8 +6,8 @@ "description": "$string:phone_entry_dsc", "mainElement": "MainAbility", "deviceTypes": [ - "default", - "tablet" + "default", + "tablet" ], "deliveryWithInstall": true, "installationFree": false, diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/signature/openharmony_sx.p7b index f06e218defa7f707e22a3890903c574e1c498217..c6cd54a6a35b45cb5fb1e0edb1522bab4d228dcd 100644 Binary files a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/signature/openharmony_sx.p7b and b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppB/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/signature/openharmony_sx.p7b index f06e218defa7f707e22a3890903c574e1c498217..43c8c615b835cdf974817cb7eb11fbb7d195385b 100644 Binary files a/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/signature/openharmony_sx.p7b and b/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppC/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index c12571f077e3f3d2e4624c7904bd78811c477c18..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /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 ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' -import commonEvent from "@ohos.commonEvent" -import rpc from '@ohos.rpc'; - -export default class ServiceAbility extends ServiceExtensionAbility { - onCreate(want) { - console.log('ServiceAbility onCreate'); - } - onDestory(){ - console.log('ServiceAbility onDestory'); - } - onRequest(want,startId) { - console.log('ServiceAbility onRequest'); - commonEvent.publish("ACTS_InterfaceMultiUsers_0100_Start_CommonEvent", () => { - console.log(" Publish ACTS_InterfaceMultiUsersExtension_CommonEvent callback") - this.context.terminateSelf().then(()=>{ - console.log(" terminateSelf callback") - }) - }) - } - - onConnect(want) { - console.log('ServiceAbility onConnect'); - return new rpc.RemoteObject('connect'); - } - - onDisconnect(want) { - console.log('ServiceAbility onDisconnect'); - } - - onDestroy() { - console.log('ServiceAbility onDestroy'); - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/module.json b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/module.json index 5f645cbbf8093e4b8ec1db4fe9fbe70b0d916a7b..a2aab205623dcfced0e7474f2413c8ac436e14f1 100644 --- a/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/module.json +++ b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/entry/src/main/module.json @@ -52,17 +52,6 @@ "orientation": "portrait" } ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "name": "com.acts.actsinterfacemultiuserstest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } - ], "defPermissions": [ { "availableScope": [], @@ -76,54 +65,22 @@ } ], "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.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.MANAGE_LOCAL_ACCOUNTS", - "reason": "need use ohos.permission.MANAGE_LOCAL_ACCOUNTS" - }, - { - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION", - "reason": "need use ohos.permission.MANAGE_LOCAL_ACCOUNTS" - }, - { - "name":"ohos.permission.START_ABILITIES_FROM_BACKGROUND", - "reason":"need use ohos.permission.START_ABILITIES_FROM_BACKGROUND" - }, - { - "name":"ohos.permission.START_INVISIBLE_ABILITY", - "reason":"need use ohos.permission.START_INVISIBLE_ABILITY" - } + { + "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO", + "reason": "need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + }, + { + "name": "ohos.permission.GET_RUNNING_INFO", + "reason": "need use ohos.permission.GET_RUNNING_INFO" + } ] } } diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/signature/openharmony_sx.p7b index dcec6c9615032c1b48bf185e839d9720dd68aab0..b181c98738527ac0d1676a50ebfb0e318f024c3d 100644 Binary files a/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/signature/openharmony_sx.p7b and b/ability/ability_runtime/actsusers/ActsAmsUsersSystemTest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/actsusers/ActsAmsUsersThirdTest/signature/openharmony_sx_thirdparty.p7b b/ability/ability_runtime/actsusers/ActsAmsUsersThirdTest/signature/openharmony_sx_thirdparty.p7b index f06e218defa7f707e22a3890903c574e1c498217..7f7133cc6530e75d25ea3c10651c2acec9fbe99f 100644 Binary files a/ability/ability_runtime/actsusers/ActsAmsUsersThirdTest/signature/openharmony_sx_thirdparty.p7b and b/ability/ability_runtime/actsusers/ActsAmsUsersThirdTest/signature/openharmony_sx_thirdparty.p7b differ diff --git a/ability/ability_runtime/actsusers/BUILD.gn b/ability/ability_runtime/actsusers/BUILD.gn index 48b6afef0c6d58085b7e0f7b50022c80fea8bbe8..05fab2101f3da91a8ae7e6030128418d9054d0fe 100644 --- a/ability/ability_runtime/actsusers/BUILD.gn +++ b/ability/ability_runtime/actsusers/BUILD.gn @@ -18,15 +18,11 @@ group("actsusers") { if (is_standard_system) { deps = [ "ActsAmsUsersApi7AppA:ActsAmsUsersApi7AppA", - "ActsAmsUsersExtensionSystemTest:ActsAmsUsersExtensionSystemTest", - "ActsAmsUsersExtensionThirdTest:ActsAmsUsersExtensionThirdTest", "ActsAmsUsersKillProcessAppA:ActsAmsUsersKillProcessAppA", "ActsAmsUsersKillProcessAppB:ActsAmsUsersKillProcessAppB", "ActsAmsUsersKillProcessAppC:ActsAmsUsersKillProcessAppC", "ActsAmsUsersSystemTest:ActsAmsUsersSystemTest", "ActsAmsUsersThirdTest:ActsAmsUsersThirdTest", - "actsconnectabilitysystemabilitytest:ActsConnectAbilitySystemAbilityTest", - "actsmanyuserthirdabilitytest:ActsManyUsersAbilityTest", ] } } diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/AppScope/app.json b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/AppScope/app.json deleted file mode 100644 index 1a44bb9e690d0089cd5b7407bcb41183ba2838c8..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsconnectabilitysystemabilitytest", - "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/actsconnectabilitysystemabilitytest/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/AppScope/resources/base/element/string.json deleted file mode 100644 index 0d3507c0d180557b94bc5f0071ba146b4909fe51..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/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/actsconnectabilitysystemabilitytest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/BUILD.gn b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/BUILD.gn deleted file mode 100644 index 74548f078efc8177989886998ecf77dd7a9e3e2a..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/BUILD.gn +++ /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("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsConnectAbilitySystemAbilityTest") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":actsconnectabilitysystemabilitytest_js_assets", - ":actsconnectabilitysystemabilitytest_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsConnectAbilitySystemAbilityTest" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("actsconnectabilitysystemabilitytest_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actsconnectabilitysystemabilitytest_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("actsconnectabilitysystemabilitytest_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":actsconnectabilitysystemabilitytest_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/Test.json b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/Test.json deleted file mode 100644 index 59844f8e02a2864c6c39e214cd10d6dd2dbbffef..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/Test.json +++ /dev/null @@ -1,33 +0,0 @@ - -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "300000", - "bundle-name": "com.example.actsconnectabilitysystemabilitytest", - "module-name":"phone", - "shell-timeout": "300000", - "testcase-timeout": "30000" - }, - "kits": [ - { - "type": "ShellKit", - "run-command": [ - "acm create -n 101 -t normal", - "acm switch -i 101" - ], - "teardown-command":[ - "acm switch -i 101", - "acm delete -i 101" - ] - }, - { - "test-file-name": [ - "ActsConnectAbilitySystemAbilityTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - ] -} - diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index bd7db9a9b53d06a4fd6b34944fd9168b0707cee9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/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.app.ability.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/actsconnectabilitysystemabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 9d3458840109be00d5ad0b55df3c13f22869d4e3..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/MainAbility/MainAbility.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 Ability from '@ohos.app.ability.UIAbility' - -export default class MainAbility extends Ability { - onCreate(want,launchParam){ - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - globalThis.abilityWant = want; - } - - 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") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "MainAbility/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") - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/MainAbility/pages/index/index.ets b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/MainAbility/pages/index/index.ets deleted file mode 100644 index 5a7b56cd65dee907f5d21f00139c9c4158d58d4f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/MainAbility/pages/index/index.ets +++ /dev/null @@ -1,42 +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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../../../test/List.test' -import router from '@ohos.router' - -@Entry -@Component -struct Index { - aboutToAppear() { - console.info("start run testcase!!!!") - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - - } - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('MainAbility') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/MainAbility/pages/second/second.ets b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/MainAbility/pages/second/second.ets deleted file mode 100644 index caa9f1c5fbc706c60414d23f0be4cbadeb8ee346..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/MainAbility/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/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index b6d7515c05b17403eed25d20c133c67d6e80c1f4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,205 +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 commonEvent from '@ohos.commonEvent' -import ServiceExtension from '@ohos.application.ServiceExtensionAbility' -import rpc from '@ohos.rpc'; -var conn = -1; -function publishCallBackOne() { - console.log("========Publish CallBack AMS_ConnectAbility_0100_commonEvent========"); -} -function publishCallBackTwo() { - console.log("========Publish CallBack AMS_ConnectAbility_0200_commonEvent========"); -} -function publishCallBackThree() { - console.log("========Publish CallBack AMS_ConnectAbility_0300_commonEvent========"); -} -function publishCallBackFour() { - console.log("========Publish CallBack AMS_ConnectAbility_0400_commonEvent========"); -} -function publishCallBackFive() { - console.log("========Publish CallBack AMS_ConnectAbility_0500_commonEvent========"); -} -function publishCallBackSix() { - console.log("========Publish CallBack AMS_ConnectAbility_0600_commonEvent========"); -} -function publishCallBackzero() { - console.log("========Publish CallBack AMSc_disonnectAbility_0100_commonEvent========"); -} -function publishCallBackttwo() { - console.log("========Publish CallBack AMSc_disonnectAbility_0200_commonEvent========"); -} - -function onConnectCallback(element, remote) { - console.log('onConnectCallback====> element=' + JSON.stringify(element)); - console.log('onConnectCallback====> remote=' + JSON.stringify(remote)); -} - -function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); -} - -function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) -} - -export default class ServiceAbility 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); - let extensionContext = this.context - if (want.action == "one") { - commonEvent.publish("AMS_ConnectAbility_0100_commonEvent", publishCallBackOne); - } - ; - if (want.action == "two") { - commonEvent.publish("AMS_ConnectAbility_0200_commonEvent", publishCallBackTwo); - } - ; - if (want.action == "Three") { - commonEvent.publish("AMS_ConnectAbility_0300_commonEvent", publishCallBackThree); - } - ; - if (want.action == "Four") { - commonEvent.publish("AMS_ConnectAbility_0400_commonEvent", publishCallBackFour); - } - ; - if (want.action == "Five") { - commonEvent.publish("AMS_ConnectAbility_0500_commonEvent", publishCallBackFive); - } - ; - if (want.action == "Six") { - commonEvent.publish("AMS_ConnectAbility_0600_commonEvent", publishCallBackSix); - } - ; - if (want.action == "Seven") { - extensionContext.connectAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility2", - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - } - ); - }; - if (want.action == "Eight") { - extensionContext.connectAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility3", - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - } - ); - }; - if (want.action == "Nine") { - console.log('connectAbility 111'); - let num = extensionContext.connectAbility( - { - bundleName: 'com.example.actsconnectabilitysystemabilitytest', - abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - setTimeout(() => { - extensionContext.disconnectAbility(num).then(() => { - console.log('in disconnectAbility'); - }) - }, 1000) - - }; - if (want.action == "Ten") { - console.log('connectAbility 222'); - let num = extensionContext.connectAbility( - { - bundleName: 'com.example.actsconnectabilitysystemabilitytest', - abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - setTimeout(() => { - extensionContext.disconnectAbility(num).then(() => { - console.log('in disconnectAbility2'); - }) - }, 1000) - - }; - if (want.action == "Ten one") { - console.log('connectAbility 333'); - let num = extensionContext.connectAbility( - { - bundleName: 'com.example.actsconnectabilitysystemabilitytest', - abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - setTimeout(() => { - extensionContext.disconnectAbility(2222).then(() => { - console.log('in disconnectAbility3'); - }) - }, 1000) - - }; - if (want.action == "Ten two") { - console.log('connectAbility 444'); - let num = extensionContext.connectAbility( - { - bundleName: 'com.example.actsconnectabilitysystemabilitytest', - abilityName: 'com.example.actsconnectabilitysystemabilitytest.ServiceAbility2' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - setTimeout(() => { - extensionContext.disconnectAbility(2222).then(() => { - console.log('in disconnectAbility4'); - }) - }, 1000) - - }; - return new rpc.RemoteObject('connect'); - } - - onDisconnect(want) { - console.log('ServiceAbility onDisconnect, want:' + want.abilityName); - commonEvent.publish("AMSc_disonnectAbility_0100_commonEvent", publishCallBackzero); - commonEvent.publish("AMSc_disonnectAbility_0200_commonEvent", publishCallBackttwo); - } - - onDestroy() { - console.log('ServiceAbility onDestroy'); - } -} - diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility/service.ts deleted file mode 100644 index b49731a414958a281c2f0c4eab0e7fb408eb2c2f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/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/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts deleted file mode 100644 index be37720dc7d68cd89fcc51c895a467bf89079cc1..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts +++ /dev/null @@ -1,61 +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 ServiceExtension from '@ohos.application.ServiceExtensionAbility' -import commonEvent from "@ohos.commonEvent" -import rpc from '@ohos.rpc'; -export default class ServiceAbility2 extends ServiceExtension { - onCreate(want) { - console.log('ServiceAbility2 onCreate'); - globalThis.abilityWant = want; - } - - onDestory(){ - console.log('ServiceAbility2 onDestory'); - } - - onRequest(want,startId) { - console.log('ServiceAbility2 onRequest'); - } - - onConnect(want) { - console.log('ServiceAbility2 onConnect'); - commonEvent.publish("AMS_ConnectAbility_0700_commonEvent", () => { - console.log("publish Publish AMS_ConnectAbility_0700_commonEvent callback"); - }) - commonEvent.publish("AMS_ConnectAbility_0900_commonEvent", () => { - console.log("publish Publish AMS_ConnectAbility_0900_commonEvent callback"); - }) - commonEvent.publish("AMS_ConnectAbility_1000_commonEvent", () => { - console.log("publish Publish AMS_ConnectAbility_1000_commonEvent callback"); - }) - commonEvent.publish("AMS_ConnectAbility_1100_commonEvent", () => { - console.log("publish Publish AMS_ConnectAbility_1100_commonEvent callback"); - }) - commonEvent.publish("AMS_ConnectAbility_1200_commonEvent", () => { - console.log("publish Publish AMS_ConnectAbility_1200_commonEvent callback"); - }) - return new rpc.RemoteObject('connect'); - } - - - onDisconnect(want) { - console.log('ServiceAbility2 onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ServiceAbility2 onDestroy'); - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility2/service.ts b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/ServiceAbility2/service.ts deleted file mode 100644 index 340a610cb718c70c98add0b5d052bb4589185174..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/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/actsconnectabilitysystemabilitytest/entry/src/main/ets/TestAbility/TestAbility.ts b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/TestAbility/TestAbility.ts deleted file mode 100644 index 4f101c99c1576a3b8a17594f6feaaf063a917b5f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/TestAbility/TestAbility.ts +++ /dev/null @@ -1,51 +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.app.ability.UIAbility' - -export default class TestAbility extends Ability { - onCreate(want, launchParam) { - console.log('TestAbility onCreate') - } - - onDestroy() { - console.log('TestAbility onDestroy') - } - - onWindowStageCreate(windowStage) { - console.log('TestAbility onWindowStageCreate') - windowStage.loadContent("TestAbility/pages/index", (err, data) => { - if (err.code) { - console.error('Failed to load the content. Cause:' + JSON.stringify(err)); - return; - } - console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data)) - }); - - globalThis.abilityContext = this.context; - } - - onWindowStageDestroy() { - console.log('TestAbility onWindowStageDestroy') - } - - onForeground() { - console.log('TestAbility onForeground') - } - - onBackground() { - console.log('TestAbility onBackground') - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/TestAbility/pages/index.ets b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/TestAbility/pages/index.ets deleted file mode 100644 index fae969f985ff5bf7432de71e36c792364ebac1f6..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/TestAbility/pages/index.ets +++ /dev/null @@ -1,48 +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 '@ohos.router'; - -@Entry -@Component -struct Index { - aboutToAppear() { - console.info('TestAbility index aboutToAppear') - } - @State message: string = 'Hello World' - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(20) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('35%') - .height('5%') - .onClick(()=>{ - }) - } - .width('100%') - } - .height('100%') - } - } \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 764da81c43c1e9c379697d92068c79604eb7fb7c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,78 +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 TestRunner from '@ohos.application.testRunner' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -var abilityDelegator = undefined -var abilityDelegatorArguments = undefined - -function translateParamsToString(parameters) { - const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s it', - '-s level', '-s testType', '-s size', '-s timeout', - '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` - } - } - return targetParams.trim() -} - -async function onAbilityCreateCallback() { - console.log("onAbilityCreateCallback"); -} - -async function addAbilityMonitorCallback(err: any) { - console.info("addAbilityMonitorCallback : " + JSON.stringify(err)) -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - console.info("OpenHarmonyTestRunner OnPrepare ") - } - - async onRun() { - console.log('OpenHarmonyTestRunner onRun run') - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility' - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a com.example.actsconnectabilitysystemabilitytest.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + d.stdResult); - console.info('executeShellCommand : data : ' + d.exitCode); - }) - console.info('OpenHarmonyTestRunner onRun end') - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 28df98361684afa7098165888c1e1a088d291475..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,18 +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() { - abilityTest() -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/manyusersabilitytest.test.ets b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/manyusersabilitytest.test.ets deleted file mode 100644 index 7a2c4a0a5f558cb21124546942a79b521cc76d3f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/ets/test/manyusersabilitytest.test.ets +++ /dev/null @@ -1,838 +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 "@ohos/hypium" -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"], -}; -var subscriberInfoStartAbility_0500 = { - events: ["AMS_ConnectAbility_0500_commonEvent"], -}; -var subscriberInfoStartAbility_0600 = { - events: ["AMS_ConnectAbility_0600_commonEvent"], -}; -var subscriberInfoStartAbility_0700 = { - events: ["AMS_ConnectAbility_0700_commonEvent"], -}; -var subscriberInfoStartAbility_0800 = { - events: ["AMS_ConnectAbility_0800_commonEvent"], -}; -var subscriberInfoStartAbility_0900 = { - events: ["AMS_ConnectAbility_0900_commonEvent"], -}; - -var subscriberInfoStartAbility_1000 = { - events: ["AMS_ConnectAbility_1000_commonEvent"], -}; - -var subscriberInfoStartAbility_1100 = { - events: ["AMS_ConnectAbility_1100_commonEvent"], -}; - -var subscriberInfoStartAbility_1200 = { - events: ["AMS_ConnectAbility_1200_commonEvent"], -}; -var unsubscriberInfoStartAbility_0100 = { - events: ["AMSc_disonnectAbility_0100_commonEvent"], -}; -var unsubscriberInfoStartAbility_0200 = { - events: ["AMSc_disonnectAbility_0200_commonEvent"], -}; - - -const START_ABILITY_TIMEOUT = 1000; -globalThis.number = 0; - -export default function abilityTest() { - describe('ActssystemabilityTest', function () { - - /* - * @tc.number: ACTS_ConnectAbility_0100 - * @tc.name: Connects a service ability - * @tc.desc: Connects a service ability - */ - it('ACTS_ConnectAbility_0100', 0, async function (done) { - console.log('ACTS_ConnectAbility_0100====ACTS_ConnectAbility_0100 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0100_commonEvent"); - console.debug("====>ACTS_ConnectAbility_0100 5 "); - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ConnectAbility_0100 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - - } - - commonEvent.createSubscriber(subscriberInfoStartAbility_0100).then(async (data) => { - console.debug("====>ACTS_ConnectAbility_0100 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - done(); - } - - function timeout() { - expect().assertFail(); - console.debug('AMS_ConnectAbility_0100 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - function onConnectCallback(element, remote) { - console.debug('ACTS_ConnectAbility_0100 _onConnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - console.debug('ACTS_ConnectAbility_0100 _onConnectCallback ====> remote=' - + JSON.stringify(remote) + " , " + remote); - } - - function onDisconnectCallback(element) { - console.debug('ACTS_ConnectAbility_0100 _onDisconnectCallback ====> element=' - + JSON.stringify(element) + " , " + element); - } - - function onFailedCallback(code) { - console.debug('ACTS_ConnectAbility_0100 _onFailedCallback ====> code=' - + JSON.stringify(code) + " , " + code) - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ConnectAbility_0100 3 "); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "one", - }, - { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - } - ); - console.debug("====>ACTS_ConnectAbility_0100 4 "); - }) - - /* - * @tc.number: ACTS_ConnectAbility_0200 - * @tc.name: Connects a service ability - * @tc.desc: Connects a service ability - */ - it('ACTS_ConnectAbility_0200', 0, async function (done) { - console.log('ACTS_ConnectAbility_0200====Subscribe CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0200_commonEvent"); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_0200).then(async (data) => { - console.debug("====>Create Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack====>"); - done(); - } - function timeout() { - console.debug('AMS_ConnectAbility_0200 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbilityone", - action: "two", - }, - { - onFailed: onFailedCallback, - }, - ); - }) - - /* - * @tc.number: ACTS_DisconnectAbility_0100 - * @tc.name: DisConnects a service ability - * @tc.desc: DisConnects a service ability - */ - it('ACTS_DisconnectAbility_0100', 0, async function (done) { - console.log('ACTS_DisconnectAbility_0100====ACTS_DisconnectAbility_0100 5 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - console.debug("====>ACTS_DisconnectAbility_0100 6====>"); - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_DisconnectAbility_0100 6====>"); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_0300).then(async (data) => { - console.debug("====>ACTS_DisconnectAbility_0100 2 Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack====>"); - setTimeout(() => { - done() - }, 1000) - }; - function timeout() { - expect().assertFail(); - console.debug('AMS_DonnectAbility_0300 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_DisconnectAbility_0100 3====>"); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "Three", - }, - ); - console.debug("====>ACTS_DisconnectAbility_0100 4====>"); - }) - - /* - * @tc.number: ACTS_DisconnectAbility_0200 - * @tc.name: DisConnects a service ability - * @tc.desc: DisConnects a service ability - */ - it('ACTS_DisconnectAbility_0200', 0, async function (done) { - console.log('ACTS_DisconnectAbility_0200 1====ACTS_DisconnectAbility_0200 3 CallBack1 data:====>" + JSON.stringify(data)); - commonEvent.createSubscriber(unsubscriberInfoStartAbility_0100).then(async (data) => { - console.debug("====>ACTS_DisconnectAbility_0200 6 Subscriber====>"); - subscriberdisconnect = data; - await commonEvent.subscribe(subscriberdisconnect, subscribedisconnectback); - console.debug("====>ACTS_DisconnectAbility_0200 1111 connectAbility1====>"); - - console.debug("====>ACTS_DisconnectAbility_0200 1111 connectAbility2====>"); - console.debug("====>ACTS_DisconnectAbility_0200 66 Subscriber====>"); - globalThis.abilityContext.disconnectServiceExtensionAbility( - 999, - (error, data) => { - console.log('ACTS_DisconnectAbility_0200 5 DisconnectAbility result errCode : ' - + error.code + " data: " + data) - }); - }) - } - function subscribedisconnectback(err, data) { - console.debug("====>ACTS_DisconnectAbility_0200 7 CallBack2 data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(subscriberdisconnect, () => { - console.debug('unsubscribe subscriberdisconnect'); - commonEvent.unsubscribe(subscriber, () => { - console.debug('unsubscribe subscriber') - clearTimeout(id); - expect().assertFail(); - done(); - }) - }) - } - function timeout() { - console.debug('ACTS_DisconnectAbility_0200 8 timeout'); - commonEvent.unsubscribe(subscriberdisconnect, () => { - console.debug('unsubscribe subscriberdisconnect'); - commonEvent.unsubscribe(subscriber, () => { - console.debug('unsubscribe subscriber') - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('ACTS_DisconnectAbility_0200 9 DisconnectAbility result errCode : ' - + error.code + " data: " + data) - console.debug("====>ACTS_DisconnectAbility_0200 99 Subscriber====>"); - setTimeout(() => { - done(); - }, 1000) - }); - }) - }) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_0400).then(async (data) => { - console.debug("====>ACTS_DisconnectAbility_0200 10 Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack) - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "Four", - }, - ); - console.debug("====>connId is:====>" + JSON.stringify(connId)); - console.debug("====>ACTS_DisconnectAbility_0200 1010 Subscriber====>"); - }) - function unSubscribeCallback() { - console.debug("====>ACTS_DisconnectAbility_0200 1111 UnSubscribe CallBack====>"); - done(); - } - }) - - /* - * @tc.number: ACTS_DisconnectAbility_0300 - * @tc.name: DisConnects a service ability - * @tc.desc: DisConnects a service ability - */ - it('ACTS_DisconnectAbility_0300', 0, async function (done) { - console.log('ACTS_DisconnectAbility_0300====ACTS_DisconnectAbility_0300 4 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0500_commonEvent"); - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('ACTS_DisconnectAbility_0300 5 DisconnectAbility result errCode : ' - + error.code + " data: " + data) - } - ); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_0500).then(async (data) => { - console.debug("====>ACTS_DisconnectAbility_0300 1 Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - function unSubscribeCallback() { - console.debug("====>ACTS_DisconnectAbility_0300 6 CallBack====>"); - setTimeout(() => { - done(); - }, 1000) - } - function timeout() { - expect().assertFail(); - console.debug('AMS_ConnectAbility_0500 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('ACTS_DisconnectAbility_0300 7 DisconnectAbility result errCode : ' - + error.code + " data: " + data) - }); - } - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_DisconnectAbility_0300 3 "); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "Five", - }, - ); - console.debug("====>ACTS_DisconnectAbility_0300 4 "); - }) - - /* - * @tc.number: ACTS_DisconnectAbility_0400 - * @tc.name: DisConnects a service ability - * @tc.desc: DisConnects a service ability - */ - it('ACTS_DisconnectAbility_0400', 0, async function (done) { - console.log('ACTS_DisconnectAbility_0400 1====ACTS_DisconnectAbility_0400 3 CallBack1 data:====>" + JSON.stringify(data)); - commonEvent.createSubscriber(unsubscriberInfoStartAbility_0200).then(async (data) => { - console.debug("====>ACTS_DisconnectAbility_0400 6 Subscriber====>"); - subscriberdisconnect = data; - await commonEvent.subscribe(subscriberdisconnect, subscribedisconnectback); - console.debug("====>ACTS_DisconnectAbility_0400 1111 connectAbility1====>"); - - console.debug("====>ACTS_DisconnectAbility_0400 1111 connectAbility2====>"); - console.debug("====>ACTS_DisconnectAbility_0400 66 Subscriber====>"); - globalThis.abilityContext.disconnectServiceExtensionAbility( - 999, - (error, data) => { - console.log('ACTS_DisconnectAbility_0400 5 DisconnectAbility result errCode : ' - + error.code + " data: " + data) - }); - }) - } - function subscribedisconnectback(err, data) { - console.debug("====>ACTS_DisconnectAbility_0400 7 CallBack2 data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(subscriberdisconnect, () => { - console.debug('unsubscribe subscriberdisconnect'); - commonEvent.unsubscribe(subscriber, () => { - console.debug('unsubscribe subscriber') - clearTimeout(id); - expect().assertFail(); - done(); - }) - }) - } - function timeout() { - console.debug('ACTS_DisconnectAbility_0400 8 timeout'); - commonEvent.unsubscribe(subscriberdisconnect, () => { - console.debug('unsubscribe subscriberdisconnect'); - commonEvent.unsubscribe(subscriber, () => { - console.debug('unsubscribe subscriber') - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('ACTS_DisconnectAbility_0400 9 DisconnectAbility result errCode : ' - + error.code + " data: " + data) - console.debug("====>ACTS_DisconnectAbility_0400 99 Subscriber====>"); - setTimeout(() => { - done(); - }, 1000) - }); - }) - }) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_0600).then(async (data) => { - console.debug("====>ACTS_DisconnectAbility_0400 10 Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack) - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "Six", - }, - ); - console.debug("====>connId is:====>" + JSON.stringify(connId)); - console.debug("====>ACTS_DisconnectAbility_0400 1010 Subscriber====>"); - }) - function unSubscribeCallback() { - console.debug("====>ACTS_DisconnectAbility_0400 1111 UnSubscribe CallBack====>"); - done(); - } - }) - - /* - * @tc.number: ACTS_ExtensionConnectAbility_0100 - * @tc.name: Service connect a service ability - * @tc.desc: Service connect a service ability - */ - it('ACTS_ExtensionConnectAbility_0100', 0, async function (done) { - console.log('ACTS_ExtensionConnectAbility_0100====ACTS_ExtensionConnectAbility_0100 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0700_commonEvent"); - console.debug("====>ACTS_ExtensionConnectAbility_0100 5 "); - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ExtensionConnectAbility_0100 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_0700).then(async (data) => { - console.debug("====>ACTS_ExtensionConnectAbility_0100 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - function timeout() { - expect().assertFail(); - console.debug('ACTS_ExtensionConnectAbility_0100 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ExtensionConnectAbility_0100 3 "); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "Seven", - }, - ); - console.debug("====>ACTS_ExtensionConnectAbility_0100 4 "); - }) - - /* - * @tc.number: ACTS_ExtensionConnectAbility_0200 - * @tc.name: Service connect a service ability - * @tc.desc: Service connect a service ability - */ - it('ACTS_ExtensionConnectAbility_0200', 0, async function (done) { - console.log('ACTS_ExtensionConnectAbility_0200====ACTS_ExtensionConnectAbility_0200 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0800_commonEvent"); - console.debug("====>ACTS_ExtensionConnectAbility_0200 5 "); - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ExtensionConnectAbility_0200 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_0800).then(async (data) => { - console.debug("====>ACTS_ExtensionConnectAbility_0200 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - function timeout() { - console.debug('ACTS_ExtensionConnectAbility_0200 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ExtensionConnectAbility_0200 3 "); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "Eight", - }, - ); - console.debug("====>ACTS_ExtensionConnectAbility_0200 4 "); - }) - - /* - * @tc.number: ACTS_ExtensionDisconnectAbility_0100 - * @tc.name: Service disConnects a service ability - * @tc.desc: Service disConnects a service ability - */ - it('ACTS_ExtensionDisconnectAbility_0100', 0, async function (done) { - console.log('ACTS_ExtensionDisconnectAbility_0100====ACTS_ExtensionDisconnectAbility_0100 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0900_commonEvent"); - console.debug("====>ACTS_ExtensionDisconnectAbility_0100 5 "); - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ExtensionDisconnectAbility_0100 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_0900).then(async (data) => { - console.debug("====>ACTS_ExtensionDisconnectAbility_0100 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - function timeout() { - expect().assertFail(); - console.debug('ACTS_ExtensionDisconnectAbility_0100 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ExtensionDisconnectAbility_0100 3 "); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "Nine", - }, - ); - console.debug("====>ACTS_ExtensionDisconnectAbility_0100 4 "); - }) - - /* - * @tc.number: ACTS_ExtensionDisconnectAbility_0200 - * @tc.name: Service disConnects a service ability - * @tc.desc: Service disConnects a service ability - */ - it('ACTS_ExtensionDisconnectAbility_0200', 0, async function (done) { - console.log('ACTS_ExtensionDisconnectAbility_0200====ACTS_ExtensionDisconnectAbility_0200 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_1000_commonEvent"); - console.debug("====>ACTS_ExtensionDisconnectAbility_0200 5 "); - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ExtensionDisconnectAbility_0200 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_1000).then(async (data) => { - console.debug("====>ACTS_ExtensionDisconnectAbility_0200 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - function timeout() { - expect().assertFail(); - console.debug('ACTS_ExtensionDisconnectAbility_0200 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ExtensionDisconnectAbility_0200 3 "); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "Ten", - }, - ); - console.debug("====>ACTS_ExtensionDisconnectAbility_0200 4 "); - }) - - /* - * @tc.number: ACTS_ExtensionDisconnectAbility_0300 - * @tc.name: Service disConnects a service ability - * @tc.desc: Service disConnects a service ability - */ - it('ACTS_ExtensionDisconnectAbility_0300', 0, async function (done) { - console.log('ACTS_ExtensionDisconnectAbility_0300====ACTS_ExtensionDisconnectAbility_0300 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_1100_commonEvent"); - console.debug("====>ACTS_ExtensionDisconnectAbility_0300 5 "); - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ExtensionDisconnectAbility_0300 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_1100).then(async (data) => { - console.debug("====>ACTS_ExtensionDisconnectAbility_0300 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - function timeout() { - console.debug('ACTS_ExtensionDisconnectAbility_0300 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ExtensionDisconnectAbility_0300 3 "); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "Ten one", - }, - ); - console.debug("====>ACTS_ExtensionDisconnectAbility_0300 4 "); - }) - - /* - * @tc.number: ACTS_ExtensionDisconnectAbility_0400 - * @tc.name: Service disConnects a service ability - * @tc.desc: Service disConnects a service ability - */ - it('ACTS_ExtensionDisconnectAbility_0400', 0, async function (done) { - console.log('ACTS_ExtensionDisconnectAbility_0400====ACTS_ThirdPartyExtensionDisconnectAbility_0400 7 CallBack data:====>" - + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_1200_commonEvent"); - console.debug("====>ACTS_ExtensionDisconnectAbility_0400 5 "); - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ExtensionDisconnectAbility_0400 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - commonEvent.createSubscriber(subscriberInfoStartAbility_1200).then(async (data) => { - console.debug("====>ACTS_ExtensionDisconnectAbility_0400 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - function timeout() { - console.debug('ACTS_ExtensionDisconnectAbility_0400 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ExtensionDisconnectAbility_0400 3 "); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsconnectabilitysystemabilitytest", - abilityName: "com.example.actsconnectabilitysystemabilitytest.ServiceAbility", - action: "Ten two", - }, - ); - console.debug("====>ACTS_ExtensionDisconnectAbility_0400 4 "); - }) - }) -} - - diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/module.json b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/module.json deleted file mode 100644 index 6b6a01d7dfe29e1f7a6501174ef95de20df20f9d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/module.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.actsconnectabilitysystemabilitytest.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.actsconnectabilitysystemabilitytest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - }, - { - "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", - "name": "com.example.actsconnectabilitysystemabilitytest.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.MANAGE_LOCAL_ACCOUNTS", - "reason": "ceshi" - }, - { - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION", - "reason": "ceshi" - }, - { - "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/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 376647878b379044fa3300dfa4662c98a4c3efbc..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/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/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 010134e5cdcb46ef62097816f127dac0bb93a398..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index/index", - "MainAbility/pages/second/second" - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/signature/openharmony_sx.p7b deleted file mode 100644 index dcec6c9615032c1b48bf185e839d9720dd68aab0..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/actsconnectabilitysystemabilitytest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/AppScope/app.json b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/AppScope/app.json deleted file mode 100644 index b1b238029879b38f307ef03222eaf46089585039..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsmanyusersabilitytest", - "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/actsmanyuserthirdabilitytest/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/AppScope/resources/base/element/string.json deleted file mode 100644 index be09cccde1bc7369ef47a5cd45d2b06884c88602..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/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/actsmanyuserthirdabilitytest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/BUILD.gn b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/BUILD.gn deleted file mode 100644 index ee2bf8f463485e77193941b45263f474a201b746..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/BUILD.gn +++ /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("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsManyUsersAbilityTest") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":actsmanyusersabilitytest_js_assets", - ":actsmanyusersabilitytest_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsManyUsersAbilityTest" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("actsmanyusersabilitytest_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actsmanyusersabilitytest_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("actsmanyusersabilitytest_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":actsmanyusersabilitytest_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/Test.json b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/Test.json deleted file mode 100644 index 28dd95c05d8b8bd240859deee2e66df52e5f8169..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/Test.json +++ /dev/null @@ -1,33 +0,0 @@ - -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "300000", - "bundle-name": "com.example.actsmanyusersabilitytest", - "module-name":"phone", - "shell-timeout": "300000", - "testcase-timeout": "30000" - }, - "kits": [ - { - "type": "ShellKit", - "run-command": [ - "acm create -n 101 -t normal", - "acm switch -i 101" - ], - "teardown-command":[ - "acm delete -i 101" - ] - }, - { - "test-file-name": [ - "ActsManyUsersAbilityTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - } - - ] -} - diff --git a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index a41751fb10f96d4103d1120e59c5c5f5aa089e72..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/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.app.ability.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/actsmanyuserthirdabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index a26dc732d82dd3fa2bf626b0da293f593687ac1a..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,51 +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.app.ability.UIAbility' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - globalThis.abilityWant = want; - } - - 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") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "MainAbility/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/actsmanyuserthirdabilitytest/entry/src/main/ets/MainAbility/pages/index/index.ets b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/MainAbility/pages/index/index.ets deleted file mode 100644 index 5a7b56cd65dee907f5d21f00139c9c4158d58d4f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/MainAbility/pages/index/index.ets +++ /dev/null @@ -1,42 +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 AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../../../test/List.test' -import router from '@ohos.router' - -@Entry -@Component -struct Index { - aboutToAppear() { - console.info("start run testcase!!!!") - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - - } - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('MainAbility') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/MainAbility/pages/second/second.ets b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/MainAbility/pages/second/second.ets deleted file mode 100644 index 2c768edb999b1b54fef3268922817734b1f1c954..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/MainAbility/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/actsmanyuserthirdabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index 360b453d4ec06923b7f90be95b4ac500cc8385e6..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,206 +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 commonEvent from '@ohos.commonEvent' -import Want from '@ohos.application.Want'; -import rpc from "@ohos.rpc"; - -var conn = -1; -function publishCallBackOne () { - console.log("========Publish CallBack AMS_ConnectAbility_0100_commonEvent========"); -} -function publishCallBackTwo () { - console.log("========Publish CallBack AMS_ConnectAbility_0200_commonEvent========"); -} -function publishCallBackThree () { - console.log("========Publish CallBack AMS_ConnectAbility_0300_commonEvent========"); -} -function publishCallBackFour () { - console.log("========Publish CallBack AMS_ConnectAbility_0400_commonEvent========"); -} -function publishCallBackFive () { - console.log("========Publish CallBack AMS_ConnectAbility_0500_commonEvent========"); -} -function publishCallBackSix () { - console.log("========Publish CallBack AMS_ConnectAbility_0600_commonEvent========"); -} -function publishCallBackzero () { - console.log("========Publish CallBack AMSc_disonnectAbility_0100_commonEvent========"); -} -function publishCallBackttwo () { - console.log("========Publish CallBack AMSc_disonnectAbility_0200_commonEvent========"); -} - -function onConnectCallback(element, remote) { - console.log('onConnectCallback====> element=' + JSON.stringify(element)); - console.log('onConnectCallback====> remote=' + JSON.stringify(remote)); - } - - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } -export default class ServiceAbility extends ServiceExtension { - onCreate(want: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); - let extensionContext = this.context - if (want.action == "one") { - commonEvent.publish("AMS_ConnectAbility_0100_commonEvent", publishCallBackOne); - } - ; - if (want.action == "two") { - commonEvent.publish("AMS_ConnectAbility_0200_commonEvent", publishCallBackTwo); - } - ; - if (want.action == "Three") { - commonEvent.publish("AMS_ConnectAbility_0300_commonEvent", publishCallBackThree); - } - ; - if (want.action == "Four") { - commonEvent.publish("AMS_ConnectAbility_0400_commonEvent", publishCallBackFour); - } - ; - if (want.action == "Five") { - commonEvent.publish("AMS_ConnectAbility_0500_commonEvent", publishCallBackFive); - } - ; - if (want.action == "Six") { - commonEvent.publish("AMS_ConnectAbility_0600_commonEvent", publishCallBackSix); - } - ; - if (want.action == "Seven") { - extensionContext.connectAbility( - { - bundleName: "com.example.actsmanyusersabilitytest", - abilityName: "com.example.actsmanyusersabilitytest.ServiceAbility2", - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - } - ); - }; - if (want.action == "Eight") { - extensionContext.connectAbility( - { - bundleName: "com.example.actsmanyusersabilitytesta", - abilityName: "com.example.actsmanyusersabilitytest.ServiceAbility3", - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - } - ); - }; - if (want.action == "Nine") { - console.log('connectAbility 111'); - let num = this.context.connectAbility( - { - bundleName: 'com.example.actsmanyusersabilitytest', - abilityName: 'com.example.actsmanyusersabilitytest.ServiceAbility2' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - setTimeout(()=>{ - this.context.disconnectAbility(num).then(()=>{ - console.log('in disconnectAbility'); - }) - },1000) - - }; - if (want.action == "Ten") { - console.log('connectAbility 222'); - let num = this.context.connectAbility( - { - bundleName: 'com.example.actsmanyusersabilitytest', - abilityName: 'com.example.actsmanyusersabilitytest.ServiceAbility2' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - setTimeout(()=>{ - this.context.disconnectAbility(num).then(()=>{ - console.log('in disconnectAbility2'); - }) - },1000) - - }; - if (want.action == "Ten one") { - console.log('connectAbility 333'); - let num = this.context.connectAbility( - { - bundleName: 'com.example.actsmanyusersabilitytest', - abilityName: 'com.example.actsmanyusersabilitytest.ServiceAbility2' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - setTimeout(()=>{ - this.context.disconnectAbility(2222).then(()=>{ - console.log('in disconnectAbility3'); - }) - },1000) - - }; - if (want.action == "Ten two") { - console.log('connectAbility 444'); - let num = this.context.connectAbility( - { - bundleName: 'com.example.actsmanyusersabilitytest', - abilityName: 'com.example.actsmanyusersabilitytest.ServiceAbility2' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - setTimeout(()=>{ - this.context.disconnectAbility(2222).then(()=>{ - console.log('in disconnectAbility4'); - }) - },1000) - - }; - return new rpc.RemoteObject('connect'); - } - - onDisconnect(want) { - console.log('ServiceAbility onDisconnect, want:' + want.abilityName); - commonEvent.publish("AMSc_disonnectAbility_0100_commonEvent",publishCallBackzero); - commonEvent.publish("AMSc_disonnectAbility_0200_commonEvent",publishCallBackttwo); - } - - onDestroy() { - console.log('ServiceAbility onDestroy'); - } -} - diff --git a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/ServiceAbility/service.ts deleted file mode 100644 index b49731a414958a281c2f0c4eab0e7fb408eb2c2f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/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/actsmanyuserthirdabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts deleted file mode 100644 index 737e704681561e9e1ad7406b1ab388c1b0dd2670..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts +++ /dev/null @@ -1,63 +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 ServiceExtension from '@ohos.application.ServiceExtensionAbility' -import commonEvent from "@ohos.commonEvent" -import Want from '@ohos.application.Want'; -import rpc from "@ohos.rpc"; - -export default class ServiceAbility2 extends ServiceExtension { - onCreate(want:Want) { - console.log('ServiceAbility2 onCreate'); - globalThis.abilityWant = want; - } - - onDestory(){ - console.log('ServiceAbility2 onDestory'); - } - - onRequest(want,startId) { - console.log('ServiceAbility2 onRequest'); - } - - onConnect(want) { - console.log('ServiceAbility2 onConnect'); - commonEvent.publish("AMS_ConnectAbility_0700_commonEvent", () => { - console.log("publish Publish AMS_ConnectAbility_0700_commonEvent callback"); - }) - commonEvent.publish("AMS_ConnectAbility_0900_commonEvent", () => { - console.log("publish Publish AMS_ConnectAbility_0900_commonEvent callback"); - }) - commonEvent.publish("AMS_ConnectAbility_1000_commonEvent", () => { - console.log("publish Publish AMS_ConnectAbility_1000_commonEvent callback"); - }) - commonEvent.publish("AMS_ConnectAbility_1100_commonEvent", () => { - console.log("publish Publish AMS_ConnectAbility_1100_commonEvent callback"); - }) - commonEvent.publish("AMS_ConnectAbility_1200_commonEvent", () => { - console.log("publish Publish AMS_ConnectAbility_1200_commonEvent callback"); - }) - return new rpc.RemoteObject('connect'); - } - - - onDisconnect(want) { - console.log('ServiceAbility2 onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ServiceAbility2 onDestroy'); - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/ServiceAbility2/service.ts b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/ServiceAbility2/service.ts deleted file mode 100644 index 340a610cb718c70c98add0b5d052bb4589185174..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/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/actsmanyuserthirdabilitytest/entry/src/main/ets/TestAbility/TestAbility.ts b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/TestAbility/TestAbility.ts deleted file mode 100644 index 4f101c99c1576a3b8a17594f6feaaf063a917b5f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/TestAbility/TestAbility.ts +++ /dev/null @@ -1,51 +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.app.ability.UIAbility' - -export default class TestAbility extends Ability { - onCreate(want, launchParam) { - console.log('TestAbility onCreate') - } - - onDestroy() { - console.log('TestAbility onDestroy') - } - - onWindowStageCreate(windowStage) { - console.log('TestAbility onWindowStageCreate') - windowStage.loadContent("TestAbility/pages/index", (err, data) => { - if (err.code) { - console.error('Failed to load the content. Cause:' + JSON.stringify(err)); - return; - } - console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data)) - }); - - globalThis.abilityContext = this.context; - } - - onWindowStageDestroy() { - console.log('TestAbility onWindowStageDestroy') - } - - onForeground() { - console.log('TestAbility onForeground') - } - - onBackground() { - console.log('TestAbility onBackground') - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/TestAbility/pages/index.ets b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/TestAbility/pages/index.ets deleted file mode 100644 index fae969f985ff5bf7432de71e36c792364ebac1f6..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/TestAbility/pages/index.ets +++ /dev/null @@ -1,48 +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 '@ohos.router'; - -@Entry -@Component -struct Index { - aboutToAppear() { - console.info('TestAbility index aboutToAppear') - } - @State message: string = 'Hello World' - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(20) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('35%') - .height('5%') - .onClick(()=>{ - }) - } - .width('100%') - } - .height('100%') - } - } \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index 4eaf1e8878ddb3863695b2a6267cba3a53d2606e..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,78 +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 TestRunner from '@ohos.application.testRunner' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -var abilityDelegator = undefined -var abilityDelegatorArguments = undefined - -function translateParamsToString(parameters) { - const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s it', - '-s level', '-s testType', '-s size', '-s timeout', - '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` - } - } - return targetParams.trim() -} - -async function onAbilityCreateCallback() { - console.log("onAbilityCreateCallback"); -} - -async function addAbilityMonitorCallback(err: any) { - console.info("addAbilityMonitorCallback : " + JSON.stringify(err)) -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - console.info("OpenHarmonyTestRunner OnPrepare ") - } - - async onRun() { - console.log('OpenHarmonyTestRunner onRun run') - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility' - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a com.example.actsmanyusersabilitytest.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + d.stdResult); - console.info('executeShellCommand : data : ' + d.exitCode); - }) - console.info('OpenHarmonyTestRunner onRun end') - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 71eb7f381dc583f4b34d9bdaeb23a8f68dc2d0a9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/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() { - - abilityTest() -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/test/manyusersabilitytest.test.ets b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/test/manyusersabilitytest.test.ets deleted file mode 100644 index 7614ed74ea5d3eda4ae8ea02cd2b61f7a85feb70..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/ets/test/manyusersabilitytest.test.ets +++ /dev/null @@ -1,912 +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 "@ohos/hypium" -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"], -}; -var subscriberInfoStartAbility_0500 = { - events: ["AMS_ConnectAbility_0500_commonEvent"], -}; -var subscriberInfoStartAbility_0600 = { - events: ["AMS_ConnectAbility_0600_commonEvent"], -}; -var subscriberInfoStartAbility_0700 = { - events: ["AMS_ConnectAbility_0700_commonEvent"], -}; -var subscriberInfoStartAbility_0800 = { - events: ["AMS_ConnectAbility_0800_commonEvent"], -}; -var subscriberInfoStartAbility_0900 = { - events: ["AMS_ConnectAbility_0900_commonEvent"], -}; - -var subscriberInfoStartAbility_1000 = { - events: ["AMS_ConnectAbility_1000_commonEvent"], -}; - -var subscriberInfoStartAbility_1100 = { - events: ["AMS_ConnectAbility_1100_commonEvent"], -}; - -var subscriberInfoStartAbility_1200 = { - events: ["AMS_ConnectAbility_1200_commonEvent"], -}; -var unsubscriberInfoStartAbility_0100 = { - events: ["AMSc_disonnectAbility_0100_commonEvent"], -}; -var unsubscriberInfoStartAbility_0200 = { - events: ["AMSc_disonnectAbility_0200_commonEvent"], -}; - - -const START_ABILITY_TIMEOUT = 1000; -globalThis.number = 0; - -function onConnectCallback(element, remote) { - console.log(' ACTS_ConnectAbility onConnectCallback====> element=' + JSON.stringify(element)); - console.log(' ACTS_ConnectAbility onConnectCallback====> remote=' + JSON.stringify(remote)); - // setTimeout(()=> { - // console.log('====>in timeout'); - // console.debug("====>flag is====>" + JSON.stringify(flag)); - // if(flag == true) { - // console.debug('ACTS_ThirdPartyExtensionStartAbility_0600 - timeout'); - // commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - // } - // }, 1000); -} -function onDisconnectCallback(element) { - console.log('ACTS_ConnectAbility onDisconnectCallback====> element=' + JSON.stringify(element)); -} - -function onFailedCallback(code) { - console.log('ACTS_ConnectAbility onFailedCallback====> code=' + JSON.stringify(code)) -} - -export default function abilityTest() { - describe('manyuserability', function () { - - function onFailedCallBack(code) { - console.log('ACTS_ConnectAbility_0200 Connectability errcode:' + code); - } - - /* - * @tc.number : ACTS_ThirdPartyConnectAbility_0100 - * @tc.name : connect ability - * @tc.desc : Start an ability with the parameter startability with options failed.(callback) - */ - it('ACTS_ThirdPartyConnectAbility_0100', 0, async function (done) { - console.log('ACTS_ThirdPartyConnectAbility_0100====ACTS_ThirdPartyConnectAbility_0100 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0100_commonEvent"); - console.debug("====>ACTS_ThirdPartyConnectAbility_0100 5 "); - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ThirdPartyConnectAbility_0100 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - - commonEvent.createSubscriber(subscriberInfoStartAbility_0100).then(async (data) => { - console.debug("====>ACTS_ThirdPartyConnectAbility_0100 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - done(); - } - - function timeout() { - expect().assertFail(); - console.debug('ACTS_ThirdPartyConnectAbility_0100 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ThirdPartyConnectAbility_0100 3 "); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsmanyusersabilitytest", - abilityName: "com.example.actsmanyusersabilitytest.ServiceAbility", - action: "one", - },{ - onConnect:onConnectCallback, - onDisconnect:onDisconnectCallback, - onFailed: onFailedCallback - } - ); - - console.debug("====>ACTS_ThirdPartyConnectAbility_0100 4 "); - - }) - - - - it('ACTS_ThirdPartyConnectAbility_0200', 0, async function (done) { - console.log('ACTS_ThirdPartyConnectAbility_0200====ACTS_ThirdPartyConnectAbility_0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0200_commonEvent"); - - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - - commonEvent.createSubscriber(subscriberInfoStartAbility_0200).then(async (data) => { - console.debug("====>ACTS_ThirdPartyConnectAbility_0200 Create Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - - function unSubscribeCallback() { - console.debug("====>ACTS_ThirdPartyConnectAbility_0200 UnSubscribe CallBack====>"); - done(); - } - - function timeout() { - console.debug('ACTS_ThirdPartyConnectAbility_0200 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - done(); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsmanyusersabilitytest", - abilityName: "com.example.actsmanyusersabilitytest.ServiceAbilityone", - action: "two", - }, - { - onFailed: onFailedCallBack, - }, - ); - }) - - it('ACTS_ThirdPartyDisconnectAbility_0100', 0, async function (done) { - console.log('ACTS_ThirdPartyDisconnectAbility_0100====ACTS_ThirdPartyDisconnectAbility_0100 5 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0100 6====>"); - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0100 6====>"); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - - } - - - commonEvent.createSubscriber(subscriberInfoStartAbility_0300).then(async (data) => { - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0100 2 Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack====>"); - setTimeout(() => { - done() - }, 1000) - }; - - function timeout() { - expect().assertFail(); - console.debug('AMS_DonnectAbility_0300 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0100 3====>"); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsmanyusersabilitytest", - abilityName: "com.example.actsmanyusersabilitytest.ServiceAbility", - action: "Three", - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - } - ); - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0100 4====>"); - }) - - it('ACTS_ThirdPartyDisconnectAbility_0200', 0, async function (done) { - console.log('ACTS_ThirdPartyDisconnectAbility_0200 1====ACTS_ThirdPartyDisconnectAbility_0200 3 CallBack1 data:====>" + JSON.stringify(data)); - commonEvent.createSubscriber(unsubscriberInfoStartAbility_0100).then(async (data) => { - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0200 6 Subscriber====>"); - subscriberdisconnect = data; - await commonEvent.subscribe(subscriberdisconnect, subscribedisconnectback); - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0200 1111 connectAbility1====>"); - - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0200 1111 connectAbility2====>"); - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0200 66 Subscriber====>"); - globalThis.abilityContext.disconnectServiceExtensionAbility( - 999, - (error, data) => { - console.log('ACTS_ThirdPartyDisconnectAbility_0200 5 DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - }) - } - - function subscribedisconnectback(err, data) { - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0200 7 CallBack2 data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(subscriberdisconnect, () => { - console.debug('unsubscribe subscriberdisconnect'); - - commonEvent.unsubscribe(subscriber, () => { - console.debug('unsubscribe subscriber') - clearTimeout(id); - expect().assertFail(); - done(); - }) - }) - } - - function timeout() { - console.debug('ACTS_ThirdPartyDisconnectAbility_0200 8 timeout'); - commonEvent.unsubscribe(subscriberdisconnect, () => { - console.debug('unsubscribe subscriberdisconnect'); - commonEvent.unsubscribe(subscriber, () => { - console.debug('unsubscribe subscriber') - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('ACTS_ThirdPartyDisconnectAbility_0200 9 DisconnectAbility result errCode : ' + error.code + " data: " + data) - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0200 99 Subscriber====>"); - setTimeout(() => { - done(); - }, 1000) - }); - }) - }) - - - } - - commonEvent.createSubscriber(subscriberInfoStartAbility_0400).then(async (data) => { - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0200 10 Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack) - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsmanyusersabilitytest", - abilityName: "com.example.actsmanyusersabilitytest.ServiceAbility", - action: "Four", - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - } - ); - console.debug("====>connId is:====>" + JSON.stringify(connId)); - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0200 1010 Subscriber====>"); - }) - - - function unSubscribeCallback() { - console.debug("====>ACTS_DisconnectAbility_0200 1111 UnSubscribe CallBack====>"); - done(); - } - - }) - - it('ACTS_ThirdPartyDisconnectAbility_0300', 0, async function (done) { - console.log('ACTS_ThirdPartyDisconnectAbility_0300====ACTS_ThirdPartyDisconnectAbility_0300 4 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0500_commonEvent"); - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('ACTS_ThirdPartyDisconnectAbility_0300 5 DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - - } - - - commonEvent.createSubscriber(subscriberInfoStartAbility_0500).then(async (data) => { - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0300 1 Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - - function unSubscribeCallback() { - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0300 6 CallBack====>"); - setTimeout(() => { - done(); - }, 1000) - } - - function timeout() { - expect().assertFail(); - console.debug('ACTS_ThirdPartyDisconnectAbility_0300 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('ACTS_ThirdPartyDisconnectAbility_0300 7 DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0300 3 "); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsmanyusersabilitytest", - abilityName: "com.example.actsmanyusersabilitytest.ServiceAbility", - action: "Five", - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - } - ); - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0300 4 "); - }) - it('ACTS_ThirdPartyDisconnectAbility_0400', 0, async function (done) { - console.log('ACTS_ThirdPartyDisconnectAbility_0400 1====ACTS_ThirdPartyDisconnectAbility_0400 3 CallBack1 data:====>" + JSON.stringify(data)); - commonEvent.createSubscriber(unsubscriberInfoStartAbility_0200).then(async (data) => { - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0400 6 Subscriber====>"); - subscriberdisconnect = data; - await commonEvent.subscribe(subscriberdisconnect, subscribedisconnectback); - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0400 1111 connectAbility1====>"); - - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0400 1111 connectAbility2====>"); - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0400 66 Subscriber====>"); - globalThis.abilityContext.disconnectServiceExtensionAbility( - 999, - (error, data) => { - console.log('ACTS_ThirdPartyDisconnectAbility_0400 5 DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - }) - } - - function subscribedisconnectback(err, data) { - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0400 7 CallBack2 data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(subscriberdisconnect, () => { - console.debug('unsubscribe subscriberdisconnect'); - - commonEvent.unsubscribe(subscriber, () => { - console.debug('unsubscribe subscriber') - clearTimeout(id); - expect().assertFail(); - done(); - }) - }) - } - - function timeout() { - console.debug('ACTS_ThirdPartyDisconnectAbility_0400 8 timeout'); - commonEvent.unsubscribe(subscriberdisconnect, () => { - console.debug('unsubscribe subscriberdisconnect'); - commonEvent.unsubscribe(subscriber, () => { - console.debug('unsubscribe subscriber') - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('ACTS_ThirdPartyDisconnectAbility_0400 9 DisconnectAbility result errCode : ' + error.code + " data: " + data) - console.debug("====>ACTS_DisconnectAbility_0200 99 Subscriber====>"); - setTimeout(() => { - done(); - }, 1000) - }); - }) - }) - - - } - - commonEvent.createSubscriber(subscriberInfoStartAbility_0600).then(async (data) => { - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0400 10 Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack) - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsmanyusersabilitytest", - abilityName: "com.example.actsmanyusersabilitytest.ServiceAbility", - action: "Six", - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - } - ); - console.debug("====>connId is:====>" + JSON.stringify(connId)); - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0400 1010 Subscriber====>"); - }) - - - function unSubscribeCallback() { - console.debug("====>ACTS_ThirdPartyDisconnectAbility_0400 1111 UnSubscribe CallBack====>"); - done(); - } - - }) - it('ACTS_ThirdPartyExtensionConnectAbility_0100', 0, async function (done) { - console.log('ACTS_ThirdPartyExtensionConnectAbility_0100====ACTS_ThirdPartyExtensionConnectAbility_0100 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0700_commonEvent"); - console.debug("====>ACTS_ThirdPartyExtensionConnectAbility_0100 5 "); - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ThirdPartyExtensionConnectAbility_0100 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - - } - - - commonEvent.createSubscriber(subscriberInfoStartAbility_0700).then(async (data) => { - console.debug("====>ACTS_ThirdPartyExtensionConnectAbility_0100 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - - function timeout() { - expect().assertFail(); - console.debug('ACTS_ExtensionConnectAbility_0100 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ThirdPartyExtensionConnectAbility_0100 3 "); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsmanyusersabilitytest", - abilityName: "com.example.actsmanyusersabilitytest.ServiceAbility", - action: "Seven", - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - } - ); - console.debug("====>ACTS_ThirdPartyExtensionConnectAbility_0100 4 "); - - }) - - it('ACTS_ThirdPartyExtensionConnectAbility_0200', 0, async function (done) { - console.log('ACTS_ThirdPartyExtensionConnectAbility_0200====ACTS_ThirdPartyExtensionConnectAbility_0200 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0800_commonEvent"); - console.debug("====>ACTS_ThirdPartyExtensionConnectAbility_0200 5 "); - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ThirdPartyExtensionConnectAbility_0200 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - - } - - - commonEvent.createSubscriber(subscriberInfoStartAbility_0800).then(async (data) => { - console.debug("====>ACTS_ThirdPartyExtensionConnectAbility_0200 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - - function timeout() { - console.debug('ACTS_ThirdPartyExtensionConnectAbility_0200 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ThirdPartyExtensionConnectAbility_0200 3 "); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsmanyusersabilitytest", - abilityName: "com.example.actsmanyusersabilitytest.ServiceAbility", - action: "Eight", - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - } - ); - console.debug("====>ACTS_ThirdPartyExtensionConnectAbility_0200 4 "); - - }) - it('ACTS_ThirdPartyExtensionDisconnectAbility_0100', 0, async function (done) { - console.log('ACTS_ThirdPartyExtensionDisconnectAbility_0100====ACTS_ThirdPartyExtensionDisconnectAbility_0100 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_0900_commonEvent"); - console.debug("====>ACTS_ThirdPartyExtensionDisconnectAbility_0100 5 "); - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ThirdPartyExtensionDisconnectAbility_0100 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - - } - - - commonEvent.createSubscriber(subscriberInfoStartAbility_0900).then(async (data) => { - console.debug("====>ACTS_ThirdPartyExtensionDisconnectAbility_0100 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - - function timeout() { - expect().assertFail(); - console.debug('ACTS_ThirdPartyExtensionDisconnectAbility_0100 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ThirdPartyExtensionDisconnectAbility_0100 3 "); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsmanyusersabilitytest", - abilityName: "com.example.actsmanyusersabilitytest.ServiceAbility", - action: "Nine", - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - } - ); - console.debug("====>ACTS_ThirdPartyExtensionDisconnectAbility_0100 4 "); - - }) - - it('ACTS_ThirdPartyExtensionDisconnectAbility_0200', 0, async function (done) { - console.log('ACTS_ThirdPartyExtensionDisconnectAbility_0200====ACTS_ThirdPartyExtensionDisconnectAbility_0200 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_1000_commonEvent"); - console.debug("====>ACTS_ThirdPartyExtensionDisconnectAbility_0200 5 "); - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ThirdPartyExtensionDisconnectAbility_0200 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - - } - - - commonEvent.createSubscriber(subscriberInfoStartAbility_1000).then(async (data) => { - console.debug("====>ACTS_ThirdPartyExtensionDisconnectAbility_0200 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - - function timeout() { - expect().assertFail(); - console.debug('ACTS_ThirdPartyExtensionDisconnectAbility_0200 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ThirdPartyExtensionDisconnectAbility_0200 3 "); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsmanyusersabilitytest", - abilityName: "com.example.actsmanyusersabilitytest.ServiceAbility", - action: "Ten", - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - } - ); - console.debug("====>ACTS_ThirdPartyExtensionDisconnectAbility_0200 4 "); - - }) - - it('ACTS_ThirdPartyExtensionDisconnectAbility_0300', 0, async function (done) { - console.log('ACTS_ThirdPartyExtensionDisconnectAbility_0300====ACTS_ThirdPartyExtensionDisconnectAbility_0300 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_1100_commonEvent"); - console.debug("====>ACTS_ThirdPartyExtensionDisconnectAbility_0200 5 "); - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ThirdPartyExtensionDisconnectAbility_0300 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - - } - - - commonEvent.createSubscriber(subscriberInfoStartAbility_1100).then(async (data) => { - console.debug("====>ACTS_ThirdPartyExtensionDisconnectAbility_0300 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - - function timeout() { - console.debug('ACTS_ThirdPartyExtensionDisconnectAbility_0300 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ThirdPartyExtensionDisconnectAbility_0300 3 "); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsmanyusersabilitytest", - abilityName: "com.example.actsmanyusersabilitytest.ServiceAbility", - action: "Ten one", - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - } - ); - console.debug("====>ACTS_ThirdPartyExtensionDisconnectAbility_0300 4 "); - - }) - - it('ACTS_ThirdPartyExtensionDisconnectAbility_0400', 0, async function (done) { - console.log('ACTS_ThirdPartyExtensionDisconnectAbility_0400====ACTS_ThirdPartyExtensionDisconnectAbility_0400 7 CallBack data:====>" + JSON.stringify(data)); - clearTimeout(id); - expect(data.event).assertEqual("AMS_ConnectAbility_1200_commonEvent"); - console.debug("====>ACTS_ThirdPartyExtensionDisconnectAbility_0400 5 "); - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - } - ); - console.debug("====>ACTS_ThirdPartyExtensionDisconnectAbility_0400 6 "); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - - } - - - commonEvent.createSubscriber(subscriberInfoStartAbility_1200).then(async (data) => { - console.debug("====>ACTS_ThirdPartyExtensionDisconnectAbility_0400 2 Subscriber1====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - }) - - function unSubscribeCallback() { - console.debug("====>UnSubscribe CallBack1====>"); - setTimeout(() => { - done(); - }, 1000) - } - - function timeout() { - console.debug('ACTS_ThirdPartyExtensionDisconnectAbility_0400 timeout'); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('featureAbilityTest DisconnectAbility result errCode : ' + error.code + " data: " + data) - }); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>ACTS_ThirdPartyExtensionDisconnectAbility_0400 3 "); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.actsmanyusersabilitytest", - abilityName: "com.example.actsmanyusersabilitytest.ServiceAbility", - action: "Ten two", - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - } - ); - console.debug("====>ACTS_ThirdPartyExtensionDisconnectAbility_0400 4 "); - - }) - - - - }) -} - - diff --git a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/module.json b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/module.json deleted file mode 100644 index 5dcab67291a6eae400137c852ca3f79a27f7263a..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/module.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.actsmanyusersabilitytest.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.actsmanyusersabilitytest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - }, - { - "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", - "name": "com.example.actsmanyusersabilitytest.ServiceAbility2", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } - ] - } -} diff --git a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index d75325f3cf0a50c1dfe4dbc5162c8737276c3dd9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/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/actsmanyuserthirdabilitytest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 02221db61d317863114ff0ca4dd2b33586abff12..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index/index", - "MainAbility/pages/second/second" - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/signature/openharmony_sx.p7b b/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/signature/openharmony_sx.p7b deleted file mode 100644 index dcec6c9615032c1b48bf185e839d9720dd68aab0..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsusers/actsmanyuserthirdabilitytest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/amscontextualinforquery/BUILD.gn b/ability/ability_runtime/amscontextualinforquery/BUILD.gn index 86a937f43e44cf990e3e51b24bf7b43e99df166b..0958cffeb74d6047a9bfbab40a69bef757d79c5e 100644 --- a/ability/ability_runtime/amscontextualinforquery/BUILD.gn +++ b/ability/ability_runtime/amscontextualinforquery/BUILD.gn @@ -17,10 +17,7 @@ group("amscontextualinforquery") { testonly = true if (is_standard_system) { deps = [ - "actsamsextensionmodulehap:ActsAmsExtensionModuleRelyHap", "actsamsstaticabilitystagecontexttest:ActsAmsStaticAbilityStageContextTest", - "actsamsstaticextensioninfohap:ActsAmsStaticExtensionInfoRelyHap", - "actsamsstaticextensioninfotest:ActsAmsStaticExtensionInfoTest", "actsamsstatichapa:ActsAmsStaticARelyHap", "actsamsstatichapb:ActsAmsStaticBRelyHap", "actsamsstaticinfomationquerytest:ActsAmsStaticInfoMationQueryTest", diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/AppScope/app.json b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/AppScope/app.json deleted file mode 100644 index c3e2fb7737f55fa80f3fd5727de64af966042833..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.extensionmodule", - "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/amscontextualinforquery/actsamsextensionmodulehap/AppScope/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/AppScope/resources/base/element/string.json deleted file mode 100644 index be09cccde1bc7369ef47a5cd45d2b06884c88602..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/BUILD.gn b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/BUILD.gn deleted file mode 100644 index fde4293818f8e1f75361de7cf80807578d67e1af..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/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_assist_suite("ActsAmsExtensionModuleRelyHap") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - hap_name = "ActsAmsExtensionModuleRelyHap" - - testonly = true - deps = [ - ":actsamsextensionmodulerelyhap_js_assets", - ":actsamsextensionmodulerelyhap_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("actsamsextensionmodulerelyhap_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actsamsextensionmodulerelyhap_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("actsamsextensionmodulerelyhap_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":actsamsextensionmodulerelyhap_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index a41751fb10f96d4103d1120e59c5c5f5aa089e72..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/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.app.ability.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/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index c720a902c121fa4f5278e2a747d20157a1aae8f3..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,99 +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.app.ability.UIAbility' -import rpc from '@ohos.rpc' - -var connection = -1; -let options = { - onConnect: function(elementName, proxy) { - console.log("mxh onConnect success"); - if (proxy == null) { - console.log("mxh proxy == null"); - return; - } - let option = new rpc.MessageOption(); - let data = new rpc.MessageParcel(); - let reply = new rpc.MessageParcel(); - data.writeInt(1); - data.writeInt(99); - proxy.sendRequest(1, data, reply, option); - let msg = reply.readInt(); - console.log("mxh onConnect msg:" + msg); - }, - - onDisconnect: function() {console.log("mxh onDisconnect success");}, - onFailed: function() {console.log("mxh onFailed");} -} -export default class MainAbility extends Ability { - onCreate(want, launchParam) { - console.log('mxh MainAbility onCreate is called' + want + launchParam); - } - - onDestroy() { - console.log('mxh MainAbility onDestroy is called'); - } - - onWindowStageCreate(windowStage) { - console.log('mxh MainAbility onWindowStageCreate is called'); - let context = this.context; - globalThis.startServiceExtAbility = (() => { - console.log("mxh startServiceExtAbility begin"); - var want = { - "bundleName": "com.example.ohosproject.hmservice", - "abilityName": "ServiceExtAbility", - } - context.startAbility(want).then((data) => { - console.info("mxh startAbility success:" + JSON.stringify(data)); - }).catch((error) => { - console.error("mxh startAbility failed:" + JSON.stringify(error)); - }) - console.log("mxh startServiceExtAbility end"); - }) - - globalThis.connectServiceExtAbility = (() => { - console.log("mxh connectServiceExtAbility begin"); - var want = { - "bundleName": "com.example.ohosproject.hmservice", - "abilityName": "ServiceExtAbility", - } - connection = context.connectServiceExtensionAbility(want, options); - console.log("mxh connectServiceExtAbility end, connection:" + connection); - }) - - globalThis.disconnectServiceExtAbility = (() => { - console.log("mxh disconnectServiceExtAbility begin"); - context.disconnectServiceExtensionAbility(connection).then((data) => { - console.info("mxh startAbility success:" + JSON.stringify(data)); - }).catch((error) => { - console.error("mxh startAbility failed:" + JSON.stringify(error)); - }); - console.log("mxh disconnectServiceExtAbility end, connection:" + connection); - }) - - windowStage.setUIContent(this.context, 'pages/index/index', null); - } - - onWindowStageDestroy() { - console.log('mxh MainAbility onWindowStageDestroy is called'); - } - - onForeground() { - console.log('mxh MainAbility onForeground is called'); - } - - onBackground() { - console.log('mxh MainAbility onBackground is called'); - } -} \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index f766470d826a698e436ad1db2789105190177165..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/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 Extension from '@ohos.application.ServiceExtensionAbility' -import commonEvent from '@ohos.commonEvent' -import Want from '@ohos.application.Want'; -import rpc from '@ohos.rpc'; - -export default class ServiceExtAbility extends Extension { - onCreate(want) { - console.info('mxh ServiceAbility onCreate**'); - - } - - onRequest(want, startId) { - console.info('mxh ServiceAbility onRequest**'); - } - - onConnect(want:Want) { - console.info('mxh ServiceAbility onConnect**'); - commonEvent.publish("ACTS_ConnectAbility_0100_CommonEvent", { - parameters: { - extensionAbilityInfo : JSON.stringify(this.context.extensionAbilityInfo), - } - } ,(err) => { - console.log("Demo Publish CallBack MainAbility_Start_CommonEvent") - }); - console.log('Demo SerivceAbilityServer OnConnect start 1'); - return new rpc.RemoteObject('connect'); - } - - onDisconnect(want) { - console.info('mxh ServiceAbility onDisConnect**'); - } - - onDestroy() { - console.info('mxh ServiceAbility onDestroy**'); - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/ServiceAbility/service.ts deleted file mode 100644 index b49731a414958a281c2f0c4eab0e7fb408eb2c2f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/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/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/pages/index/index.ets deleted file mode 100644 index 64c878fd512c758ba0b6d0fc2fcdb70bd127b4c7..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/pages/index/index.ets +++ /dev/null @@ -1,37 +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'; - -@Entry -@Component -struct Index { - - aboutToAppear() { - console.info("start run testcase!!!!") - } - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('pmsystemappa') - .fontSize(50) - .fontWeight(FontWeight.Bold) - .margin({ - top: 20 - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/ets/pages/second/second.ets deleted file mode 100644 index 33d9ae45245db03fd252ef7c1a85c9e284028e0d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/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/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/module.json deleted file mode 100644 index 65c096086b6f3bcd9ee0f45b10e28a3069adee6c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/module.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.acts.pmvendorappservice.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": [ - { - "name": "ServiceExtAbility", - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "permissions": [ - "ohos.permission.USE_BLUETOOTH" - ], - "metadata": [ - { - "name": "ohos.extension.form", - "value": "MainAbility", - "resource": "@profile:form_config" - } - ], - "visible": true, - "type": "service" - } - ], - "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/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/element/string.json deleted file mode 100644 index d75325f3cf0a50c1dfe4dbc5162c8737276c3dd9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/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/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 6898b31d2085f478ee1ed9d933a5910cbf901d92..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/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/amscontextualinforquery/actsamsextensionmodulehap/signature/openharmony_sx.p7b b/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/signature/openharmony_sx.p7b deleted file mode 100755 index dcec6c9615032c1b48bf185e839d9720dd68aab0..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/amscontextualinforquery/actsamsextensionmodulehap/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/module.json index 0277e8e94ce706d3863c62d2db407251ee2f1570..d07906ec98f383d5371708cf07860f67ec237167 100644 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/module.json +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/entry/src/main/module.json @@ -35,46 +35,18 @@ } ], "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" - } + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name": "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason": "need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + } ] } } diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/signature/openharmony_sx.p7b b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/signature/openharmony_sx.p7b index cc53179a48f88f20acc379c138a001e9a15838f6..129159f1bc10760100629e656549cd64c008e54c 100644 Binary files a/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/signature/openharmony_sx.p7b and b/ability/ability_runtime/amscontextualinforquery/actsamsstaticabilitystagecontexttest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/app.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/app.json deleted file mode 100644 index 8ee1b11aa5ce62aaf99ab3786306fa3c8c5aa692..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.staticextensioninfotest", - "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/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/resources/base/element/string.json deleted file mode 100644 index be09cccde1bc7369ef47a5cd45d2b06884c88602..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/BUILD.gn b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/BUILD.gn deleted file mode 100644 index 8a694b4d42482ae94e1df50066782c037d7007f1..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/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_assist_suite("ActsAmsStaticExtensionInfoRelyHap") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - hap_name = "ActsAmsStaticExtensionInfoRelyHap" - - testonly = true - deps = [ - ":actsamsstaticextensioninforelyhap_js_assets", - ":actsamsstaticextensioninforelyhap_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("actsamsstaticextensioninforelyhap_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actsamsstaticextensioninforelyhap_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("actsamsstaticextensioninforelyhap_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":actsamsstaticextensioninforelyhap_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index a41751fb10f96d4103d1120e59c5c5f5aa089e72..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/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.app.ability.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/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 9bb0892a74515f2813d8558e21ca3a9978beb60d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,51 +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.app.ability.UIAbility' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("ACTS_ProcessManage VendorAppService MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("ACTS_ProcessManage VendorAppService MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("ACTS_ProcessManage VendorAppService MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("ACTS_ProcessManage VendorAppService MainAbility onWindowStageDestroy") - } - - async onForeground() { - // Ability has brought to foreground - console.log("ACTS_ProcessManage VendorAppService MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("ACTS_ProcessManage VendorAppService MainAbility onBackground") - } -}; diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index e6876adc087186b2b0eb256f586eadbb2227df7d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,57 +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 commonEvent from "@ohos.commonEvent"; -import Want from '@ohos.application.Want'; -import rpc from '@ohos.rpc'; - -export default class ServiceAbility extends ServiceExtension { - onCreate(want:Want) { - globalThis.abilityWant = want; - console.log('ServiceAbility onCreate, want: ' + want.abilityName); - } - - onRequest(want, startId) { - console.log('ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId); - } - - onConnect(want) { - console.log('ServiceAbility2 onConnect, abilityName:' + want.abilityName); - console.log('ServiceAbility2 onConnect, action:' + want.action); - globalThis.extensionContext = this.context - if (want.action == 'getExtensionInfoTest') { - commonEvent.publish("ACTS_ConnectAbility_0200_CommonEvent", { - parameters: { - hapModuleInfo2: JSON.stringify(this.context.currentHapModuleInfo), - applicationInfo2: JSON.stringify(this.context.applicationInfo) - } - } ,(err) => { - console.log("MainAbility Publish CallBack MainAbility_Start_CommonEvent") - }); - console.log('stub SerivceAbilityServer OnConnect start 2'); - - } - return new rpc.RemoteObject('connect'); - } - - onDisconnect(want) { - console.log('ServiceAbility onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ServiceAbility onDestroy'); - } -} \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/ServiceAbility/service.ts deleted file mode 100644 index b49731a414958a281c2f0c4eab0e7fb408eb2c2f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/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/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/pages/index/index.ets deleted file mode 100644 index 64c878fd512c758ba0b6d0fc2fcdb70bd127b4c7..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/pages/index/index.ets +++ /dev/null @@ -1,37 +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'; - -@Entry -@Component -struct Index { - - aboutToAppear() { - console.info("start run testcase!!!!") - } - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('pmsystemappa') - .fontSize(50) - .fontWeight(FontWeight.Bold) - .margin({ - top: 20 - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/ets/pages/second/second.ets deleted file mode 100644 index 33d9ae45245db03fd252ef7c1a85c9e284028e0d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/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/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/module.json deleted file mode 100644 index 5cd9d7a37dba35a9f22230dfc5909db545a2f39e..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/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": "com.example.staticextensioninfotest.MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.staticextensioninfotest.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.staticextensioninfotest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - } - ], - "requestPermissions": [ - { - "name":"ohos.permission.GET_BUNDLE_INFO", - "reason":"need use ohos.permission.GET_BUNDLE_INFO" - }, - { - "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", - "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" - }, - { - "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.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - } - ] - } -} diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/element/string.json deleted file mode 100644 index d75325f3cf0a50c1dfe4dbc5162c8737276c3dd9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/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/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 6898b31d2085f478ee1ed9d933a5910cbf901d92..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/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/amscontextualinforquery/actsamsstaticextensioninfohap/signature/openharmony_sx.p7b b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/signature/openharmony_sx.p7b deleted file mode 100755 index dcec6c9615032c1b48bf185e839d9720dd68aab0..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfohap/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/app.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/app.json deleted file mode 100644 index 60257b2cb7989a7a152312f31af75027d517ccac..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app":{ - "bundleName":"com.example.staticextensioninfo", - "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/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/resources/base/element/string.json deleted file mode 100644 index ee69f9a861d9dc269ed6638735d52674583498e1..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/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/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index 474a55588fd7216113dd42073aadf254d4dba023..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/BUILD.gn b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/BUILD.gn deleted file mode 100644 index b395e853b7be3a32b9e251924d58be96cf6f9cc3..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/BUILD.gn +++ /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("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAmsStaticExtensionInfoTest") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":actsamsstaticextensiontnfotest_js_assets", - ":actsamsstaticextensiontnfotest_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAmsStaticExtensionInfoTest" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("actsamsstaticextensiontnfotest_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actsamsstaticextensiontnfotest_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("actsamsstaticextensiontnfotest_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":actsamsstaticextensiontnfotest_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/Test.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/Test.json deleted file mode 100644 index 24a9b376c20248ba6f717bd8dafab803f596c903..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/Test.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "OHJSUnitTest", - "test-timeout": "180000", - "bundle-name": "com.example.staticextensioninfo", - "module-name": "phone", - "shell-timeout": "600000", - "testcase-timeout": 70000 - }, - "kits": [ - { - "test-file-name": [ - "ActsAmsStaticExtensionInfoTest.hap", - "ActsAmsStaticExtensionInfoRelyHap.hap", - "ActsAmsExtensionModuleRelyHap.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "remount", - "mkdir /data/test" - ] - }, - { - "type": "PushKit", - "push": [ - "ActsAmsStaticExtensionInfoTest.hap->/data/ActsAmsStaticExtensionInfoTest.hap", - "ActsAmsStaticExtensionInfoRelyHap.hap->/data/ActsAmsStaticExtensionInfoRelyHap.hap", - "ActsAmsExtensionModuleRelyHap.hap->/data/ActsAmsExtensionModuleRelyHap.hap" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "chmod 644 /data/test/*.hap" - ] - } - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 41515e203690b99bfe5755b1db48b707c20c6c1a..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,22 +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.app.ability.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 5e7a70c5802092a0c8805701650591856fe93ad4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/MainAbility/MainAbility.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 Ability from '@ohos.app.ability.UIAbility' - -export default class MainAbility extends Ability { - onCreate(want,launchParam){ - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - globalThis.abilityWant = want; - } - - 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") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "MainAbility/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") - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/MainAbility/pages/index/index.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/MainAbility/pages/index/index.ets deleted file mode 100644 index bebda07c2cf21dccd43f7cc4b980205ca56a6168..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/MainAbility/pages/index/index.ets +++ /dev/null @@ -1,56 +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 '@ohos.router'; -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../../../test/List.test' - - -@Entry -@Component -struct Index { - - aboutToAppear(){ - console.info("start run testcase!!!!") - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - } - - build() { - Flex({ direction:FlexDirection.Column, alignItems:ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Hello World') - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(25) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .onClick(() => { - - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/MainAbility/pages/second/second.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/MainAbility/pages/second/second.ets deleted file mode 100644 index f9009a3e8567d1f4557ebc11dded54c7e27c0b0d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/MainAbility/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/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index 8f19229ef18a8c1cb828c40cd6fbe126f597475c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,56 +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 commonEvent from "@ohos.commonEvent"; -import Want from '@ohos.application.Want'; -import rpc from '@ohos.rpc'; - -export default class ServiceAbility extends ServiceExtension { - onCreate(want:Want) { - globalThis.abilityWant = want; - console.log('ServiceAbility onCreate, want: ' + want.abilityName); - } - - onRequest(want, startId) { - console.log('ServiceAbility onRequest, want: ' + want.abilityName + ', startId: ' + startId); - console.log('ServiceAbility registerApplicationStateObserver begin'); - } - - onConnect(want) { - console.log('ServiceAbility onConnect, want:' + want.abilityName); - globalThis.extensionContext = this.context - if (want.action == 'getExtensionInfo') { - commonEvent.publish("ACTS_ConnectAbility_0100_CommonEvent", { - parameters: { - hapModuleInfo: JSON.stringify(this.context.currentHapModuleInfo), - applicationInfo: JSON.stringify(this.context.applicationInfo), - } - } ,(err) => { - console.log("MainAbility Publish CallBack MainAbility_Start_CommonEvent") - }); - console.log('stub SerivceAbilityServer OnConnect start 1'); - } - return new rpc.RemoteObject('connect'); - } - - onDisconnect(want) { - console.log('ServiceAbility onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ServiceAbility onDestroy'); - } -} \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/ServiceAbility/service.ts deleted file mode 100644 index b49731a414958a281c2f0c4eab0e7fb408eb2c2f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/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/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/TestAbility/TestAbility.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/TestAbility/TestAbility.ts deleted file mode 100644 index 8028a70f8af44690b95a08bd177bca6b09f24687..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/TestAbility/TestAbility.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 Ability from '@ohos.app.ability.UIAbility' - -export default class TestAbility extends Ability { - onCreate(want, launchParam) { - console.log('TestAbility onCreate') - } - - onDestroy() { - console.log('TestAbility onDestroy') - } - - onWindowStageCreate(windowStage) { - console.log('TestAbility onWindowStageCreate') - windowStage.loadContent("TestAbility/pages/index", (err, data) => { - if (err.code) { - console.error('Failed to load the content. Cause:' + JSON.stringify(err)); - return; - } - console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data)) - }); - - globalThis.abilityContext = this.context; - } - - onWindowStageDestroy() { - console.log('TestAbility onWindowStageDestroy') - } - - onForeground() { - console.log('TestAbility onForeground') - } - - onBackground() { - console.log('TestAbility onBackground') - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/TestAbility/pages/index.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/TestAbility/pages/index.ets deleted file mode 100644 index b93567f962921124b282f78c8ef123965d1460c9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/TestAbility/pages/index.ets +++ /dev/null @@ -1,48 +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 '@ohos.router'; - -@Entry -@Component -struct Index { - aboutToAppear() { - console.info('TestAbility index aboutToAppear') - } - @State message: string = 'Hello World' - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - Button() { - Text('next page') - .fontSize(20) - .fontWeight(FontWeight.Bold) - }.type(ButtonType.Capsule) - .margin({ - top: 20 - }) - .backgroundColor('#0D9FFB') - .width('35%') - .height('5%') - .onClick(()=>{ - }) - } - .width('100%') - } - .height('100%') - } - } \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts deleted file mode 100644 index f98a3a5cfc7835261a2d9846c6a874a335e18ec0..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/TestRunner/OpenHarmonyTestRunner.ts +++ /dev/null @@ -1,78 +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 TestRunner from '@ohos.application.testRunner' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' - -var abilityDelegator = undefined -var abilityDelegatorArguments = undefined - -function translateParamsToString(parameters) { - const keySet = new Set([ - '-s class', '-s notClass', '-s suite', '-s it', - '-s level', '-s testType', '-s size', '-s timeout', - '-s dryRun' - ]) - let targetParams = ''; - for (const key in parameters) { - if (keySet.has(key)) { - targetParams = `${targetParams} ${key} ${parameters[key]}` - } - } - return targetParams.trim() -} - -async function onAbilityCreateCallback() { - console.log("onAbilityCreateCallback"); -} - -async function addAbilityMonitorCallback(err: any) { - console.info("addAbilityMonitorCallback : " + JSON.stringify(err)) -} - -export default class OpenHarmonyTestRunner implements TestRunner { - constructor() { - } - - onPrepare() { - console.info("OpenHarmonyTestRunner OnPrepare ") - } - - async onRun() { - console.log('OpenHarmonyTestRunner onRun run') - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var testAbilityName = abilityDelegatorArguments.bundleName + '.MainAbility' - let lMonitor = { - abilityName: testAbilityName, - onAbilityCreate: onAbilityCreateCallback, - }; - abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) - var cmd = 'aa start -d 0 -a com.example.staticextensioninfo.MainAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] - if (debug == 'true') - { - cmd += ' -D' - } - console.info('cmd : '+cmd) - abilityDelegator.executeShellCommand(cmd, - (err: any, d: any) => { - console.info('executeShellCommand : err : ' + JSON.stringify(err)); - console.info('executeShellCommand : data : ' + d.stdResult); - console.info('executeShellCommand : data : ' + d.exitCode); - }) - console.info('OpenHarmonyTestRunner onRun end') - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/Ability.test.ets deleted file mode 100644 index b76402d04cc28e91645ce9601fdee435a7135685..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/Ability.test.ets +++ /dev/null @@ -1,473 +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 commonEvent from "@ohos.commonEvent" -import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" - -const START_ABILITY_TIMEOUT = 5000; -var subscriberInfoStartAbility_0100 = { - events: ["ACTS_ConnectAbility_0100_CommonEvent"], -}; -var subscriberInfoStartAbility_0200 = { - events: ["ACTS_ConnectAbility_0200_CommonEvent"], -}; - -export default function abilityTest() { - - describe('ActsExtensionAbilityTest', function () { - - /* - * @tc.number: ACTS_getExtensionInfo_0100 - * @tc.name: Start the system permission application to query static information about Extension - * @tc.desc: Enable application ras to query the Extension static information. Verify the query information. - Enable application ras to connect to serviceAbility - */ - it('ACTS_getExtensionInfo_0100', 0, async function (done) { - console.log('ACTS_getExtensionInfo_0100 gyq ====ACTS_getExtensionInfo_0100_Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ACTS_ConnectAbility_0100_CommonEvent") { - clearTimeout(id); - checkHapModuleInfo(JSON.parse(data.parameters['hapModuleInfo'])) - checkApplicationInfo(JSON.parse(data.parameters['applicationInfo'])) - expect(data.event).assertEqual("ACTS_ConnectAbility_0100_CommonEvent"); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - done(); - } - } - commonEvent.createSubscriber(subscriberInfoStartAbility_0100).then(async (data) => { - console.debug("====>ACTS_getExtensionInfo_0100_Create Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.staticextensioninfo", - abilityName: "com.example.staticextensioninfo.ServiceAbility", - action: "getExtensionInfo" - } - ); - console.log('ACTS_getExtensionInfo_0100 ConnectAbility connId : ' + connId); - }) - - function unSubscribeCallback() { - console.debug("====>ACTS_getExtensionInfo_0100_UnSubscribe CallBack====>"); - done(); - } - - function timeout() { - expect().assertFail(); - console.debug('ACTS_ConnectAbility_0100 timeout'); - done(); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - - - function checkHapModuleInfo(data) { - console.log("checkHapModuleInfo start " + data); - console.log("checkHapModuleInfo name : " + data.name); - console.log("checkHapModuleInfo description : " + data.description); - console.log("checkHapModuleInfo descriptionId : " + data.descriptionId); - console.log("checkHapModuleInfo icon : " + data.icon); - console.log("checkHapModuleInfo label : " + data.label); - console.log("checkHapModuleInfo labelId : " + data.labelId); - console.log("checkHapModuleInfo iconId : " + data.iconId); - console.log("checkHapModuleInfo backgroundImg : " + data.backgroundImg); - console.log("checkHapModuleInfo supportedModes : " + data.supportedModes); - console.log("checkHapModuleInfo reqCapabilities length : " + data.reqCapabilities.length); - for (var j = 0; j < data.reqCapabilities.length; j++) { - console.log("checkHapModuleInfo data.reqCapabilities[" + j + "] : " + data.reqCapabilities[j]); - } - console.log("checkHapModuleInfo deviceTypes length : " + data.deviceTypes.length); - for (var j = 0; j < data.deviceTypes.length; j++) { - console.log("checkHapModuleInfo data.deviceTypes[" + j + "] : " + data.deviceTypes[j]); - } - console.log("checkHapModuleInfo moduleName : " + data.moduleName); - console.log("checkHapModuleInfo mainAbilityName : " + data.mainAbilityName); - console.log("checkHapModuleInfo installationFree : " + data.installationFree); - - expect(typeof (data)).assertEqual("object"); - expect(typeof (data.name)).assertEqual("string"); - expect(typeof (data.description)).assertEqual("string"); - expect(typeof (data.icon)).assertEqual("string"); - expect(typeof (data.label)).assertEqual("string"); - expect(typeof (data.backgroundImg)).assertEqual("string"); - expect(typeof (data.supportedModes)).assertEqual("number"); - expect(Array.isArray(data.reqCapabilities)).assertEqual(true); - expect(Array.isArray(data.deviceTypes)).assertEqual(true); - expect(Array.isArray(data.abilityInfo)).assertEqual(true); - expect(typeof (data.moduleName)).assertEqual("string"); - expect(typeof (data.mainAbilityName)).assertEqual("string"); - console.log("checkHapModuleInfo_expect_typeof_end") - expect(data.name).assertEqual("phone"); - expect(data.description).assertEqual("$string:phone_entry_dsc"); - expect(data.descriptionId).assertEqual(16777221); - expect(data.icon).assertEqual("$media:icon"); - expect(data.label).assertEqual("$string:entry_label"); - expect(data.labelId).assertEqual(16777219); - expect(data.iconId).assertEqual(16777224); - expect(data.backgroundImg).assertEqual(""); - expect(data.supportedModes).assertEqual(0); - expect(data.reqCapabilities.length).assertEqual(0); - expect(data.deviceTypes.length).assertEqual(2); - expect(data.deviceTypes[0]).assertEqual("default"); - expect(data.moduleName).assertEqual("phone") - expect(data.mainAbilityName).assertEqual("com.example.staticextensioninfo.MainAbility"); - expect(data.installationFree).assertEqual(false); - expect(data.mainElementName).assertEqual('com.example.staticextensioninfo.MainAbility'); - expect(data.hashValue).assertEqual(''); - console.log("checkHapModuleInfo end " + data); - } - function checkApplicationInfo(data) { - console.log("checkApplicationInfo start " + data); - console.log("checkApplicationInfo name : " + data.name); - console.log("checkApplicationInfo description : " + data.description); - console.log("checkApplicationInfo descriptionId : " + data.descriptionId); - console.log("checkApplicationInfo systemApp : " + data.systemApp); - console.log("checkApplicationInfo enabled : " + data.enabled); - console.log("checkApplicationInfo label : " + data.label) - console.log("checkApplicationInfo labelId : " + data.labelId); - console.log("checkApplicationInfo icon : " + data.icon); - console.log("checkApplicationInfo iconId : " + data.iconId); - console.log("checkApplicationInfo process : " + data.process); - console.log("checkApplicationInfo supportedModes : " + data.supportedModes); - console.log("checkApplicationInfo moduleSourceDirs length : " + data.moduleSourceDirs.length); - for (var j = 0; j < data.moduleSourceDirs.length; j++) { - console.log("checkApplicationInfo data.moduleSourceDirs[" + j + "] : " + data.moduleSourceDirs[j]); - } - console.log("checkApplicationInfo permissions length : " + data.permissions.length); - for (var j = 0; j < data.permissions.length; j++) { - console.log("checkApplicationInfo data.permissions[" + j + "] : " + data.permissions[j]); - } - console.log("checkApplicationInfo moduleInfos length : " + data.moduleInfos.length); - for (var j = 0; j < data.moduleInfos.length; j++) { - console.log("checkApplicationInfo data.moduleInfos[" + j + "].moduleName : " + data.moduleInfos[j].moduleName); - console.log("checkApplicationInfo data.moduleInfos[" + j + "].moduleSourceDir:" + - data.moduleInfos[j].moduleSourceDir); - } - console.log("checkApplicationInfo entryDir : " + data.entryDir); - console.log("checkApplicationInfo codePath : " + data.codePath); - console.log("checkApplicationInfo removable: " + data.removable); - - expect(typeof (data)).assertEqual("object"); - expect(typeof (data.name)).assertEqual("string"); - expect(typeof (data.description)).assertEqual("string"); - expect(typeof (data.descriptionId)).assertEqual("number"); - expect(typeof (data.systemApp)).assertEqual("boolean"); - expect(typeof (data.enabled)).assertEqual("boolean"); - expect(typeof (data.label)).assertEqual("string"); - expect(typeof (data.labelId)).assertEqual("string"); - expect(typeof (data.icon)).assertEqual("string"); - expect(typeof (data.iconId)).assertEqual("string"); - expect(typeof (data.process)).assertEqual("string"); - expect(typeof (data.supportedModes)).assertEqual("number"); - expect(Array.isArray(data.moduleSourceDirs)).assertEqual(true); - expect(Array.isArray(data.permissions)).assertEqual(true); - expect(Array.isArray(data.moduleInfos)).assertEqual(true); - expect(typeof (data.entryDir)).assertEqual("string"); - expect(typeof (data.codePath)).assertEqual("string"); - expect(typeof (data.removable)).assertEqual("boolean"); - console.log("checkApplicationInfo_expect_typeof_end") - expect(data.name).assertEqual("com.example.staticextensioninfo"); - expect(data.description).assertEqual("$string:description_application"); - expect(data.descriptionId).assertLarger(0); - expect(data.systemApp).assertEqual(true); - expect(data.enabled).assertEqual(true); - expect(data.label).assertEqual("$string:app_name"); - expect(data.labelId).assertEqual("16777216"); - expect(data.icon).assertEqual("$media:icon"); - expect(data.iconId).assertEqual("16777224"); - expect(data.process).assertEqual("com.example.staticextensioninfo"); - expect(data.supportedModes).assertEqual(0); - expect(data.moduleSourceDirs.length).assertEqual(1); - expect(data.moduleSourceDirs[0]).assertEqual("/data/app/el1/bundle/public/" + - "com.example.staticextensioninfo/phone"); - expect(data.moduleInfos.length).assertEqual(1); - expect(data.moduleInfos[0].moduleName).assertEqual("phone"); - expect(data.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + - "com.example.staticextensioninfo/phone"); - expect(data.entryDir).assertEqual("/data/app/el1/bundle/public/com.example.staticextensioninfo" + - "/phone"); - expect(data.codePath).assertEqual("/data/app/el1/bundle/public/com.example.staticextensioninfo"); - expect(data.removable).assertEqual(true); - console.log("checkApplicationInfo end " + data); - } - }) - - /* - * @tc.number: ACTS_getExtensionInfo_0200 - * @tc.name: Apply StaticExtensionInfo. Connect to StaticExtensionInfoTest to query static information - about an Extension - * @tc.desc: Enabling an application to connect to StaticExtensionInfo. Connecting to StaticExtensionInfoTest - To query static information about an Extension. Verifying the query information - */ - it('ACTS_getExtensionInfo_0200', 0, async function (done) { - console.log('ACTS_getExtensionInfo_0200====ACTS_getExtensionInfo_0200_Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ACTS_ConnectAbility_0200_CommonEvent") { - clearTimeout(id); - checkHapModuleInfo_0200(JSON.parse(data.parameters['hapModuleInfo2'])) - checkApplicationInfo_0200(JSON.parse(data.parameters['applicationInfo2'])) - expect(data.event).assertEqual("ACTS_ConnectAbility_0200_CommonEvent"); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - } - } - commonEvent.createSubscriber(subscriberInfoStartAbility_0200).then(async (data) => { - console.debug("====>ACTS_getExtensionInfo_0200_Create Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.staticextensioninfotest", - abilityName: "com.example.staticextensioninfotest.ServiceAbility", - action: "getExtensionInfoTest" - } - ); - console.log('ACTS_getExtensionInfo_0200 ConnectAbility connId : ' + connId); - }) - - function unSubscribeCallback() { - console.debug("====>ACTS_getExtensionInfo_0200_UnSubscribe CallBack====>"); - done(); - } - - function timeout() { - expect().assertFail(); - console.debug('ACTS_ConnectAbility_0200 timeout'); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - - - function checkHapModuleInfo_0200(data) { - console.log("checkHapModuleInfo2 start " + data); - console.log("checkHapModuleInfo2 name : " + data.name); - console.log("checkHapModuleInfo2 description : " + data.description); - console.log("checkHapModuleInfo2 descriptionId : " + data.descriptionId); - console.log("checkHapModuleInfo2 icon : " + data.icon); - console.log("checkHapModuleInfo2 label : " + data.label); - console.log("checkHapModuleInfo2 labelId : " + data.labelId); - console.log("checkHapModuleInfo2 iconId : " + data.iconId); - console.log("checkHapModuleInfo2 backgroundImg : " + data.backgroundImg); - console.log("checkHapModuleInfo2 supportedModes : " + data.supportedModes); - console.log("checkHapModuleInfo2 reqCapabilities length : " + data.reqCapabilities.length); - for (var j = 0; j < data.reqCapabilities.length; j++) { - console.log("checkHapModuleInfo2 data.reqCapabilities[" + j + "] : " + data.reqCapabilities[j]); - } - console.log("checkHapModuleInfo2 deviceTypes length : " + data.deviceTypes.length); - for (var j = 0; j < data.deviceTypes.length; j++) { - console.log("checkHapModuleInfo2 data.deviceTypes[" + j + "] : " + data.deviceTypes[j]); - } - console.log("checkHapModuleInfo2 moduleName : " + data.moduleName); - console.log("checkHapModuleInfo2 mainAbilityName : " + data.mainAbilityName); - console.log("checkHapModuleInfo2 installationFree : " + data.installationFree); - - expect(typeof (data)).assertEqual("object"); - expect(typeof (data.name)).assertEqual("string"); - expect(typeof (data.description)).assertEqual("string"); - expect(typeof (data.icon)).assertEqual("string"); - expect(typeof (data.label)).assertEqual("string"); - expect(typeof (data.backgroundImg)).assertEqual("string"); - expect(typeof (data.supportedModes)).assertEqual("number"); - expect(Array.isArray(data.reqCapabilities)).assertEqual(true); - expect(Array.isArray(data.deviceTypes)).assertEqual(true); - expect(Array.isArray(data.abilityInfo)).assertEqual(true); - expect(typeof (data.moduleName)).assertEqual("string"); - expect(typeof (data.mainAbilityName)).assertEqual("string"); - console.log("checkHapModuleInfo_expect_typeof_end") - expect(data.name).assertEqual("phone"); - expect(data.description).assertEqual("$string:phone_entry_dsc"); - expect(data.descriptionId).assertEqual(16777221); - expect(data.icon).assertEqual("$media:icon"); - expect(data.label).assertEqual("$string:entry_label"); - expect(data.labelId).assertEqual(16777219); - expect(data.iconId).assertEqual(16777224); - expect(data.backgroundImg).assertEqual(""); - expect(data.supportedModes).assertEqual(0); - expect(data.reqCapabilities.length).assertEqual(0); - expect(data.deviceTypes.length).assertEqual(2); - expect(data.deviceTypes[0]).assertEqual("default"); - expect(data.moduleName).assertEqual("phone") - expect(data.mainAbilityName).assertEqual("com.example.staticextensioninfotest.MainAbility"); - expect(data.installationFree).assertEqual(false); - expect(data.mainElementName).assertEqual('com.example.staticextensioninfotest.MainAbility'); - expect(data.hashValue).assertEqual(''); - console.log("checkHapModuleInfo end " + data); - } - function checkApplicationInfo_0200(data) { - console.log("checkApplicationInfo2 start " + data); - console.log("checkApplicationInfo2 name : " + data.name); - console.log("checkApplicationInfo2 description : " + data.description); - console.log("checkApplicationInfo2 descriptionId : " + data.descriptionId); - console.log("checkApplicationInfo2 systemApp : " + data.systemApp); - console.log("checkApplicationInfo2 enabled : " + data.enabled); - console.log("checkApplicationInfo2 label : " + data.label) - console.log("checkApplicationInfo2 labelId : " + data.labelId); - console.log("checkApplicationInfo2 icon : " + data.icon); - console.log("checkApplicationInfo2 iconId : " + data.iconId); - console.log("checkApplicationInfo2 process : " + data.process); - console.log("checkApplicationInfo2 supportedModes : " + data.supportedModes); - console.log("checkApplicationInfo2 moduleSourceDirs length : " + data.moduleSourceDirs.length); - for (var j = 0; j < data.moduleSourceDirs.length; j++) { - console.log("checkApplicationInfo2 data.moduleSourceDirs[" + j + "] : " + data.moduleSourceDirs[j]); - } - console.log("checkApplicationInfo2 permissions length : " + data.permissions.length); - for (var j = 0; j < data.permissions.length; j++) { - console.log("checkApplicationInfo2 data.permissions[" + j + "] : " + data.permissions[j]); - } - console.log("checkApplicationInfo2 moduleInfos length : " + data.moduleInfos.length); - for (var j = 0; j < data.moduleInfos.length; j++) { - console.log("checkApplicationInfo2 data.moduleInfos[" + j + "].moduleName : " + data.moduleInfos[j].moduleName); - console.log("checkApplicationInfo2 data.moduleInfos[" + j + "].moduleSourceDir:" + - data.moduleInfos[j].moduleSourceDir); - } - console.log("checkApplicationInfo2 entryDir : " + data.entryDir); - console.log("checkApplicationInfo2 codePath : " + data.codePath); - console.log("checkApplicationInfo2 removable: " + data.removable); - - expect(typeof (data)).assertEqual("object"); - expect(typeof (data.name)).assertEqual("string"); - expect(typeof (data.description)).assertEqual("string"); - expect(typeof (data.descriptionId)).assertEqual("number"); - expect(typeof (data.systemApp)).assertEqual("boolean"); - expect(typeof (data.enabled)).assertEqual("boolean"); - expect(typeof (data.label)).assertEqual("string"); - expect(typeof (data.labelId)).assertEqual("string"); - expect(typeof (data.icon)).assertEqual("string"); - expect(typeof (data.iconId)).assertEqual("string"); - expect(typeof (data.process)).assertEqual("string"); - expect(typeof (data.supportedModes)).assertEqual("number"); - expect(Array.isArray(data.moduleSourceDirs)).assertEqual(true); - expect(Array.isArray(data.permissions)).assertEqual(true); - expect(Array.isArray(data.moduleInfos)).assertEqual(true); - expect(typeof (data.entryDir)).assertEqual("string"); - expect(typeof (data.codePath)).assertEqual("string"); - expect(typeof (data.removable)).assertEqual("boolean"); - console.log("checkApplicationInfo_expect_typeof_end") - expect(data.name).assertEqual("com.example.staticextensioninfotest"); - expect(data.description).assertEqual("$string:description_application"); - expect(data.descriptionId).assertLarger(0); - expect(data.systemApp).assertEqual(true); - expect(data.enabled).assertEqual(true); - expect(data.label).assertEqual("$string:app_name"); - expect(data.labelId.length).assertLarger(0); - expect(data.icon).assertEqual("$media:icon"); - expect(data.iconId.length).assertLarger(0); - expect(data.process).assertEqual("com.example.staticextensioninfotest"); - expect(data.supportedModes).assertEqual(0); - expect(data.moduleSourceDirs.length).assertEqual(1); - expect(data.moduleSourceDirs[0]).assertEqual("/data/app/el1/bundle/public/" + - "com.example.staticextensioninfotest/phone"); - expect(data.moduleInfos.length).assertEqual(1); - expect(data.moduleInfos[0].moduleName).assertEqual("phone"); - expect(data.moduleInfos[0].moduleSourceDir).assertEqual("/data/app/el1/bundle/public/" + - "com.example.staticextensioninfotest/phone"); - expect(data.entryDir).assertEqual("/data/app/el1/bundle/public/com.example.staticextensioninfotest" + - "/phone"); - expect(data.codePath).assertEqual("/data/app/el1/bundle/public/com.example.staticextensioninfotest"); - expect(data.removable).assertEqual(true); - console.log("checkApplicationInfo end " + data); - } - }) - - /* - * @tc.number: ACTS_getExtensionInfo_0300 - * @tc.name: Apply StaticExtensionInfo. Connect to StaticExtensionInfoTest to query static information - about an Extension - * @tc.desc: Verify configuration module.json connect service application query property information - */ - it('ACTS_getExtensionInfo_0300', 0, async function (done) { - console.log('ACTS_getExtensionInfo_0300====ACTS_getExtensionInfo_0300_Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ACTS_ConnectAbility_0100_CommonEvent") { - clearTimeout(id); - checkExtensionAbilityInfo(JSON.parse(data.parameters['extensionAbilityInfo'])) - expect(data.event).assertEqual("ACTS_ConnectAbility_0100_CommonEvent"); - commonEvent.unsubscribe(subscriber, unSubscribeCallback) - done(); - } - } - commonEvent.createSubscriber(subscriberInfoStartAbility_0100).then(async (data) => { - console.debug("====>ACTS_getExtensionInfo_0300_Create Subscriber====>"); - subscriber = data; - await commonEvent.subscribe(subscriber, subscribeCallBack); - connId = await globalThis.abilityContext.connectServiceExtensionAbility( - { - bundleName: "com.example.extensionmodule", - abilityName: "ServiceExtAbility", - } - ); - console.log('ACTS_getExtensionInfo_0300 ConnectAbility connId : ' + connId); - }) - - function unSubscribeCallback() { - console.debug("====>ACTS_getExtensionInfo_0300_UnSubscribe CallBack====>"); - } - - function timeout() { - expect().assertFail(); - globalThis.abilityContext.disconnectServiceExtensionAbility( - connId, - (error, data) => { - console.log('DisconnectAbility_0300 result errCode : ' + error.code + " data: " + data) - done(); - }, - ); - console.debug('ACTS_ConnectAbility_0300 timeout'); - done(); - } - - id = setTimeout(timeout, START_ABILITY_TIMEOUT); - - - function checkExtensionAbilityInfo(data) { - console.log("checkHapModuleInfo_expect_typeof_end3") - console.log("checkAbilityInfo metadata length : " + data.metadata.length); - console.log("checkAbilityInfo metadata length : " + data.metadata[0].name); - expect(data.metadata[0].name).assertEqual("ohos.extension.form"); - expect(data.metadata[0].value).assertEqual("MainAbility"); - expect(data.metadata[0].resource).assertEqual("@profile:form_config"); - expect(data.bundleName).assertEqual("com.example.extensionmodule"); - expect(data.moduleName).assertEqual("phone"); - expect(data.name).assertEqual("ServiceExtAbility"); - expect(data.permissions.length).assertEqual(1); - expect(data.permissions[0]).assertEqual("ohos.permission.USE_BLUETOOTH"); - expect(data.isVisible).assertEqual(true); - expect(data.extensionAbilityType).assertLarger(0); - expect(data.readPermission).assertEqual(""); - expect(data.writePermission).assertEqual(""); - expect(data.enabled).assertEqual(true) - console.log("checkExtensionAbilityInfo3 end " + data); - } - }) - }) -} \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index f6a5bd8d95cac42bcdc862e9976dfc58d4cef99b..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,22 +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 './Ability.test.ets' - - -export default function testsuite() { - - abilityTest() - -} \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/module.json deleted file mode 100644 index de288605b3fafa6329f5406a1c526fe292ef6e53..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/module.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "com.example.staticextensioninfo.MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.staticextensioninfo.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.staticextensioninfo.ServiceAbility", - "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.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" - }, - { - "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", - "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" - }, - { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.USE_BLUETOOTH", - "reason":"need use ohos.permission.USE_BLUETOOTH" - } - ] - } -} diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 2977b612ec4595b13eaaffe3e8fc578e83c42d48..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/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/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index 474a55588fd7216113dd42073aadf254d4dba023..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 02221db61d317863114ff0ca4dd2b33586abff12..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/entry/src/main/resources/base/profile/main_pages.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "src": [ - "MainAbility/pages/index/index", - "MainAbility/pages/second/second" - ] -} \ No newline at end of file diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/signature/openharmony_sx.p7b b/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/signature/openharmony_sx.p7b deleted file mode 100755 index dcec6c9615032c1b48bf185e839d9720dd68aab0..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/amscontextualinforquery/actsamsstaticextensioninfotest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/module.json index 26371c56903db190f58dcf70760ebc2a3c0c96fa..abb7c71e70896b375f829b1ce2da38b8ae818b06 100644 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/module.json +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/entry/src/main/module.json @@ -6,8 +6,8 @@ "description": "$string:phone_entry_dsc", "mainElement": "MainAbility", "deviceTypes": [ - "default", - "tablet" + "default", + "tablet" ], "deliveryWithInstall": true, "installationFree": false, @@ -36,48 +36,16 @@ ], "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.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" + "name":"ohos.permission.USE_BLUETOOTH", + "reason":"need use ohos.permission.USE_BLUETOOTH" }, { "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" }, { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.USE_BLUETOOTH", - "reason":"need use ohos.permission.USE_BLUETOOTH" + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" } ] } diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/signature/openharmony_sx.p7b b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/signature/openharmony_sx.p7b index cc53179a48f88f20acc379c138a001e9a15838f6..b7bac195276833f75df9e88f11526507e6b813af 100644 Binary files a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/signature/openharmony_sx.p7b and b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapa/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/module.json index 431571549cd69e350bc6f33b9c0dfd771f18fb14..17e5e428d35f3ec2c1f797888bb87b40ea799371 100644 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/module.json +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/entry/src/main/module.json @@ -6,8 +6,8 @@ "description": "$string:phone_entry_dsc", "mainElement": "MainAbility", "deviceTypes": [ - "default", - "tablet" + "default", + "tablet" ], "deliveryWithInstall": true, "installationFree": false, @@ -36,48 +36,16 @@ ], "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.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" + "name":"ohos.permission.USE_BLUETOOTH", + "reason":"need use ohos.permission.USE_BLUETOOTH" }, { "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" }, { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.USE_BLUETOOTH", - "reason":"need use ohos.permission.USE_BLUETOOTH" + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" } ] } diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/signature/openharmony_sx.p7b b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/signature/openharmony_sx.p7b index cc53179a48f88f20acc379c138a001e9a15838f6..b7bac195276833f75df9e88f11526507e6b813af 100644 Binary files a/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/signature/openharmony_sx.p7b and b/ability/ability_runtime/amscontextualinforquery/actsamsstatichapb/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/module.json index ae44b834b96ea16e2ad7c21e80af49d2ccd4736f..9f169ffcfa46a6ae4d82de7771a984a3f0688ef4 100644 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/module.json +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/entry/src/main/module.json @@ -35,46 +35,18 @@ } ], "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" - } + { + "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", + "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" + }, + { + "name":"ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "reason":"need use ohos.permission.GET_BUNDLE_INFO_PRIVILEGED" + } ] } } diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/signature/openharmony_sx.p7b b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/signature/openharmony_sx.p7b index cc53179a48f88f20acc379c138a001e9a15838f6..1a5303991111ebd68235f9230dcfac6f5f46da82 100644 Binary files a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/signature/openharmony_sx.p7b and b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinfomationquerytest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/test/Ability.test.ets index 696af0228c3406d4a1e9609cb1fa03c29cc1f273..a0f82d4c5152aeb361da4518dc14398716056ff9 100644 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/ets/test/Ability.test.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// @ts-nocheck import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" import commonEvent from '@ohos.commonEvent'; diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/module.json index c56357b7d79f9494d9ce05f14917a14687442912..e03d892786f2efb92a808af8626f88d03d689fb0 100644 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/module.json +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/entry/src/main/module.json @@ -6,8 +6,8 @@ "description": "$string:phone_entry_dsc", "mainElement": "MainAbility", "deviceTypes": [ - "default", - "tablet" + "default", + "tablet" ], "deliveryWithInstall": true, "installationFree": false, @@ -36,48 +36,16 @@ ], "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.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "reason": "need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" + "name": "ohos.permission.USE_BLUETOOTH", + "reason": "need use ohos.permission.USE_BLUETOOTH" }, { "name": "ohos.permission.CLEAN_BACKGROUND_PROCESSES", "reason": "need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" }, { - "name": "ohos.permission.GET_RUNNING_INFO", - "reason": "need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name": "ohos.permission.USE_BLUETOOTH", - "reason": "need use ohos.permission.USE_BLUETOOTH" + "name": "ohos.permission.GET_BUNDLE_INFO", + "reason": "need use ohos.permission.GET_BUNDLE_INFO" } ] } diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/signature/openharmony_sx.p7b b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/signature/openharmony_sx.p7b index cc53179a48f88f20acc379c138a001e9a15838f6..c1dcee7c2bb2bbf69055385392e0c44763a92d0a 100644 Binary files a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/signature/openharmony_sx.p7b and b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultipletest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/test/Ability.test.ets index 66f469c113a02dc23757e43eb725c24d078d1601..96b50083a3f025abcbde389eda30c5d66c336e0b 100644 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/ets/test/Ability.test.ets @@ -12,6 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +// @ts-nocheck import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "@ohos/hypium" import commonEvent from '@ohos.commonEvent'; diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/module.json b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/module.json index a59fe7164ac91ee7bc4e9f706d9fc4d0f307ca19..840408536e6f7fcdf998599ad221a27a35fe358b 100644 --- a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/module.json +++ b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/entry/src/main/module.json @@ -36,48 +36,16 @@ ], "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.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" + "name":"ohos.permission.USE_BLUETOOTH", + "reason":"need use ohos.permission.USE_BLUETOOTH" }, { "name":"ohos.permission.CLEAN_BACKGROUND_PROCESSES", "reason":"need use ohos.permission.CLEAN_BACKGROUND_PROCESSES" }, { - "name":"ohos.permission.GET_RUNNING_INFO", - "reason":"need use ohos.permission.GET_RUNNING_INFO" - }, - { - "name":"ohos.permission.USE_BLUETOOTH", - "reason":"need use ohos.permission.USE_BLUETOOTH" + "name":"ohos.permission.GET_BUNDLE_INFO", + "reason":"need use ohos.permission.GET_BUNDLE_INFO" } ] } diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/signature/openharmony_sx.p7b b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/signature/openharmony_sx.p7b index cc53179a48f88f20acc379c138a001e9a15838f6..2ea119ba2b6ba597ce76683eda447c49c8fc782c 100644 Binary files a/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/signature/openharmony_sx.p7b and b/ability/ability_runtime/amscontextualinforquery/actsamsstaticinformationmultitest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/signature/openharmony_sx.p7b b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..4f6a8633e1ac50a2eb542de9727fb9442aa7cf11 100644 Binary files a/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/signature/openharmony_sx.p7b and b/ability/ability_runtime/amscontextualinforquery/actsamsstaticquerytesttwohap/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/fa/facoverapi/signature/openharmony_sx.p7b b/ability/ability_runtime/fa/facoverapi/signature/openharmony_sx.p7b index bf893c5fa3f7c335b731c76c5ad1b45620889f25..94419d985a8f3b1780b446889281ffadc33769bb 100644 Binary files a/ability/ability_runtime/fa/facoverapi/signature/openharmony_sx.p7b and b/ability/ability_runtime/fa/facoverapi/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/fa/faequeryabilitybywant/signature/openharmony_sx.p7b b/ability/ability_runtime/fa/faequeryabilitybywant/signature/openharmony_sx.p7b index bf893c5fa3f7c335b731c76c5ad1b45620889f25..958e3e85275c5e1b6e0877e642a196a0ef665663 100644 Binary files a/ability/ability_runtime/fa/faequeryabilitybywant/signature/openharmony_sx.p7b and b/ability/ability_runtime/fa/faequeryabilitybywant/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/faapicover/faapicoverhaptest/signature/openharmony_sx.p7b b/ability/ability_runtime/faapicover/faapicoverhaptest/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..2d191e405a480023480ce1c20dd241b40a4a4c56 100644 Binary files a/ability/ability_runtime/faapicover/faapicoverhaptest/signature/openharmony_sx.p7b and b/ability/ability_runtime/faapicover/faapicoverhaptest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/faapicover/faauxiliary/signature/openharmony_sx.p7b b/ability/ability_runtime/faapicover/faauxiliary/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..7c9960e386098f51bafdd5b8f2fb65ad3f5a918b 100644 Binary files a/ability/ability_runtime/faapicover/faauxiliary/signature/openharmony_sx.p7b and b/ability/ability_runtime/faapicover/faauxiliary/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/signature/openharmony_sx.p7b b/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..69bb881419b6d8c5e2ec4f1e5b1a2b54dfb13dc1 100644 Binary files a/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/signature/openharmony_sx.p7b and b/ability/ability_runtime/featureability/sceneproject/finishwithresultemptytest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/signature/openharmony_sx.p7b b/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..91e9b17f32fb53b735ad13276331bbf79571d17e 100644 Binary files a/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/signature/openharmony_sx.p7b and b/ability/ability_runtime/featureability/sceneproject/finishwithresultpromiseparameterstest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/signature/openharmony_sx.p7b b/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..ce4f96c4cb865008ca95ffa40adba7d54a624e9e 100644 Binary files a/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/signature/openharmony_sx.p7b and b/ability/ability_runtime/featureability/sceneproject/finishwithresulttest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/signature/openharmony_sx.p7b b/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..4763e9f38696d07477380d192f432ace51a52839 100644 Binary files a/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/signature/openharmony_sx.p7b and b/ability/ability_runtime/featureability/sceneproject/getcallingbundletest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/featureability/sceneproject/startability/signature/openharmony_sx.p7b b/ability/ability_runtime/featureability/sceneproject/startability/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..b83a714e8a1f112c932f3078e858bda5bacb09c1 100644 Binary files a/ability/ability_runtime/featureability/sceneproject/startability/signature/openharmony_sx.p7b and b/ability/ability_runtime/featureability/sceneproject/startability/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/featureability/sceneproject/startabilityforresult/signature/openharmony_sx.p7b b/ability/ability_runtime/featureability/sceneproject/startabilityforresult/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..331baf0dd65876aff57c027d1f7a2a998b4be296 100644 Binary files a/ability/ability_runtime/featureability/sceneproject/startabilityforresult/signature/openharmony_sx.p7b and b/ability/ability_runtime/featureability/sceneproject/startabilityforresult/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/signature/openharmony_sx.p7b b/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/signature/openharmony_sx.p7b index 66b4457a8a81fb8d3356cf46d67226c850944858..047e992979a291463f0bec693c837307625abf04 100644 Binary files a/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/signature/openharmony_sx.p7b and b/ability/ability_runtime/featureability/sceneproject/terminateabilitytest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/newwant/actsnewwantapi7relyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/signature/openharmony_sx.p7b index 562c6ff7788c72d8ae2fa449e1c0fe2408adb9b6..b2a7f03112e2906aea93f92817e30a343972a997 100644 Binary files a/ability/ability_runtime/newwant/actsnewwantapi7relyhap/signature/openharmony_sx.p7b and b/ability/ability_runtime/newwant/actsnewwantapi7relyhap/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/newwant/actsnewwantarelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/newwant/actsnewwantarelyhap/signature/openharmony_sx.p7b index 9ab79feef4e381f5d172fa4265c75fbaaec870f4..3577be29f9caf39c82d021d6dba69ee7c2014c07 100644 Binary files a/ability/ability_runtime/newwant/actsnewwantarelyhap/signature/openharmony_sx.p7b and b/ability/ability_runtime/newwant/actsnewwantarelyhap/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/newwant/actsnewwantbrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/newwant/actsnewwantbrelyhap/signature/openharmony_sx.p7b index 8a1913b766bc0866c0609b749920bdfd6dcf4d48..1d1210549993520921e2cfafeb0bb5a4972537e8 100644 Binary files a/ability/ability_runtime/newwant/actsnewwantbrelyhap/signature/openharmony_sx.p7b and b/ability/ability_runtime/newwant/actsnewwantbrelyhap/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/newwant/actsnewwantrelyhap/signature/openharmony_sx.p7b b/ability/ability_runtime/newwant/actsnewwantrelyhap/signature/openharmony_sx.p7b index 8a1913b766bc0866c0609b749920bdfd6dcf4d48..beb3f8901b628257daeac40b4fd2d3de09d3d99c 100755 Binary files a/ability/ability_runtime/newwant/actsnewwantrelyhap/signature/openharmony_sx.p7b and b/ability/ability_runtime/newwant/actsnewwantrelyhap/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/newwant/actsnewwanttest/signature/openharmony_sx.p7b b/ability/ability_runtime/newwant/actsnewwanttest/signature/openharmony_sx.p7b index fb73cb2102adb0e4650d718689414f394ee9ad9e..3cbbdb3a812eef551228a66359af0309f9039ec3 100644 Binary files a/ability/ability_runtime/newwant/actsnewwanttest/signature/openharmony_sx.p7b and b/ability/ability_runtime/newwant/actsnewwanttest/signature/openharmony_sx.p7b differ diff --git a/ability/ability_runtime/zidltest/BUILD.gn b/ability/ability_runtime/zidltest/BUILD.gn deleted file mode 100644 index c69bcff75081286174e6dcd57cb965057c7c23c4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/BUILD.gn +++ /dev/null @@ -1,24 +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") - -group("zidltest") { - testonly = true - if (is_standard_system) { - deps = [ - "actsamszidlclienttest:ActsAmsZidlClientTest", - "actsamszidlservice:ActsAmsZidlServiceRelyHap", - ] - } -} diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/AppScope/app.json b/ability/ability_runtime/zidltest/actsamszidlclienttest/AppScope/app.json deleted file mode 100644 index 3567b671b330d5000c31f698382abd15a10fcab7..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app":{ - "bundleName":"com.example.zidlclienttest", - "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/zidltest/actsamszidlclienttest/AppScope/resources/base/element/string.json b/ability/ability_runtime/zidltest/actsamszidlclienttest/AppScope/resources/base/element/string.json deleted file mode 100644 index ee69f9a861d9dc269ed6638735d52674583498e1..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/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/zidltest/actsamszidlclienttest/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/zidltest/actsamszidlclienttest/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index 474a55588fd7216113dd42073aadf254d4dba023..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/zidltest/actsamszidlclienttest/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/BUILD.gn b/ability/ability_runtime/zidltest/actsamszidlclienttest/BUILD.gn deleted file mode 100644 index e846967bd3906d57aaaca238236d339f8864a8c0..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/BUILD.gn +++ /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("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsAmsZidlClientTest") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":actsamszidlclienttest_js_assets", - ":actsamszidlclienttest_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAmsZidlClientTest" - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("actsamszidlclienttest_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actsamszidlclienttest_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("actsamszidlclienttest_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":actsamszidlclienttest_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/Test.json b/ability/ability_runtime/zidltest/actsamszidlclienttest/Test.json deleted file mode 100644 index dd53882afeddf9397989f323c34a867f69d4fd7a..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/Test.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "com.example.zidlclienttest", - "shell-timeout": "300000" - }, - "kits": [ - { - "test-file-name": [ - "ActsAmsZidlClientTest.hap", - "ActsAmsZidlServiceRelyHap.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "remount" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "chmod 644 /data/*.hap" - ] - } - ] -} diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 953114c1b479f368cb6c6bd456f0a171a358d148..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/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.app.ability.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 0123f81b1466efdb97fe0d8ecf3cd94dab336f54..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,51 +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.app.ability.UIAbility' - -export default class MainAbility extends Ability { - onCreate(want,launchParam){ - // Ability is creating, initialize resources for this ability - console.log("ZidlClientTest onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("ZidlClientTest onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("ZidlClientTest onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index/index", null) - console.log("ZidlClientTest onWindowStageCreate finish") - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("ZidlClientTest onWindowStageDestroy") - } - - onForeground() { - // Ability has brought to foreground - console.log("ZidlClientTest onForeground") - } - - onBackground() { - // Ability has back to background - console.log("ZidlClientTest onBackground") - } -}; \ No newline at end of file diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index 7b18b7c147cd0cc232b5779698c1c264bc7f717e..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,434 +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 Want from '@ohos.application.Want'; -import {voidOutStringCallback} from "./zidlTool/i_zidl_tool_test"; -import {voidOutIntCallback} from "./zidlTool/i_zidl_tool_test"; -import {voidOutMapStringIntCallback} from "./zidlTool/i_zidl_tool_test"; -import {voidOutStringArrayCallback} from "./zidlTool/i_zidl_tool_test"; -import {voidInOutMapStringIntCallback} from "./zidlTool/i_zidl_tool_test"; -import {voidInOutStringArrayCallback} from "./zidlTool/i_zidl_tool_test"; -import {voidInOutIntCallback} from "./zidlTool/i_zidl_tool_test"; -import {voidInOutStringCallback} from "./zidlTool/i_zidl_tool_test"; -import {booleanVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {byteVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {shortVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {intVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {longVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {floatVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {doubleVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {stringVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {sequenceableVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {interfaceVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {mapStringStringVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {doubleArrayVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {voidOrderOutInCallback} from "./zidlTool/i_zidl_tool_test" -import {voidOrderInOutInCallback} from "./zidlTool/i_zidl_tool_test" -import {voidOrderOutInOutCallback} from "./zidlTool/i_zidl_tool_test" -import {voidOrderInInOutOutCallback} from "./zidlTool/i_zidl_tool_test" -import {onewayVoidVoidCallback} from "./zidlTool/i_zidl_tool_test" -import {voidInMapStringIntCallback} from "./zidlTool/i_zidl_tool_test" -import {voidVoidCallback} from "./zidlTool/i_zidl_tool_test" -import {voidInStringArrayCallback} from "./zidlTool/i_zidl_tool_test" -import ZidlTestServiceStub from './zidlTool/zidl_tool_test_stub'; -import MySequenceable from "./zidlTool/my_sequenceable"; -import InterfaceDeclareProxy from './interfaceDeclare/interface_declare_proxy' -import InterfaceDeclareStub from './interfaceDeclare/interface_declare_stub' -import {voidInIntCallback} from "./zidlTool/i_zidl_tool_test" -import {voidInStringCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeBooleanCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeByteCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeShortCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeIntCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeLongCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeFloatCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeDoubleCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeStringCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeSequenceableCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeInterfaceCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeMapStringStringCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeDoubleArrayCallback} from "./zidlTool/i_zidl_tool_test" -import {testInterfaceCallback} from './interfaceDeclare/i_interface_declare' - -var SUCCESS = 0; -var FAIL = 1; - -class ZidlTestImp extends ZidlTestServiceStub { - - onewayVoidVoid(callback: onewayVoidVoidCallback) { - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_0200 called"); - callback(SUCCESS); - } - - voidVoid(callback: voidVoidCallback) { - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_0300 called"); - callback(SUCCESS); - } - - booleanVoid(callback: booleanVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_0400 called"); - var boolean = true; - callback(SUCCESS, boolean); - } - - byteVoid(callback: byteVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_0500 called"); - var mybyte = 1; - callback(SUCCESS, mybyte); - } - - shortVoid(callback: shortVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_0600 called"); - var myshort = 222; - callback(SUCCESS, myshort); - } - - intVoid(callback: intVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_0700 called"); - var myint = 333; - callback(SUCCESS, myint); - } - - longVoid(callback: longVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_0800 called"); - var mylong = 4444; - callback(SUCCESS, mylong); - } - - floatVoid(callback: floatVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_0900 called"); - var myfloat = 10.1; - callback(SUCCESS, myfloat); - } - - doubleVoid(callback: doubleVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_1000 called"); - var mydouble = 22.1; - callback(SUCCESS, mydouble); - } - - stringVoid(callback: stringVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_1100 called"); - var mystring = "stringVoid"; - callback(SUCCESS, mystring); - } - - sequenceableVoid(callback: sequenceableVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_1200 called"); - let mySequence = new MySequenceable(); - callback(SUCCESS, mySequence); - } - - interfaceVoid(callback: interfaceVoidCallback) { - class InterfaceDeclare extends InterfaceDeclareStub { - testInterface(data: number, callback: testInterfaceCallback): void{ - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_1300 interfaceStub called"); - let result = FAIL; - - if (data == 1500) { - result = SUCCESS; - } - callback(result); - } - } - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_1300 toolStub called"); - let serverInterface = new InterfaceDeclare('serverInterface'); - callback(SUCCESS, serverInterface); - } - - mapStringStringVoid(callback: mapStringStringVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_1400 called"); - let myMap = new Map(); - myMap.set("string1","string2"); - callback(SUCCESS, myMap); - } - - doubleArrayVoid(callback: doubleArrayVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_1500 called"); - var array = [1.1, 2.1, 3.1]; - callback(SUCCESS, array); - } - - voidInMapStringInt(myMap, callback: voidInMapStringIntCallback){ - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_1600_1 called:'+ myMap.get("string1")); - if(myMap.get("string1") == 1){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidInStringArray(strarray, callback: voidInStringArrayCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_1600_2 called:"+ JSON.stringify(strarray)); - if(strarray[0] == "aaa"&&strarray[1] == "bbb"&&strarray[2] == "ccc"){ - callback(SUCCESS); - }else { - callback(FAIL); - } - } - - voidOutMapStringInt(callback : voidOutMapStringIntCallback){ - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_1700 called'); - var map=new Map(); - map.set("voidOutMapStringInt", 1); - callback(SUCCESS, map); - } - - voidOutStringArray(callback :voidOutStringArrayCallback){ - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_1700 called'); - var strarray = ["aa", "dd"]; - callback(SUCCESS, strarray); - } - - voidInOutMapStringInt(mapIn, callback: voidInOutMapStringIntCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_1800 called'); - var errCode = FAIL; - if ((mapIn.get("voidInOutMapStringInt1") == 1801) && - (mapIn.get("voidInOutMapStringInt2") == 1802)) { - mapIn.set("voidInOutMapStringInt1", 1802); - mapIn.set("voidInOutMapStringInt2", 1801); - errCode = SUCCESS; - } - callback(errCode, mapIn); - } - - voidInOutStringArray(strArrayIn, callback: voidInOutStringArrayCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_1800 called'); - var errCode = FAIL; - if ((strArrayIn[0] == "ddd") && - (strArrayIn[1] == "ccc")) { - strArrayIn[0] = "aaa"; - strArrayIn[1] = "bbb"; - errCode = SUCCESS; - } - callback(errCode, strArrayIn); - } - - voidInInt(number, callback : voidInIntCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_1900 called:'+ JSON.stringify(number)); - if(number == 8888){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidInString(string, callback : voidInStringCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_1900 called:'+ JSON.stringify(string)); - if(string == "voidInString"){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidOutInt(callback : voidOutIntCallback){ - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_2000 called'); - var number = 123; - callback(SUCCESS, number); - } - - voidOutString(callback : voidOutStringCallback){ - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_2000 called'); - var string = "voidOutString"; - callback(SUCCESS, string); - } - - voidInOutInt(number, callback: voidInOutIntCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_2100_1 called:'+ JSON.stringify(number)); - var num = 456789; - if(number == 123456){ - callback(SUCCESS, num); - }else{ - callback(FAIL, number); - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_2100_1 Call_Fail') - } - } - voidInOutString(strinput, callback: voidInOutStringCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_2100_2 called:'+ JSON.stringify(strinput)); - var str = "456789"; - if(strinput == "voidInOutString"){ - callback(SUCCESS, str); - }else{ - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_2100_2 Call_Fail'); - callback(FAIL, strinput); - } - } - - voidParameterTypeBoolean(oBooleanTrue, callback : voidParameterTypeBooleanCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_2200 called:'+ JSON.stringify(oBooleanTrue)); - if(oBooleanTrue == true){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidParameterTypeByte(number, callback : voidParameterTypeByteCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_2300 called:'+ JSON.stringify(number)); - if(number == 1111){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidParameterTypeShort(number, callback : voidParameterTypeShortCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_2400 called:'+ JSON.stringify(number)); - if(number == 2222){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidParameterTypeInt(number, callback : voidParameterTypeIntCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_2500 called:'+ JSON.stringify(number)); - if(number == 3333){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidParameterTypeLong(number, callback : voidParameterTypeLongCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_2600 called:'+ JSON.stringify(number)); - if(number == 4444){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidParameterTypeFloat(number, callback : voidParameterTypeFloatCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_2700 called:'+ JSON.stringify(number)); - if(number == 5555.1){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidParameterTypeDouble(number, callback : voidParameterTypeDoubleCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_2800 called:'+ JSON.stringify(number)); - if(number == 6666.1){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidParameterTypeString(string, callback : voidParameterTypeStringCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_2900 called:'+ JSON.stringify(string)); - if(string == "voidParameterTypeString"){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidParameterTypeSequenceable(MySequenceable, callback : voidParameterTypeSequenceableCallback) { - console.log('ZidlTest Process Server ACTS_Zidl_Js2JsSingle_3000 called:'+ JSON.stringify(MySequenceable)); - if((MySequenceable != null) && (MySequenceable.getNum() == 32) && (MySequenceable.getString() == "nihao")){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidParameterTypeInterface(param: InterfaceDeclareProxy, callback : voidParameterTypeInterfaceCallback) { - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_3100 called"); - let proxy = new InterfaceDeclareProxy(param); - proxy.testInterface(3300, (errCode)=>{ - if (errCode == SUCCESS) { - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_3100 callback SUCCESS"); - callback(SUCCESS); - } else { - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_3100 callback FAIL"); - callback(FAIL); - } - }); - - } - - voidParameterTypeMapStringString(map, callback : voidParameterTypeMapStringStringCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_3200 called:'+ map.get("voidParameterTypeMapStringString")); - if(map.get("voidParameterTypeMapStringString") == "fdhatdh"){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidParameterTypeDoubleArray(array, callback : voidParameterTypeDoubleArrayCallback){ - console.log('ZidlTest Server ACTS_Zidl_Js2JsSingle_3300 called:'+ JSON.stringify(array)); - if(array.length == 2 && array[0] == 1.1 && array[1] == 2.1){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidOrderOutIn(paramI, callback: voidOrderOutInCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_3400 called" + paramI); - var mystring = "hello world"; - callback(SUCCESS, mystring); - } - - voidOrderInOutIn(paramI, paramS, callback: voidOrderInOutInCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_3500 called" + paramI + " " + paramS); - var mynumber = 6; - callback(SUCCESS, mynumber); - } - - voidOrderOutInOut(paramS, callback: voidOrderOutInOutCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_3600 called" + paramS); - var mynumber = 3; - var mystring = "paramcallback"; - callback(SUCCESS, mynumber, mystring); - } - - voidOrderInInOutOut(paramS, paramI, callback: voidOrderInInOutOutCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_3700 called" + paramS + " " + paramI); - var mystring = "callback"; - var mynumber = 4; - callback(SUCCESS, mynumber, mystring); - } -} - -export default class ServiceAbility extends ServiceExtension { - onCreate(want: Want) { - globalThis.abilityWant = want; - console.log('ZidlClientTest ServiceAbility onCreate, want: ' + want.abilityName); - } - - onRequest(want, startId) { - console.log('ZidlClientTest ServiceAbility onRequest, want: ' + want.abilityName - + ', startId: ' + startId); - } - - onConnect(want) { - console.log('ZidlClientTest ServiceAbility onConnect, want:' + want.abilityName); - return new ZidlTestImp('connect'); - } - - onDisconnect(want) { - console.log('ZidlClientTest ServiceAbility onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ZidlClientTest ServiceAbility onDestroy'); - } -}; diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts deleted file mode 100644 index a9469ce4d7e1d4fbd3ec452076ab8121b8b8adf7..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts +++ /dev/null @@ -1,21 +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. - */ - - -export default interface IInterfaceDeclare { - testInterface(data: number, callback: testInterfaceCallback): void; -} -export type testInterfaceCallback = (errCode: number) => void; - diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts deleted file mode 100644 index 9f9cc9c43d3b15599f88aa223e7308c43b997e60..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts +++ /dev/null @@ -1,44 +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 {testInterfaceCallback} from "./i_interface_declare"; -import IInterfaceDeclare from "./i_interface_declare"; -import rpc from "@ohos.rpc"; - -export default class InterfaceDeclareProxy implements IInterfaceDeclare { - constructor(proxy) { - this.proxy = proxy; - } - - testInterface(data: number, callback: testInterfaceCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeInt(data); - this.proxy.sendRequest(InterfaceDeclareProxy.COMMAND_TEST_INTERFACE, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - static readonly COMMAND_TEST_INTERFACE = 1; - private proxy -} - diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts deleted file mode 100644 index 1606f77b4c0390be639f06cb093ee672cf05d478..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts +++ /dev/null @@ -1,47 +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 {testInterfaceCallback} from "./i_interface_declare"; -import IInterfaceDeclare from "./i_interface_declare"; -import rpc from "@ohos.rpc"; - -export default class InterfaceDeclareStub extends rpc.RemoteObject implements IInterfaceDeclare { - constructor(des: string) { - super(des); - } - - onRemoteRequest(code: number, data, reply, option): boolean { - console.log("onRemoteRequest called, code = " + code); - switch(code) { - case InterfaceDeclareStub.COMMAND_TEST_INTERFACE: { - let _data = data.readInt(); - this.testInterface(_data, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - default: { - console.log("invalid request code" + code); - break; - } - } - return false; - } - - testInterface(data: number, callback: testInterfaceCallback): void{} - - static readonly COMMAND_TEST_INTERFACE = 1; -} - diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/service.ts deleted file mode 100644 index b49731a414958a281c2f0c4eab0e7fb408eb2c2f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/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/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/i_zidl_tool_test.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/i_zidl_tool_test.ts deleted file mode 100644 index ac9da635209b8b8a170f587485ab01a1e9844fcb..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/i_zidl_tool_test.ts +++ /dev/null @@ -1,105 +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 MySequenceable from "./my_sequenceable"; -import IInterfaceDeclare from "../interfaceDeclare/i_interface_declare"; - -export default interface IZidlToolTest { - onewayVoidVoid(callback: onewayVoidVoidCallback): void; - voidVoid(callback: voidVoidCallback): void; - booleanVoid(callback: booleanVoidCallback): void; - byteVoid(callback: byteVoidCallback): void; - shortVoid(callback: shortVoidCallback): void; - intVoid(callback: intVoidCallback): void; - longVoid(callback: longVoidCallback): void; - floatVoid(callback: floatVoidCallback): void; - doubleVoid(callback: doubleVoidCallback): void; - stringVoid(callback: stringVoidCallback): void; - sequenceableVoid(callback: sequenceableVoidCallback): void; - interfaceVoid(callback: interfaceVoidCallback): void; - mapStringStringVoid(callback: mapStringStringVoidCallback): void; - doubleArrayVoid(callback: doubleArrayVoidCallback): void; - voidInMapStringInt(param: Map, callback: voidInMapStringIntCallback): void; - voidInStringArray(param: string[], callback: voidInStringArrayCallback): void; - voidOutMapStringInt(callback: voidOutMapStringIntCallback): void; - voidOutStringArray(callback: voidOutStringArrayCallback): void; - voidInOutMapStringInt(param: Map, callback: voidInOutMapStringIntCallback): void; - voidInOutStringArray(param: string[], callback: voidInOutStringArrayCallback): void; - voidInInt(param: number, callback: voidInIntCallback): void; - voidInString(param: string, callback: voidInStringCallback): void; - voidOutInt(callback: voidOutIntCallback): void; - voidOutString(callback: voidOutStringCallback): void; - voidInOutInt(param: number, callback: voidInOutIntCallback): void; - voidInOutString(param: string, callback: voidInOutStringCallback): void; - voidParameterTypeBoolean(param: boolean, callback: voidParameterTypeBooleanCallback): void; - voidParameterTypeByte(param: number, callback: voidParameterTypeByteCallback): void; - voidParameterTypeShort(param: number, callback: voidParameterTypeShortCallback): void; - voidParameterTypeInt(param: number, callback: voidParameterTypeIntCallback): void; - voidParameterTypeLong(param: number, callback: voidParameterTypeLongCallback): void; - voidParameterTypeFloat(param: number, callback: voidParameterTypeFloatCallback): void; - voidParameterTypeDouble(param: number, callback: voidParameterTypeDoubleCallback): void; - voidParameterTypeString(param: string, callback: voidParameterTypeStringCallback): void; - voidParameterTypeSequenceable(param: MySequenceable, callback: voidParameterTypeSequenceableCallback): void; - voidParameterTypeInterface(param: IInterfaceDeclare, callback: voidParameterTypeInterfaceCallback): void; - voidParameterTypeMapStringString(param: Map, callback: voidParameterTypeMapStringStringCallback): void; - voidParameterTypeDoubleArray(param: number[], callback: voidParameterTypeDoubleArrayCallback): void; - voidOrderOutIn(paramI: number, callback: voidOrderOutInCallback): void; - voidOrderInOutIn(paramI: number, paramS: string, callback: voidOrderInOutInCallback): void; - voidOrderOutInOut(paramS: string, callback: voidOrderOutInOutCallback): void; - voidOrderInInOutOut(paramS: string, paramI: number, callback: voidOrderInInOutOutCallback): void; -} -export type onewayVoidVoidCallback = (errCode: number) => void; -export type voidVoidCallback = (errCode: number) => void; -export type booleanVoidCallback = (errCode: number, returnValue: boolean) => void; -export type byteVoidCallback = (errCode: number, returnValue: number) => void; -export type shortVoidCallback = (errCode: number, returnValue: number) => void; -export type intVoidCallback = (errCode: number, returnValue: number) => void; -export type longVoidCallback = (errCode: number, returnValue: number) => void; -export type floatVoidCallback = (errCode: number, returnValue: number) => void; -export type doubleVoidCallback = (errCode: number, returnValue: number) => void; -export type stringVoidCallback = (errCode: number, returnValue: string) => void; -export type sequenceableVoidCallback = (errCode: number, returnValue: MySequenceable) => void; -export type interfaceVoidCallback = (errCode: number, returnValue: IInterfaceDeclare) => void; -export type mapStringStringVoidCallback = (errCode: number, returnValue: Map) => void; -export type doubleArrayVoidCallback = (errCode: number, returnValue: number[]) => void; -export type voidInMapStringIntCallback = (errCode: number) => void; -export type voidInStringArrayCallback = (errCode: number) => void; -export type voidOutMapStringIntCallback = (errCode: number, param: Map) => void; -export type voidOutStringArrayCallback = (errCode: number, param: string[]) => void; -export type voidInOutMapStringIntCallback = (errCode: number, param: Map) => void; -export type voidInOutStringArrayCallback = (errCode: number, param: string[]) => void; -export type voidInIntCallback = (errCode: number) => void; -export type voidInStringCallback = (errCode: number) => void; -export type voidOutIntCallback = (errCode: number, param: number) => void; -export type voidOutStringCallback = (errCode: number, param: string) => void; -export type voidInOutIntCallback = (errCode: number, param: number) => void; -export type voidInOutStringCallback = (errCode: number, param: string) => void; -export type voidParameterTypeBooleanCallback = (errCode: number) => void; -export type voidParameterTypeByteCallback = (errCode: number) => void; -export type voidParameterTypeShortCallback = (errCode: number) => void; -export type voidParameterTypeIntCallback = (errCode: number) => void; -export type voidParameterTypeLongCallback = (errCode: number) => void; -export type voidParameterTypeFloatCallback = (errCode: number) => void; -export type voidParameterTypeDoubleCallback = (errCode: number) => void; -export type voidParameterTypeStringCallback = (errCode: number) => void; -export type voidParameterTypeSequenceableCallback = (errCode: number) => void; -export type voidParameterTypeInterfaceCallback = (errCode: number) => void; -export type voidParameterTypeMapStringStringCallback = (errCode: number) => void; -export type voidParameterTypeDoubleArrayCallback = (errCode: number) => void; -export type voidOrderOutInCallback = (errCode: number, paramS: string) => void; -export type voidOrderInOutInCallback = (errCode: number, paramI: number) => void; -export type voidOrderOutInOutCallback = (errCode: number, paramI: number, paramS: string) => void; -export type voidOrderInInOutOutCallback = (errCode: number, paramI: number, paramS2: string) => void; - diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts deleted file mode 100644 index bef9dcbe25c82b2c96e8ac8cc6493ce3d080baf6..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts +++ /dev/null @@ -1,28 +0,0 @@ -export default class MySequenceable { - constructor() { - this.num = 14; - this.str = "hello"; - } - getNum() : number { - return this.num; - } - - getString() : string { - return this.str; - } - - marshalling(messageParcel) { - console.info('marshalling++++'); - messageParcel.writeInt(this.num); - messageParcel.writeString(this.str); - return true; - } - unmarshalling(messageParcel) { - console.info('unmarshalling++++'); - this.num = messageParcel.readInt(); - this.str = messageParcel.readString(); - return true; - } - private num; - private str; -} \ No newline at end of file diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/zidl_tool_test_stub.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/zidl_tool_test_stub.ts deleted file mode 100644 index 466bc3d6040a0b3c01ca401b05d96dc1a55cacb9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility/zidlTool/zidl_tool_test_stub.ts +++ /dev/null @@ -1,549 +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 {onewayVoidVoidCallback} from "./i_zidl_tool_test"; -import {voidVoidCallback} from "./i_zidl_tool_test"; -import {booleanVoidCallback} from "./i_zidl_tool_test"; -import {byteVoidCallback} from "./i_zidl_tool_test"; -import {shortVoidCallback} from "./i_zidl_tool_test"; -import {intVoidCallback} from "./i_zidl_tool_test"; -import {longVoidCallback} from "./i_zidl_tool_test"; -import {floatVoidCallback} from "./i_zidl_tool_test"; -import {doubleVoidCallback} from "./i_zidl_tool_test"; -import {stringVoidCallback} from "./i_zidl_tool_test"; -import {sequenceableVoidCallback} from "./i_zidl_tool_test"; -import {interfaceVoidCallback} from "./i_zidl_tool_test"; -import {mapStringStringVoidCallback} from "./i_zidl_tool_test"; -import {doubleArrayVoidCallback} from "./i_zidl_tool_test"; -import {voidInMapStringIntCallback} from "./i_zidl_tool_test"; -import {voidInStringArrayCallback} from "./i_zidl_tool_test"; -import {voidOutMapStringIntCallback} from "./i_zidl_tool_test"; -import {voidOutStringArrayCallback} from "./i_zidl_tool_test"; -import {voidInOutMapStringIntCallback} from "./i_zidl_tool_test"; -import {voidInOutStringArrayCallback} from "./i_zidl_tool_test"; -import {voidInIntCallback} from "./i_zidl_tool_test"; -import {voidInStringCallback} from "./i_zidl_tool_test"; -import {voidOutIntCallback} from "./i_zidl_tool_test"; -import {voidOutStringCallback} from "./i_zidl_tool_test"; -import {voidInOutIntCallback} from "./i_zidl_tool_test"; -import {voidInOutStringCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeBooleanCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeByteCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeShortCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeIntCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeLongCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeFloatCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeDoubleCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeStringCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeSequenceableCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeInterfaceCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeMapStringStringCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeDoubleArrayCallback} from "./i_zidl_tool_test"; -import {voidOrderOutInCallback} from "./i_zidl_tool_test"; -import {voidOrderInOutInCallback} from "./i_zidl_tool_test"; -import {voidOrderOutInOutCallback} from "./i_zidl_tool_test"; -import {voidOrderInInOutOutCallback} from "./i_zidl_tool_test"; -import IZidlToolTest from "./i_zidl_tool_test"; -import rpc from "@ohos.rpc"; -import MySequenceable from "./my_sequenceable"; -import IInterfaceDeclare from "../interfaceDeclare/i_interface_declare"; -import InterfaceDeclareStub from "../interfaceDeclare/interface_declare_stub"; - -export default class ZidlToolTestStub extends rpc.RemoteObject implements IZidlToolTest { - constructor(des: string) { - super(des); - } - - onRemoteRequest(code: number, data, reply, option): boolean { - console.log("onRemoteRequest called, code = " + code); - switch(code) { - case ZidlToolTestStub.COMMAND_ONEWAY_VOID_VOID: { - this.onewayVoidVoid((errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_VOID: { - this.voidVoid((errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_BOOLEAN_VOID: { - this.booleanVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(returnValue ? 1 : 0); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_BYTE_VOID: { - this.byteVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(returnValue); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_SHORT_VOID: { - this.shortVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(returnValue); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_INT_VOID: { - this.intVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(returnValue); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_LONG_VOID: { - this.longVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeLong(returnValue); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_FLOAT_VOID: { - this.floatVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeFloat(returnValue); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_DOUBLE_VOID: { - this.doubleVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeDouble(returnValue); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_STRING_VOID: { - this.stringVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeString(returnValue); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_SEQUENCEABLE_VOID: { - this.sequenceableVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeSequenceable(returnValue); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_INTERFACE_VOID: { - this.interfaceVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeRemoteObject(returnValue as InterfaceDeclareStub); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_MAP_STRING_STRING_VOID: { - this.mapStringStringVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(returnValue.size); - for (let [key, value] of returnValue) { - reply.writeString(key); - reply.writeString(value); - } - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_DOUBLE_ARRAY_VOID: { - this.doubleArrayVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeDoubleArray(returnValue); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_IN_MAP_STRING_INT: { - let _param = new Map(); - let _paramSize = data.readInt(); - for (let i = 0; i < _paramSize; ++i) { - let key = data.readString(); - let value = data.readInt(); - _param.set(key, value); - } - this.voidInMapStringInt(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_IN_STRING_ARRAY: { - let _param = data.readStringArray(); - this.voidInStringArray(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_OUT_MAP_STRING_INT: { - this.voidOutMapStringInt((errCode, param) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(param.size); - for (let [key, value] of param) { - reply.writeString(key); - reply.writeInt(value); - } - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_OUT_STRING_ARRAY: { - this.voidOutStringArray((errCode, param) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeStringArray(param); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_IN_OUT_MAP_STRING_INT: { - let _param = new Map(); - let _paramSize = data.readInt(); - for (let i = 0; i < _paramSize; ++i) { - let key = data.readString(); - let value = data.readInt(); - _param.set(key, value); - } - this.voidInOutMapStringInt(_param, (errCode, param) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(param.size); - for (let [key, value] of param) { - reply.writeString(key); - reply.writeInt(value); - } - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_IN_OUT_STRING_ARRAY: { - let _param = data.readStringArray(); - this.voidInOutStringArray(_param, (errCode, param) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeStringArray(param); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_IN_INT: { - let _param = data.readInt(); - this.voidInInt(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_IN_STRING: { - let _param = data.readString(); - this.voidInString(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_OUT_INT: { - this.voidOutInt((errCode, param) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(param); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_OUT_STRING: { - this.voidOutString((errCode, param) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeString(param); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_IN_OUT_INT: { - let _param = data.readInt(); - this.voidInOutInt(_param, (errCode, param) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(param); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_IN_OUT_STRING: { - let _param = data.readString(); - this.voidInOutString(_param, (errCode, param) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeString(param); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_BOOLEAN: { - let _param = data.readInt() == 1 ? true : false; - this.voidParameterTypeBoolean(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_BYTE: { - let _param = data.readInt(); - this.voidParameterTypeByte(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_SHORT: { - let _param = data.readInt(); - this.voidParameterTypeShort(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_INT: { - let _param = data.readInt(); - this.voidParameterTypeInt(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_LONG: { - let _param = data.readLong(); - this.voidParameterTypeLong(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_FLOAT: { - let _param = data.readFloat(); - this.voidParameterTypeFloat(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_DOUBLE: { - let _param = data.readDouble(); - this.voidParameterTypeDouble(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_STRING: { - let _param = data.readString(); - this.voidParameterTypeString(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_SEQUENCEABLE: { - let _param = new MySequenceable(); - data.readSequenceable(_param); - this.voidParameterTypeSequenceable(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_INTERFACE: { - let _param = data.readRemoteObject(); - this.voidParameterTypeInterface(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_MAP_STRING_STRING: { - let _param = new Map(); - let _paramSize = data.readInt(); - for (let i = 0; i < _paramSize; ++i) { - let key = data.readString(); - let value = data.readString(); - _param.set(key, value); - } - this.voidParameterTypeMapStringString(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_DOUBLE_ARRAY: { - let _param = data.readDoubleArray(); - this.voidParameterTypeDoubleArray(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_ORDER_OUT_IN: { - let _paramI = data.readInt(); - this.voidOrderOutIn(_paramI, (errCode, paramS) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeString(paramS); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_ORDER_IN_OUT_IN: { - let _paramI = data.readInt(); - let _paramS = data.readString(); - this.voidOrderInOutIn(_paramI, _paramS, (errCode, paramI) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(paramI); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_ORDER_OUT_IN_OUT: { - let _paramS = data.readString(); - this.voidOrderOutInOut(_paramS, (errCode, paramI, paramS) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(paramI); - reply.writeString(paramS); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_ORDER_IN_IN_OUT_OUT: { - let _paramS = data.readString(); - let _paramI = data.readInt(); - this.voidOrderInInOutOut(_paramS, _paramI, (errCode, paramI, paramS2) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(paramI); - reply.writeString(paramS2); - } - }); - return true; - } - default: { - console.log("invalid request code" + code); - break; - } - } - return false; - } - - onewayVoidVoid(callback: onewayVoidVoidCallback): void{} - voidVoid(callback: voidVoidCallback): void{} - booleanVoid(callback: booleanVoidCallback): void{} - byteVoid(callback: byteVoidCallback): void{} - shortVoid(callback: shortVoidCallback): void{} - intVoid(callback: intVoidCallback): void{} - longVoid(callback: longVoidCallback): void{} - floatVoid(callback: floatVoidCallback): void{} - doubleVoid(callback: doubleVoidCallback): void{} - stringVoid(callback: stringVoidCallback): void{} - sequenceableVoid(callback: sequenceableVoidCallback): void{} - interfaceVoid(callback: interfaceVoidCallback): void{} - mapStringStringVoid(callback: mapStringStringVoidCallback): void{} - doubleArrayVoid(callback: doubleArrayVoidCallback): void{} - voidInMapStringInt(param: Map, callback: voidInMapStringIntCallback): void{} - voidInStringArray(param: string[], callback: voidInStringArrayCallback): void{} - voidOutMapStringInt(callback: voidOutMapStringIntCallback): void{} - voidOutStringArray(callback: voidOutStringArrayCallback): void{} - voidInOutMapStringInt(param: Map, callback: voidInOutMapStringIntCallback): void{} - voidInOutStringArray(param: string[], callback: voidInOutStringArrayCallback): void{} - voidInInt(param: number, callback: voidInIntCallback): void{} - voidInString(param: string, callback: voidInStringCallback): void{} - voidOutInt(callback: voidOutIntCallback): void{} - voidOutString(callback: voidOutStringCallback): void{} - voidInOutInt(param: number, callback: voidInOutIntCallback): void{} - voidInOutString(param: string, callback: voidInOutStringCallback): void{} - voidParameterTypeBoolean(param: boolean, callback: voidParameterTypeBooleanCallback): void{} - voidParameterTypeByte(param: number, callback: voidParameterTypeByteCallback): void{} - voidParameterTypeShort(param: number, callback: voidParameterTypeShortCallback): void{} - voidParameterTypeInt(param: number, callback: voidParameterTypeIntCallback): void{} - voidParameterTypeLong(param: number, callback: voidParameterTypeLongCallback): void{} - voidParameterTypeFloat(param: number, callback: voidParameterTypeFloatCallback): void{} - voidParameterTypeDouble(param: number, callback: voidParameterTypeDoubleCallback): void{} - voidParameterTypeString(param: string, callback: voidParameterTypeStringCallback): void{} - voidParameterTypeSequenceable(param: MySequenceable, callback: voidParameterTypeSequenceableCallback): void{} - voidParameterTypeInterface(param: IInterfaceDeclare, callback: voidParameterTypeInterfaceCallback): void{} - voidParameterTypeMapStringString(param: Map, callback: voidParameterTypeMapStringStringCallback): void{} - voidParameterTypeDoubleArray(param: number[], callback: voidParameterTypeDoubleArrayCallback): void{} - voidOrderOutIn(paramI: number, callback: voidOrderOutInCallback): void{} - voidOrderInOutIn(paramI: number, paramS: string, callback: voidOrderInOutInCallback): void{} - voidOrderOutInOut(paramS: string, callback: voidOrderOutInOutCallback): void{} - voidOrderInInOutOut(paramS: string, paramI: number, callback: voidOrderInInOutOutCallback): void{} - - static readonly COMMAND_ONEWAY_VOID_VOID = 1; - static readonly COMMAND_VOID_VOID = 2; - static readonly COMMAND_BOOLEAN_VOID = 3; - static readonly COMMAND_BYTE_VOID = 4; - static readonly COMMAND_SHORT_VOID = 5; - static readonly COMMAND_INT_VOID = 6; - static readonly COMMAND_LONG_VOID = 7; - static readonly COMMAND_FLOAT_VOID = 8; - static readonly COMMAND_DOUBLE_VOID = 9; - static readonly COMMAND_STRING_VOID = 10; - static readonly COMMAND_SEQUENCEABLE_VOID = 11; - static readonly COMMAND_INTERFACE_VOID = 12; - static readonly COMMAND_MAP_STRING_STRING_VOID = 13; - static readonly COMMAND_DOUBLE_ARRAY_VOID = 14; - static readonly COMMAND_VOID_IN_MAP_STRING_INT = 15; - static readonly COMMAND_VOID_IN_STRING_ARRAY = 16; - static readonly COMMAND_VOID_OUT_MAP_STRING_INT = 17; - static readonly COMMAND_VOID_OUT_STRING_ARRAY = 18; - static readonly COMMAND_VOID_IN_OUT_MAP_STRING_INT = 19; - static readonly COMMAND_VOID_IN_OUT_STRING_ARRAY = 20; - static readonly COMMAND_VOID_IN_INT = 21; - static readonly COMMAND_VOID_IN_STRING = 22; - static readonly COMMAND_VOID_OUT_INT = 23; - static readonly COMMAND_VOID_OUT_STRING = 24; - static readonly COMMAND_VOID_IN_OUT_INT = 25; - static readonly COMMAND_VOID_IN_OUT_STRING = 26; - static readonly COMMAND_VOID_PARAMETER_TYPE_BOOLEAN = 27; - static readonly COMMAND_VOID_PARAMETER_TYPE_BYTE = 28; - static readonly COMMAND_VOID_PARAMETER_TYPE_SHORT = 29; - static readonly COMMAND_VOID_PARAMETER_TYPE_INT = 30; - static readonly COMMAND_VOID_PARAMETER_TYPE_LONG = 31; - static readonly COMMAND_VOID_PARAMETER_TYPE_FLOAT = 32; - static readonly COMMAND_VOID_PARAMETER_TYPE_DOUBLE = 33; - static readonly COMMAND_VOID_PARAMETER_TYPE_STRING = 34; - static readonly COMMAND_VOID_PARAMETER_TYPE_SEQUENCEABLE = 35; - static readonly COMMAND_VOID_PARAMETER_TYPE_INTERFACE = 36; - static readonly COMMAND_VOID_PARAMETER_TYPE_MAP_STRING_STRING = 37; - static readonly COMMAND_VOID_PARAMETER_TYPE_DOUBLE_ARRAY = 38; - static readonly COMMAND_VOID_ORDER_OUT_IN = 39; - static readonly COMMAND_VOID_ORDER_IN_OUT_IN = 40; - static readonly COMMAND_VOID_ORDER_OUT_IN_OUT = 41; - static readonly COMMAND_VOID_ORDER_IN_IN_OUT_OUT = 42; -} - diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts deleted file mode 100644 index 4b236a48835edbe2729e8ce7ea7b5f06b769d236..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts +++ /dev/null @@ -1,65 +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 Want from '@ohos.application.Want'; -import ZidlTestServiceStubOneway from './zidlToolOneWay/interface_attribute_declaratoin_oneway_stub'; -import {voidVoidFirstCallback} from './zidlToolOneWay/i_interface_attribute_declaratoin_oneway' -import {voidVoidSecondCallback} from './zidlToolOneWay/i_interface_attribute_declaratoin_oneway' -import {voidVoidThirdCallback} from './zidlToolOneWay/i_interface_attribute_declaratoin_oneway' - -const SUCCESS = 0; -const FAIL = 1; - -class ZidlTestImpOneway extends ZidlTestServiceStubOneway { - voidVoidFirst(callback: voidVoidFirstCallback) { - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_0100_1 called"); - callback(SUCCESS); - } - - voidVoidSecond(callback: voidVoidSecondCallback) { - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_0100_2 called"); - callback(SUCCESS); - } - - voidVoidThird(callback: voidVoidThirdCallback) { - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_0100_3 called"); - callback(SUCCESS); - } -} - -export default class ServiceAbility2 extends ServiceExtension { - onCreate(want: Want) { - globalThis.abilityWant = want; - console.log('ZidlClientTest ServiceAbility2 onCreate, want: ' + want.abilityName); - } - - onRequest(want, startId) { - console.log('ZidlClientTest ServiceAbility2 onRequest, want: ' + want.abilityName - + ', startId: ' + startId); - } - - onConnect(want) { - console.log('ZidlClientTest ServiceAbility2 onConnect, want:' + want.abilityName); - return new ZidlTestImpOneway('connect'); - } - - onDisconnect(want) { - console.log('ZidlClientTest ServiceAbility2 onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('ZidlClientTest ServiceAbility2 onDestroy'); - } -}; diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/service.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/service.ts deleted file mode 100644 index b49731a414958a281c2f0c4eab0e7fb408eb2c2f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/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/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts deleted file mode 100644 index a17db0f5d20ac1d674258b1e094355c2276fc2b4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts +++ /dev/null @@ -1,25 +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. - */ - - -export default interface IInterfaceAttributeDeclaratoinOneway { - voidVoidFirst(callback: voidVoidFirstCallback): void; - voidVoidSecond(callback: voidVoidSecondCallback): void; - voidVoidThird(callback: voidVoidThirdCallback): void; -} -export type voidVoidFirstCallback = (errCode: number) => void; -export type voidVoidSecondCallback = (errCode: number) => void; -export type voidVoidThirdCallback = (errCode: number) => void; - diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts deleted file mode 100644 index 016f352bd6d609916ad6e3b12e63e075a6fbe490..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts +++ /dev/null @@ -1,64 +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 {voidVoidFirstCallback} from "./i_interface_attribute_declaratoin_oneway"; -import {voidVoidSecondCallback} from "./i_interface_attribute_declaratoin_oneway"; -import {voidVoidThirdCallback} from "./i_interface_attribute_declaratoin_oneway"; -import IInterfaceAttributeDeclaratoinOneway from "./i_interface_attribute_declaratoin_oneway"; -import rpc from "@ohos.rpc"; - -export default class InterfaceAttributeDeclaratoinOnewayStub extends rpc.RemoteObject implements IInterfaceAttributeDeclaratoinOneway { - constructor(des: string) { - super(des); - } - - onRemoteRequest(code: number, data, reply, option): boolean { - console.log("onRemoteRequest called, code = " + code); - switch(code) { - case InterfaceAttributeDeclaratoinOnewayStub.COMMAND_VOID_VOID_FIRST: { - this.voidVoidFirst((errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case InterfaceAttributeDeclaratoinOnewayStub.COMMAND_VOID_VOID_SECOND: { - this.voidVoidSecond((errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case InterfaceAttributeDeclaratoinOnewayStub.COMMAND_VOID_VOID_THIRD: { - this.voidVoidThird((errCode) => { - reply.writeInt(errCode); - }); - return true; - } - default: { - console.log("invalid request code" + code); - break; - } - } - return false; - } - - voidVoidFirst(callback: voidVoidFirstCallback): void{} - voidVoidSecond(callback: voidVoidSecondCallback): void{} - voidVoidThird(callback: voidVoidThirdCallback): void{} - - static readonly COMMAND_VOID_VOID_FIRST = 1; - static readonly COMMAND_VOID_VOID_SECOND = 2; - static readonly COMMAND_VOID_VOID_THIRD = 3; -} - diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/i_interface_declare.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/i_interface_declare.ts deleted file mode 100644 index a9469ce4d7e1d4fbd3ec452076ab8121b8b8adf7..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/i_interface_declare.ts +++ /dev/null @@ -1,21 +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. - */ - - -export default interface IInterfaceDeclare { - testInterface(data: number, callback: testInterfaceCallback): void; -} -export type testInterfaceCallback = (errCode: number) => void; - diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_proxy.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_proxy.ts deleted file mode 100644 index 9f9cc9c43d3b15599f88aa223e7308c43b997e60..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_proxy.ts +++ /dev/null @@ -1,44 +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 {testInterfaceCallback} from "./i_interface_declare"; -import IInterfaceDeclare from "./i_interface_declare"; -import rpc from "@ohos.rpc"; - -export default class InterfaceDeclareProxy implements IInterfaceDeclare { - constructor(proxy) { - this.proxy = proxy; - } - - testInterface(data: number, callback: testInterfaceCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeInt(data); - this.proxy.sendRequest(InterfaceDeclareProxy.COMMAND_TEST_INTERFACE, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - static readonly COMMAND_TEST_INTERFACE = 1; - private proxy -} - diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_stub.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_stub.ts deleted file mode 100644 index 1606f77b4c0390be639f06cb093ee672cf05d478..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/interfaceDeclare/interface_declare_stub.ts +++ /dev/null @@ -1,47 +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 {testInterfaceCallback} from "./i_interface_declare"; -import IInterfaceDeclare from "./i_interface_declare"; -import rpc from "@ohos.rpc"; - -export default class InterfaceDeclareStub extends rpc.RemoteObject implements IInterfaceDeclare { - constructor(des: string) { - super(des); - } - - onRemoteRequest(code: number, data, reply, option): boolean { - console.log("onRemoteRequest called, code = " + code); - switch(code) { - case InterfaceDeclareStub.COMMAND_TEST_INTERFACE: { - let _data = data.readInt(); - this.testInterface(_data, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - default: { - console.log("invalid request code" + code); - break; - } - } - return false; - } - - testInterface(data: number, callback: testInterfaceCallback): void{} - - static readonly COMMAND_TEST_INTERFACE = 1; -} - diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/index.ets b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/index.ets deleted file mode 100644 index 4b3495d6f447ce798ad40e21676e40434f78ee68..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/index.ets +++ /dev/null @@ -1,64 +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)) - globalThis.abilityWant.parameters['timeout'] = 10000; - configService.setConfig(globalThis.abilityWant.parameters) - testsuite(globalThis.abilityContext) - core.execute() - } - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('Test App') - .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/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/index/index.ets deleted file mode 100644 index 37b86f5096f1273b71299ee08e085211c5add410..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/index/index.ets +++ /dev/null @@ -1,66 +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)) - globalThis.abilityWant.parameters.timeout = 70000; - configService.setConfig(globalThis.abilityWant.parameters) - testsuite(globalThis.abilityContext) - core.execute() - } - - 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/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/second.ets b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/second.ets deleted file mode 100644 index 33d9ae45245db03fd252ef7c1a85c9e284028e0d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/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/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/pages/second/second.ets deleted file mode 100644 index f9009a3e8567d1f4557ebc11dded54c7e27c0b0d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/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/zidltest/actsamszidlclienttest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/test/Ability.test.ets deleted file mode 100644 index 87c351546af0a169a5b780bb85c951d1989af38e..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/test/Ability.test.ets +++ /dev/null @@ -1,1586 +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 MySequenceable from '../zidlTool/my_sequenceable' -import ZidlTestServiceProxy from '../zidlTool/zidl_tool_test_proxy' -import ZidlTestServiceProxyOneway from '../zidlToolOneWay/interface_attribute_declaratoin_oneway_proxy' -import InterfaceDeclareStub from '../interfaceDeclare/interface_declare_stub' -import InterfaceDeclareProxy from '../interfaceDeclare/interface_declare_proxy' -import { testInterfaceCallback } from '../interfaceDeclare/i_interface_declare' - -var connectionId = -1; -var connectionOnewayId = -1; -var connectionIdSingle = -1; -var connectionOnewayIdSingle = -1; -var testProxyMulti; -var testProxyMultiOneway; -var testProxySingle; -var testProxySingleOneway; -const SUCCESS = 0; -const FAIL = 1; - -export default function abilityTest(abilityContext) { - describe('ActsAbilityTest', function () { - - beforeAll(async (done) => { - var count = 0; - - function checkDone() { - if (count >= 4) { - done(); - } - } - - var paMultiConnect = { - onConnect: function (elementName, proxy) { - console.log("ZidlTest Client Faconnection onConnect called."); - console.log("ZidlTest Client Faconnection onConnect elementName = " + elementName); - console.log("ZidlTest Client Faconnection onConnect proxy = " + proxy); - testProxyMulti = new ZidlTestServiceProxy(proxy); - count++; - checkDone(); - }, - onDisconnect: function (elementName) { - console.log("ZidlTest Client onDisconnectService onDisconnect"); - }, - onFailed: function (code) { - console.log("ZidlTest Client onDisconnectService onFailed"); - count++; - checkDone(); - } - }; - - var paMultiOnewayConnect = { - onConnect: function (elementName, proxy) { - console.log("ZidlTest Client Faconnection onConnect called."); - console.log("ZidlTest Client Faconnection onConnect elementName = " + elementName); - console.log("ZidlTest Client Faconnection onConnect proxy = " + proxy); - testProxyMultiOneway = new ZidlTestServiceProxyOneway(proxy); - count++; - checkDone(); - }, - onDisconnect: function (elementName) { - console.log("ZidlTest Client onDisconnectService onDisconnect"); - }, - onFailed: function (code) { - console.log("ZidlTest Client onDisconnectService onFailed"); - count++; - checkDone(); - } - }; - - var paSingleConnect = { - onConnect: function (elementName, proxy) { - console.log("ZidlTest Client Faconnection onConnect called."); - console.log("ZidlTest Client Faconnection onConnect elementName = " + elementName); - console.log("ZidlTest Client Faconnection onConnect proxy = " + proxy); - testProxySingle = new ZidlTestServiceProxy(proxy); - count++; - checkDone(); - }, - onDisconnect: function (elementName) { - console.log("ZidlTest Client onDisconnectService onDisconnect"); - }, - onFailed: function (code) { - console.log("ZidlTest Client onDisconnectService onFailed"); - count++; - checkDone(); - } - }; - - var paSingleOnewayConnect = { - onConnect: function (elementName, proxy) { - console.log("ZidlTest Client Faconnection onConnect called."); - console.log("ZidlTest Client Faconnection onConnect elementName = " + elementName); - console.log("ZidlTest Client Faconnection onConnect proxy = " + proxy); - testProxySingleOneway = new ZidlTestServiceProxyOneway(proxy); - count++; - checkDone(); - }, - onDisconnect: function (elementName) { - console.log("ZidlTest Client onDisconnectService onDisconnect"); - }, - onFailed: function (code) { - console.log("ZidlTest Client onDisconnectService onFailed"); - count++; - checkDone(); - } - }; - - let wantMulti = { - "bundleName": "com.example.zidlservice", - "abilityName": "com.example.zidlservice.ServiceAbility" - }; - let wantMultiOneway = { - "bundleName": "com.example.zidlservice", - "abilityName": "com.example.zidlservice.ServiceAbility2" - }; - let wantSingle = { - "bundleName": "com.example.zidlclienttest", - "abilityName": "com.example.zidlclienttest.ServiceAbility" - }; - let wantSingleOneway = { - "bundleName": "com.example.zidlclienttest", - "abilityName": "com.example.zidlclienttest.ServiceAbility2" - }; - - console.info('ZidlTest Client connectAbility start'); - connectionId = globalThis.abilityContext.connectServiceExtensionAbility(wantMulti, paMultiConnect); - console.info('ZidlTest Client connectAbility end connectionId = ' + connectionId); - connectionOnewayId = globalThis.abilityContext.connectServiceExtensionAbility(wantMultiOneway, paMultiOnewayConnect); - console.info('ZidlTest Client connectAbility end connectionOnewayId = ' + connectionOnewayId); - - connectionIdSingle = globalThis.abilityContext.connectServiceExtensionAbility(wantSingle, paSingleConnect); - console.info('ZidlTest Client connectAbility end connectionIdSingle = ' + connectionIdSingle); - connectionOnewayIdSingle = globalThis.abilityContext.connectServiceExtensionAbility(wantSingleOneway, paSingleOnewayConnect); - console.info('ZidlTest Client connectAbility end connectionOnewayIdSingle = ' + connectionOnewayIdSingle); - }) - - afterEach(async (done) => { - setTimeout(() => { - done(); - }, 200) - }) - - afterAll(async (done) => { - var count = 0; - - function checkDone() { - if (count >= 4) { - done(); - } - } - - globalThis.abilityContext.disconnectServiceExtensionAbility(connectionId, (err) => { - console.info('ZidlTest Client disconnectAbility result ' + JSON.stringify(err)); - connectionId = -1; - testProxyMulti = null; - count++; - checkDone(); - }) - - globalThis.abilityContext.disconnectServiceExtensionAbility(connectionOnewayId, (err) => { - console.info('ZidlTest Client disconnectAbility2 result ' + JSON.stringify(err)); - connectionOnewayId = -1; - testProxyMultiOneway = null; - count++; - checkDone(); - }) - - globalThis.abilityContext.disconnectServiceExtensionAbility(connectionIdSingle, (err) => { - console.info('ZidlTest Client disconnectAbility result ' + JSON.stringify(err)); - connectionIdSingle = -1; - testProxyMulti = null; - count++; - checkDone(); - }) - - globalThis.abilityContext.disconnectServiceExtensionAbility(connectionOnewayIdSingle, (err) => { - console.info('ZidlTest Client disconnectAbility2 result ' + JSON.stringify(err)); - connectionOnewayIdSingle = -1; - testProxyMultiOneway = null; - count++; - checkDone(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_0100 - * @tc.name: support method attributes declaration [oneway] - * @tc.desc: [oneway] interface zidl.systemtest.IInterfaceAttributeDeclaratoinOneway {} - */ - it('ACTS_Zidl_Js2JsMulti_0100', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsMulti_0100 begin'); - var flagFir = false; - var flagSec = false; - var flagThi = false; - - function checkFinish() { - if (flagFir && flagSec && flagThi) { - done(); - } - } - - setTimeout(function () { - testProxyMultiOneway.voidVoidFirst((errCode) => { - expect(errCode).assertEqual(SUCCESS); - flagFir = true; - checkFinish(); - }); - testProxyMultiOneway.voidVoidSecond((errCode) => { - expect(errCode).assertEqual(SUCCESS); - flagSec = true; - checkFinish(); - }); - testProxyMultiOneway.voidVoidThird((errCode) => { - expect(errCode).assertEqual(SUCCESS); - flagThi = true; - checkFinish(); - }); - }, 500); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_0200 - * @tc.name: support method attributes declaration [oneway] - * @tc.desc: [oneway] void onewayVoidVoid() - */ - it('ACTS_Zidl_Js2JsMulti_0200', 0, async function (done) { - testProxyMulti.onewayVoidVoid((errCode) => { - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_0300 - * @tc.name: support method result type void - * @tc.desc: void voidVoid(); - */ - it('ACTS_Zidl_Js2JsMulti_0300', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsMulti_0300 begin'); - testProxyMulti.voidVoid((errCode) => { - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_0400 - * @tc.name: support method result type boolean - * @tc.desc: boolean booleanVoid(); - */ - it('ACTS_Zidl_Js2JsMulti_0400', 0, async function (done) { - testProxyMulti.booleanVoid((errCode, boolean) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_0400 call return:" + boolean); - expect(errCode).assertEqual(SUCCESS); - expect(boolean).assertEqual(true); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_0500 - * @tc.name: support method result type byte - * @tc.desc: number byteVoid(); - */ - it('ACTS_Zidl_Js2JsMulti_0500', 0, async function (done) { - testProxyMulti.byteVoid((errCode, mybyte) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_0500 call return:" + mybyte); - expect(errCode).assertEqual(SUCCESS); - expect(mybyte).assertEqual(1); - done(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_0600 - * @tc.name: support method result type short - * @tc.desc: number shortVoid(); - */ - it('ACTS_Zidl_Js2JsMulti_0600', 0, async function (done) { - testProxyMulti.shortVoid((errCode, myshort) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_0600 call return:" + myshort); - expect(errCode).assertEqual(SUCCESS); - expect(myshort).assertEqual(222); - done(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_0700 - * @tc.name: support method result type int - * @tc.desc: number intVoid(); - */ - it('ACTS_Zidl_Js2JsMulti_0700', 0, async function (done) { - testProxyMulti.intVoid((errCode, myint) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_0700 call return:" + myint); - expect(errCode).assertEqual(SUCCESS); - expect(myint).assertEqual(333); - done(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_0800 - * @tc.name: support method result type long - * @tc.desc: number longVoid(); - */ - it('ACTS_Zidl_Js2JsMulti_0800', 0, async function (done) { - testProxyMulti.longVoid((errCode, mylong) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_0800 call return:" + mylong); - expect(errCode).assertEqual(SUCCESS); - expect(mylong).assertEqual(4444); - done(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_0900 - * @tc.name: support method result type float - * @tc.desc: number floatVoid(); - */ - it('ACTS_Zidl_Js2JsMulti_0900', 0, async function (done) { - testProxyMulti.floatVoid((errCode, myfloat) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_0900 call return:" + myfloat); - expect(errCode).assertEqual(SUCCESS); - expect(myfloat).assertEqual(10.1); - done(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_1000 - * @tc.name: support method result type double - * @tc.desc: number doubleVoid(); - */ - it('ACTS_Zidl_Js2JsMulti_1000', 0, async function (done) { - testProxyMulti.doubleVoid((errCode, mydouble) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_1000 call return:" + mydouble); - expect(errCode).assertEqual(SUCCESS); - expect(mydouble).assertEqual(22.1); - done(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_1100 - * @tc.name: support method result type String - * @tc.desc: String stringVoid(); - */ - it('ACTS_Zidl_Js2JsMulti_1100', 0, async function (done) { - testProxyMulti.stringVoid((errCode, mystring) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_1100 call return:" + mystring); - expect(errCode).assertEqual(SUCCESS); - expect(mystring).assertEqual("stringVoid"); - done(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_1200 - * @tc.name: support method result type sequenceable - * @tc.desc: TestInfo sequenceableVoid(); - */ - it('ACTS_Zidl_Js2JsMulti_1200', 0, async function (done) { - testProxyMulti.sequenceableVoid((errCode, mysequenceable) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_1200 call return:" + JSON.stringify(mysequenceable)); - expect(errCode).assertEqual(SUCCESS); - expect(mysequenceable.getNum()).assertEqual(14); - expect(mysequenceable.getString()).assertEqual("hello"); - done(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_1300 - * @tc.name: support method result type interface - * @tc.desc: ITest interfaceVoid(); - */ - it('ACTS_Zidl_Js2JsMulti_1300', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsMulti_1300 begin'); - - testProxyMulti.interfaceVoid((errCode, data) => { - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_1300 called"); - expect(errCode).assertEqual(SUCCESS); - let proxy = new InterfaceDeclareProxy(data); - proxy.testInterface(1500, (errCode) => { - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }); - }) - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_1400 - * @tc.name: support method result type Map container type - * @tc.desc: Map mapStringStringVoid(); - */ - it('ACTS_Zidl_Js2JsMulti_1400', 0, async function (done) { - testProxyMulti.mapStringStringVoid((errCode, mymapStringString) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_1400 call return:" + mymapStringString.get("string1")); - expect(errCode).assertEqual(SUCCESS); - expect(mymapStringString.get("string1")).assertEqual("string2"); - done(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_1500 - * @tc.name: support method result type array type - * @tc.desc: double[] doubleArrayVoid(); - */ - it('ACTS_Zidl_Js2JsMulti_1500', 0, async function (done) { - testProxyMulti.doubleArrayVoid((errCode, mydoubleArray) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_1500 call return:" + mydoubleArray); - expect(errCode).assertEqual(SUCCESS); - expect(mydoubleArray.length).assertEqual(3); - expect(mydoubleArray[0]).assertEqual(1.1); - expect(mydoubleArray[1]).assertEqual(2.1); - expect(mydoubleArray[2]).assertEqual(3.1); - done(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_1600 - * @tc.name: support object type formal parameter attribute in - * @tc.desc: sequenceable zidl.systemtest.TestInfo; void voidInObject([in] TestInfo param); - */ - it('ACTS_Zidl_Js2JsMulti_1600', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsMulti_1600 begin'); - var flagFir = false; - var flagSec = false; - - function checkFinish() { - if (flagFir && flagSec) { - done(); - } - } - - let myMap = new Map(); - myMap.set("string1", 1); - var strarray = ["aaa", "bbb", "ccc"]; - testProxyMulti.voidInMapStringInt(myMap, (errCode) => { - expect(errCode).assertEqual(SUCCESS); - flagFir = true; - checkFinish(); - }); - testProxyMulti.voidInStringArray(strarray, (errCode) => { - expect(errCode).assertEqual(SUCCESS); - flagSec = true; - checkFinish(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_1700 - * @tc.name: support object type formal parameter attribute out - * @tc.desc: sequenceable zidl.systemtest.TestInfo;void voidOutObject([out] String param); - */ - it('ACTS_Zidl_Js2JsMulti_1700', 0, async function (done) { - var flagFir = false; - var flagSec = false; - - function checkFinish() { - if (flagFir && flagSec) { - done(); - } - } - - testProxyMulti.voidOutMapStringInt((errCode, map) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_1700 call return:" + map.get("voidOutMapStringInt")); - expect(errCode).assertEqual(SUCCESS); - expect(map.get("voidOutMapStringInt")).assertEqual(1); - flagFir = true; - checkFinish(); - }); - testProxyMulti.voidOutStringArray((errCode, strArray) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_1700 call return:" + JSON.stringify(strArray)); - expect(errCode).assertEqual(SUCCESS); - expect(strArray[0]).assertEqual("aa"); - expect(strArray[1]).assertEqual("dd"); - flagSec = true; - checkFinish(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_1800 - * @tc.name: support object type formal parameter attribute in, out - * @tc.desc: sequenceable zidl.systemtest.TestInfo;void voidInOutObject([in, out] TestInfo param); - */ - it('ACTS_Zidl_Js2JsMulti_1800', 0, async function (done) { - var flagFir = false; - var flagSec = false; - - function checkFinish() { - if (flagFir && flagSec) { - done(); - } - } - - var mapIn = new Map(); - mapIn.set("voidInOutMapStringInt1", 1801); - mapIn.set("voidInOutMapStringInt2", 1802); - testProxyMulti.voidInOutMapStringInt(mapIn, (errCode, map) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_1800 call return:" + map.get("voidInOutMapStringInt")); - expect(errCode).assertEqual(SUCCESS); - expect(map.get("voidInOutMapStringInt1")).assertEqual(1802); - expect(map.get("voidInOutMapStringInt2")).assertEqual(1801); - flagFir = true; - checkFinish(); - }); - - var strArrayIn = ["ddd", "ccc"]; - testProxyMulti.voidInOutStringArray(strArrayIn, (errCode, strArray) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_1800 call return:" + JSON.stringify(strArray)); - expect(errCode).assertEqual(SUCCESS); - expect(strArray[0]).assertEqual("aaa"); - expect(strArray[1]).assertEqual("bbb"); - flagSec = true; - checkFinish(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_1900 - * @tc.name: support basic type formal parameter attribute in - * @tc.desc: void voidInInt([in] number param);void voidInString([in] String param); - */ - it('ACTS_Zidl_Js2JsMulti_1900', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsMulti_1900 begin'); - var number8 = 8888; - var str3 = "voidInString"; - var flagFir = false; - var flagSec = false; - - function checkFinish() { - if (flagFir && flagSec) { - done(); - } - } - - testProxyMulti.voidInInt(number8, (errCode) => { - expect(errCode).assertEqual(SUCCESS); - flagFir = true; - checkFinish(); - }); - testProxyMulti.voidInString(str3, (errCode) => { - expect(errCode).assertEqual(SUCCESS); - flagSec = true; - checkFinish(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_2000 - * @tc.name: support basic type formal parameter attribute out - * @tc.desc: void voidOutInt([out] number param);void voidOutString([out] String param); - */ - it('ACTS_Zidl_Js2JsMulti_2000', 0, async function (done) { - var flagFir = false; - var flagSec = false; - - function checkFinish() { - if (flagFir && flagSec) { - done(); - } - } - - testProxyMulti.voidOutInt((errCode, number) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_2000 call return:" + JSON.stringify(number)); - expect(errCode).assertEqual(SUCCESS); - expect(number).assertEqual(123); - flagFir = true; - checkFinish(); - }); - testProxyMulti.voidOutString((errCode, str) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_2000 call return:" + JSON.stringify(str)); - expect(str).assertEqual("voidOutString"); - expect(errCode).assertEqual(SUCCESS); - flagSec = true; - checkFinish(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_2100 - * @tc.name: support basic type formal parameter attribute in, out - * @tc.desc: void voidInOutInt([in, out] number param);void voidInOutString([in, out] String param); - */ - it('ACTS_Zidl_Js2JsMulti_2100', 0, async function (done) { - var flagFir = false; - var flagSec = false; - - function checkFinish() { - if (flagFir && flagSec) { - done(); - } - } - - console.log('ACTS_Zidl_Js2JsMulti_2100 begin'); - var number23 = 123456; - var str1 = "voidInOutString"; - testProxyMulti.voidInOutInt(number23, (errCode, number) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_2100 call return:" + JSON.stringify(number)); - expect(errCode).assertEqual(SUCCESS); - expect(number).assertEqual(456789); - flagFir = true; - checkFinish(); - }); - testProxyMulti.voidInOutString(str1, (errCode, str) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_2100 call return:" + JSON.stringify(str)); - expect(errCode).assertEqual(SUCCESS); - expect(str).assertEqual("456789"); - flagSec = true; - checkFinish(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_2200 - * @tc.name: support formal parameter type boolean - * @tc.desc: void voidBoolean([in] boolean param); - */ - it('ACTS_Zidl_Js2JsMulti_2200', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsMulti_2200 begin'); - var oBooleanTrue = true; - - testProxyMulti.voidParameterTypeBoolean(oBooleanTrue, (errCode) => { - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_2300 - * @tc.name: support formal parameter type byte - * @tc.desc: void voidByte([in] byte param); - */ - it('ACTS_Zidl_Js2JsMulti_2300', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsMulti_2300 begin'); - var number1 = 1111; - - testProxyMulti.voidParameterTypeByte(number1, (errCode) => { - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_2400 - * @tc.name: support formal parameter type short - * @tc.desc: void voidShort([in] short param); - */ - it('ACTS_Zidl_Js2JsMulti_2400', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsMulti_2400 begin'); - var number2 = 2222; - - testProxyMulti.voidParameterTypeShort(number2, (errCode) => { - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_2500 - * @tc.name: support formal parameter type int - * @tc.desc: void voidInt([in] int param); - */ - it('ACTS_Zidl_Js2JsMulti_2500', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsMulti_2500 begin'); - var number3 = 3333; - - testProxyMulti.voidParameterTypeInt(number3, (errCode) => { - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_2600 - * @tc.name: support formal parameter type long - * @tc.desc: void voidLong([in] long param); - */ - it('ACTS_Zidl_Js2JsMulti_2600', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsMulti_2600 begin'); - var number4 = 4444; - - testProxyMulti.voidParameterTypeLong(number4, (errCode) => { - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_2700 - * @tc.name: support formal parameter type float - * @tc.desc: void voidFloat([in] float param); - */ - it('ACTS_Zidl_Js2JsMulti_2700', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsMulti_2700 begin'); - var number5 = 5555.1; - - testProxyMulti.voidParameterTypeFloat(number5, (errCode) => { - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_2800 - * @tc.name: support formal parameter type double - * @tc.desc: void voidDouble([in] double param); - */ - it('ACTS_Zidl_Js2JsMulti_2800', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsMulti_2800 begin'); - var number6 = 6666.1; - - setTimeout(function () { - testProxyMulti.voidParameterTypeDouble(number6, (errCode) => { - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }, 500); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_2900 - * @tc.name: support formal parameter type String - * @tc.desc: void voidString([in] String param); - */ - it('ACTS_Zidl_Js2JsMulti_2900', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsMulti_2900 begin'); - var str2 = "voidParameterTypeString"; - - testProxyMulti.voidParameterTypeString(str2, (errCode) => { - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_3000 - * @tc.name: support formal parameter type sequenceable - * @tc.desc: void voidSequenceable([in] TestInfo param); - */ - it('ACTS_Zidl_Js2JsMulti_3000', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsMulti_3000 begin'); - let mySequence = new MySequenceable(); - - testProxyMulti.voidParameterTypeSequenceable(mySequence, (errCode) => { - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_3100 - * @tc.name: support formal parameter type interface - * @tc.desc: void voidInterface([in] ITest param); - */ - it('ACTS_Zidl_Js2JsMulti_3100', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsMulti_3100 begin'); - - class InterfaceDeclare extends InterfaceDeclareStub { - testInterface(data: number, callback: testInterfaceCallback): void { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_3100 called"); - let result = FAIL; - - if (data == 3300) { - result = SUCCESS; - } - callback(result); - } - } - - let clientInterface = new InterfaceDeclare('clientInterface'); - - testProxyMulti.voidParameterTypeInterface(clientInterface, (errCode) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_3100 clientInterface callback"); - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_3200 - * @tc.name: support formal parameter type Map - * @tc.desc: void voidMapStringString([in] Map param); - */ - it('ACTS_Zidl_Js2JsMulti_3200', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsMulti_3200 begin'); - var map = new Map(); - map.set("voidParameterTypeMapStringString", "fdhatdh"); - - testProxyMulti.voidParameterTypeMapStringString(map, (errCode) => { - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_3300 - * @tc.name: support formal parameter type array - * @tc.desc: void voidDoubleArray([in] double[] param); - */ - it('ACTS_Zidl_Js2JsMulti_3300', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsMulti_3300 begin'); - var array = [1.1, 2.1]; - - testProxyMulti.voidParameterTypeDoubleArray(array, (errCode) => { - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_3400 - * @tc.name: parameter order - * @tc.desc: order of parameter properties [out], [in] - */ - it('ACTS_Zidl_Js2JsMulti_3400', 0, async function (done) { - var num = 61; - testProxyMulti.voidOrderOutIn(num, (errCode, string) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_3400 call return:" + string); - expect(errCode).assertEqual(SUCCESS); - expect(string).assertEqual("hello world"); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_3500 - * @tc.name: parameter order - * @tc.desc: order of parameter properties [in, out], [in] - */ - it('ACTS_Zidl_Js2JsMulti_3500', 0, async function (done) { - var num = 62; - var str = "inputparam"; - testProxyMulti.voidOrderInOutIn(num, str, (errCode, numparam) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_3500 call return:" + numparam); - expect(errCode).assertEqual(SUCCESS); - expect(numparam).assertEqual(6); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_3600 - * @tc.name: parameter order - * @tc.desc: order of parameter properties [out], [in, out] - */ - it('ACTS_Zidl_Js2JsMulti_3600', 0, async function (done) { - var str = "param"; - testProxyMulti.voidOrderOutInOut(str, (errCode, paramI, paramS) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_3600 call return:" + paramI + " " + paramS); - expect(errCode).assertEqual(SUCCESS); - expect(paramI).assertEqual(3); - expect(paramS).assertEqual("paramcallback"); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsMulti_3700 - * @tc.name: parameter order - * @tc.desc: order of parameter properties [in], [in, out], [out] - */ - it('ACTS_Zidl_Js2JsMulti_3700', 0, async function (done) { - var str = "paramInput"; - var num = 64; - testProxyMulti.voidOrderInInOutOut(str, num, (errCode, paramI, paramS) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsMulti_3700 call return:" + paramS + " " + paramI); - expect(errCode).assertEqual(SUCCESS); - expect(paramS).assertEqual("callback"); - expect(paramI).assertEqual(4); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_0100 - * @tc.name: support method attributes declaration [oneway] - * @tc.desc: [oneway] interface zidl.systemtest.IInterfaceAttributeDeclaratoinOneway {} - */ - it('ACTS_Zidl_Js2JsSingle_0100', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsSingle_0100 begin'); - var flagFir = false; - var flagSec = false; - var flagThi = false; - - function checkFinish() { - if (flagFir && flagSec && flagThi) { - done(); - } - } - - setTimeout(function () { - testProxySingleOneway.voidVoidFirst((errCode) => { - expect(errCode).assertEqual(SUCCESS); - flagFir = true; - checkFinish(); - }); - testProxySingleOneway.voidVoidSecond((errCode) => { - expect(errCode).assertEqual(SUCCESS); - flagSec = true; - checkFinish(); - }); - testProxySingleOneway.voidVoidThird((errCode) => { - expect(errCode).assertEqual(SUCCESS); - flagThi = true; - checkFinish(); - }); - }, 500); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_0200 - * @tc.name: support method attributes declaration [oneway] - * @tc.desc: [oneway] void onewayVoidVoid() - */ - it('ACTS_Zidl_Js2JsSingle_0200', 0, async function (done) { - testProxySingle.onewayVoidVoid((errCode) => { - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_0300 - * @tc.name: support method result type void - * @tc.desc: void voidVoid(); - */ - it('ACTS_Zidl_Js2JsSingle_0300', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsSingle_0300 begin'); - testProxySingle.voidVoid((errCode) => { - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_0400 - * @tc.name: support method result type boolean - * @tc.desc: boolean booleanVoid(); - */ - it('ACTS_Zidl_Js2JsSingle_0400', 0, async function (done) { - testProxySingle.booleanVoid((errCode, boolean) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_0400 call return:" + boolean); - expect(errCode).assertEqual(SUCCESS); - expect(boolean).assertEqual(true); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_0500 - * @tc.name: support method result type byte - * @tc.desc: number byteVoid(); - */ - it('ACTS_Zidl_Js2JsSingle_0500', 0, async function (done) { - testProxySingle.byteVoid((errCode, mybyte) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_0500 call return:" + mybyte); - expect(errCode).assertEqual(SUCCESS); - expect(mybyte).assertEqual(1); - done(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_0600 - * @tc.name: support method result type short - * @tc.desc: number shortVoid(); - */ - it('ACTS_Zidl_Js2JsSingle_0600', 0, async function (done) { - testProxySingle.shortVoid((errCode, myshort) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_0600 call return:" + myshort); - expect(errCode).assertEqual(SUCCESS); - expect(myshort).assertEqual(222); - done(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_0700 - * @tc.name: support method result type int - * @tc.desc: number intVoid(); - */ - it('ACTS_Zidl_Js2JsSingle_0700', 0, async function (done) { - testProxySingle.intVoid((errCode, myint) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_0700 call return:" + myint); - expect(errCode).assertEqual(SUCCESS); - expect(myint).assertEqual(333); - done(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_0800 - * @tc.name: support method result type long - * @tc.desc: number longVoid(); - */ - it('ACTS_Zidl_Js2JsSingle_0800', 0, async function (done) { - testProxySingle.longVoid((errCode, mylong) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_0800 call return:" + mylong); - expect(errCode).assertEqual(SUCCESS); - expect(mylong).assertEqual(4444); - done(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_0900 - * @tc.name: support method result type float - * @tc.desc: number floatVoid(); - */ - it('ACTS_Zidl_Js2JsSingle_0900', 0, async function (done) { - testProxySingle.floatVoid((errCode, myfloat) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_0900 call return:" + myfloat); - expect(errCode).assertEqual(SUCCESS); - expect(myfloat).assertEqual(10.1); - done(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_1000 - * @tc.name: support method result type double - * @tc.desc: number doubleVoid(); - */ - it('ACTS_Zidl_Js2JsSingle_1000', 0, async function (done) { - testProxySingle.doubleVoid((errCode, mydouble) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_1000 call return:" + mydouble); - expect(errCode).assertEqual(SUCCESS); - expect(mydouble).assertEqual(22.1); - done(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_1100 - * @tc.name: support method result type String - * @tc.desc: String stringVoid(); - */ - it('ACTS_Zidl_Js2JsSingle_1100', 0, async function (done) { - testProxySingle.stringVoid((errCode, mystring) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_1100 call return:" + mystring); - expect(errCode).assertEqual(SUCCESS); - expect(mystring).assertEqual("stringVoid"); - done(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_1200 - * @tc.name: support method result type sequenceable - * @tc.desc: TestInfo sequenceableVoid(); - */ - it('ACTS_Zidl_Js2JsSingle_1200', 0, async function (done) { - testProxySingle.sequenceableVoid((errCode, mysequenceable) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_1200 call return:" + JSON.stringify(mysequenceable)); - expect(errCode).assertEqual(SUCCESS); - expect(mysequenceable.getNum()).assertEqual(14); - expect(mysequenceable.getString()).assertEqual("hello"); - done(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_1300 - * @tc.name: support method result type interface - * @tc.desc: ITest interfaceVoid(); - */ - it('ACTS_Zidl_Js2JsSingle_1300', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsSingle_1300 begin'); - - testProxySingle.interfaceVoid((errCode, data) => { - console.log("ZidlTest Server ACTS_Zidl_Js2JsSingle_1300 called"); - expect(errCode).assertEqual(SUCCESS); - let proxy = new InterfaceDeclareProxy(data); - proxy.testInterface(1500, (errCode)=>{ - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }); - }) - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_1400 - * @tc.name: support method result type Map container type - * @tc.desc: Map mapStringStringVoid(); - */ - it('ACTS_Zidl_Js2JsSingle_1400', 0, async function (done) { - testProxySingle.mapStringStringVoid((errCode, mymapStringString) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_1400 call return:" + mymapStringString.get("string1")); - expect(errCode).assertEqual(SUCCESS); - expect(mymapStringString.get("string1")).assertEqual("string2"); - done(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_1500 - * @tc.name: support method result type array type - * @tc.desc: double[] doubleArrayVoid(); - */ - it('ACTS_Zidl_Js2JsSingle_1500', 0, async function (done) { - testProxySingle.doubleArrayVoid((errCode, mydoubleArray) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_1500 call return:" + mydoubleArray); - expect(errCode).assertEqual(SUCCESS); - expect(mydoubleArray.length).assertEqual(3); - expect(mydoubleArray[0]).assertEqual(1.1); - expect(mydoubleArray[1]).assertEqual(2.1); - expect(mydoubleArray[2]).assertEqual(3.1); - done(); - }) - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_1600 - * @tc.name: support object type formal parameter attribute in - * @tc.desc: sequenceable zidl.systemtest.TestInfo; void voidInObject([in] TestInfo param); - */ - it('ACTS_Zidl_Js2JsSingle_1600', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsSingle_1600 begin'); - var flagFir = false; - var flagSec = false; - - function checkFinish() { - if (flagFir && flagSec) { - done(); - } - } - - let myMap = new Map(); - myMap.set("string1", 1); - var strarray = ["aaa", "bbb", "ccc"]; - testProxySingle.voidInMapStringInt(myMap, (errCode)=>{ - expect(errCode).assertEqual(SUCCESS); - flagFir = true; - checkFinish(); - }); - testProxySingle.voidInStringArray(strarray, (errCode)=>{ - expect(errCode).assertEqual(SUCCESS); - flagSec = true; - checkFinish(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_1700 - * @tc.name: support object type formal parameter attribute out - * @tc.desc: sequenceable zidl.systemtest.TestInfo;void voidOutObject([out] String param); - */ - it('ACTS_Zidl_Js2JsSingle_1700', 0, async function (done) { - var flagFir = false; - var flagSec = false; - - function checkFinish() { - if (flagFir && flagSec) { - done(); - } - } - - testProxySingle.voidOutMapStringInt((errCode, map) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_1700 call return:" + map.get("voidOutMapStringInt")); - expect(errCode).assertEqual(SUCCESS); - expect(map.get("voidOutMapStringInt")).assertEqual(1); - flagFir = true; - checkFinish(); - }); - testProxySingle.voidOutStringArray((errCode, strArray) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_1700 call return:" + JSON.stringify(strArray)); - expect(errCode).assertEqual(SUCCESS); - expect(strArray[0]).assertEqual("aa"); - expect(strArray[1]).assertEqual("dd"); - flagSec = true; - checkFinish(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_1800 - * @tc.name: support object type formal parameter attribute in, out - * @tc.desc: sequenceable zidl.systemtest.TestInfo;void voidInOutObject([in, out] TestInfo param); - */ - it('ACTS_Zidl_Js2JsSingle_1800', 0, async function (done) { - var flagFir = false; - var flagSec = false; - - function checkFinish() { - if (flagFir && flagSec) { - done(); - } - } - - var mapIn = new Map(); - mapIn.set("voidInOutMapStringInt1", 1801); - mapIn.set("voidInOutMapStringInt2", 1802); - testProxySingle.voidInOutMapStringInt(mapIn, (errCode, map) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_1800 call return:" + map.get("voidInOutMapStringInt")); - expect(errCode).assertEqual(SUCCESS); - expect(map.get("voidInOutMapStringInt1")).assertEqual(1802); - expect(map.get("voidInOutMapStringInt2")).assertEqual(1801); - flagFir = true; - checkFinish(); - }); - var strArrayIn = ["ddd", "ccc"]; - testProxySingle.voidInOutStringArray(strArrayIn, (errCode, strArray) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_1800 call return:" + JSON.stringify(strArray)); - expect(errCode).assertEqual(SUCCESS); - expect(strArray[0]).assertEqual("aaa"); - expect(strArray[1]).assertEqual("bbb"); - flagSec = true; - checkFinish(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_1900 - * @tc.name: support basic type formal parameter attribute in - * @tc.desc: void voidInInt([in] number param);void voidInString([in] String param); - */ - it('ACTS_Zidl_Js2JsSingle_1900', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsSingle_1900 begin'); - var number8 = 8888; - var str3 = "voidInString"; - var flagFir = false; - var flagSec = false; - - function checkFinish() { - if (flagFir && flagSec) { - done(); - } - } - - testProxySingle.voidInInt(number8, (errCode)=>{ - expect(errCode).assertEqual(SUCCESS); - flagFir = true; - checkFinish(); - }); - testProxySingle.voidInString(str3, (errCode)=>{ - expect(errCode).assertEqual(SUCCESS); - flagSec = true; - checkFinish(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_2000 - * @tc.name: support basic type formal parameter attribute out - * @tc.desc: void voidOutInt([out] number param);void voidOutString([out] String param); - */ - it('ACTS_Zidl_Js2JsSingle_2000', 0, async function (done) { - var flagFir = false; - var flagSec = false; - - function checkFinish() { - if (flagFir && flagSec) { - done(); - } - } - - testProxySingle.voidOutInt((errCode, number) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_2000 call return:" + JSON.stringify(number)); - expect(errCode).assertEqual(SUCCESS); - expect(number).assertEqual(123); - flagFir = true; - checkFinish(); - }); - testProxySingle.voidOutString((errCode, str) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_2000 call return:" + JSON.stringify(str)); - expect(str).assertEqual("voidOutString"); - expect(errCode).assertEqual(SUCCESS); - flagSec = true; - checkFinish(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_2100 - * @tc.name: support basic type formal parameter attribute in, out - * @tc.desc: void voidInOutInt([in, out] number param);void voidInOutString([in, out] String param); - */ - it('ACTS_Zidl_Js2JsSingle_2100', 0, async function (done) { - var flagFir = false; - var flagSec = false; - - function checkFinish() { - if (flagFir && flagSec) { - done(); - } - } - - console.log('ACTS_Zidl_Js2JsSingle_2100 begin'); - var number23 = 123456; - var str1 = "voidInOutString"; - testProxySingle.voidInOutInt(number23, (errCode, number) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_2100 call return:" + JSON.stringify(number)); - expect(errCode).assertEqual(SUCCESS); - expect(number).assertEqual(456789); - flagFir = true; - checkFinish(); - }); - testProxySingle.voidInOutString(str1, (errCode, str) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_2100 call return:" + JSON.stringify(str)); - expect(errCode).assertEqual(SUCCESS); - expect(str).assertEqual("456789"); - flagSec = true; - checkFinish(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_2200 - * @tc.name: support formal parameter type boolean - * @tc.desc: void voidBoolean([in] boolean param); - */ - it('ACTS_Zidl_Js2JsSingle_2200', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsSingle_2200 begin'); - var oBooleanTrue = true; - - testProxySingle.voidParameterTypeBoolean(oBooleanTrue, (errCode)=>{ - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_2300 - * @tc.name: support formal parameter type byte - * @tc.desc: void voidByte([in] byte param); - */ - it('ACTS_Zidl_Js2JsSingle_2300', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsSingle_2300 begin'); - var number1 = 1111; - - testProxySingle.voidParameterTypeByte(number1, (errCode)=>{ - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_2400 - * @tc.name: support formal parameter type short - * @tc.desc: void voidShort([in] short param); - */ - it('ACTS_Zidl_Js2JsSingle_2400', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsSingle_2400 begin'); - var number2 = 2222; - - testProxySingle.voidParameterTypeShort(number2, (errCode)=>{ - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_2500 - * @tc.name: support formal parameter type int - * @tc.desc: void voidInt([in] int param); - */ - it('ACTS_Zidl_Js2JsSingle_2500', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsSingle_2500 begin'); - var number3 = 3333; - - testProxySingle.voidParameterTypeInt(number3, (errCode)=>{ - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_2600 - * @tc.name: support formal parameter type long - * @tc.desc: void voidLong([in] long param); - */ - it('ACTS_Zidl_Js2JsSingle_2600', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsSingle_2600 begin'); - var number4 = 4444; - - testProxySingle.voidParameterTypeLong(number4, (errCode)=>{ - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_2700 - * @tc.name: support formal parameter type float - * @tc.desc: void voidFloat([in] float param); - */ - it('ACTS_Zidl_Js2JsSingle_2700', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsSingle_2700 begin'); - var number5 = 5555.1; - - testProxySingle.voidParameterTypeFloat(number5, (errCode)=>{ - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_2800 - * @tc.name: support formal parameter type double - * @tc.desc: void voidDouble([in] double param); - */ - it('ACTS_Zidl_Js2JsSingle_2800', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsSingle_2800 begin'); - var number6 = 6666.1; - - setTimeout(function () { - testProxySingle.voidParameterTypeDouble(number6, (errCode)=>{ - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }, 500); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_2900 - * @tc.name: support formal parameter type String - * @tc.desc: void voidString([in] String param); - */ - it('ACTS_Zidl_Js2JsSingle_2900', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsSingle_2900 begin'); - var str2 = "voidParameterTypeString"; - - testProxySingle.voidParameterTypeString(str2, (errCode)=>{ - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_3000 - * @tc.name: support formal parameter type sequenceable - * @tc.desc: void voidSequenceable([in] TestInfo param); - */ - it('ACTS_Zidl_Js2JsSingle_3000', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsSingle_3000 begin'); - let mySequence = new MySequenceable(); - - testProxySingle.voidParameterTypeSequenceable(mySequence, (errCode)=>{ - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_3100 - * @tc.name: support formal parameter type interface - * @tc.desc: void voidInterface([in] ITest param); - */ - it('ACTS_Zidl_Js2JsSingle_3100', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsSingle_3100 begin'); - - class InterfaceDeclare extends InterfaceDeclareStub { - testInterface(data: number, callback: testInterfaceCallback): void{ - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_3100 called"); - let result = FAIL; - - if (data == 3300) { - result = SUCCESS; - } - callback(result); - } - } - - let clientInterface = new InterfaceDeclare('clientInterface'); - - testProxySingle.voidParameterTypeInterface(clientInterface, (errCode)=>{ - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_3100 clientInterface callback"); - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_3200 - * @tc.name: support formal parameter type Map - * @tc.desc: void voidMapStringString([in] Map param); - */ - it('ACTS_Zidl_Js2JsSingle_3200', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsSingle_3200 begin'); - var map = new Map(); - map.set("voidParameterTypeMapStringString", "fdhatdh"); - - testProxySingle.voidParameterTypeMapStringString(map, (errCode)=>{ - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_3300 - * @tc.name: support formal parameter type array - * @tc.desc: void voidDoubleArray([in] double[] param); - */ - it('ACTS_Zidl_Js2JsSingle_3300', 0, async function (done) { - console.log('ACTS_Zidl_Js2JsSingle_3300 begin'); - var array = [1.1, 2.1]; - - testProxySingle.voidParameterTypeDoubleArray(array, (errCode)=>{ - expect(errCode).assertEqual(SUCCESS); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_3400 - * @tc.name: parameter order - * @tc.desc: order of parameter properties [out], [in] - */ - it('ACTS_Zidl_Js2JsSingle_3400', 0, async function (done) { - var num = 61; - testProxySingle.voidOrderOutIn(num, (errCode, string) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_3400 call return:" + string); - expect(errCode).assertEqual(SUCCESS); - expect(string).assertEqual("hello world"); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_3500 - * @tc.name: parameter order - * @tc.desc: order of parameter properties [in, out], [in] - */ - it('ACTS_Zidl_Js2JsSingle_3500', 0, async function (done) { - var num = 62; - var str = "inputparam"; - testProxySingle.voidOrderInOutIn(num, str, (errCode, numparam) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_3500 call return:" + numparam); - expect(errCode).assertEqual(SUCCESS); - expect(numparam).assertEqual(6); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_3600 - * @tc.name: parameter order - * @tc.desc: order of parameter properties [out], [in, out] - */ - it('ACTS_Zidl_Js2JsSingle_3600', 0, async function (done) { - var str = "param"; - testProxySingle.voidOrderOutInOut(str, (errCode, paramI, paramS) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_3600 call return:" + paramI + " " + paramS); - expect(errCode).assertEqual(SUCCESS); - expect(paramI).assertEqual(3); - expect(paramS).assertEqual("paramcallback"); - done(); - }); - }) - - /** - * @tc.number: ACTS_Zidl_Js2JsSingle_3700 - * @tc.name: parameter order - * @tc.desc: order of parameter properties [in], [in, out], [out] - */ - it('ACTS_Zidl_Js2JsSingle_3700', 0, async function (done) { - var str = "paramInput"; - var num = 64; - testProxySingle.voidOrderInInOutOut(str, num, (errCode, paramI, paramS) => { - console.log("ZidlTest Client ACTS_Zidl_Js2JsSingle_3700 call return:" + paramS + " " + paramI); - expect(errCode).assertEqual(SUCCESS); - expect(paramS).assertEqual("callback"); - expect(paramI).assertEqual(4); - done(); - }); - }) - }) -} \ No newline at end of file diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 882f978e77b1a8fbbf843ccb4dd73c47ed460305..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,22 +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 './Ability.test.ets' - - -export default function testsuite(context) { - - abilityTest(context) - -} \ No newline at end of file diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/i_zidl_tool_test.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/i_zidl_tool_test.ts deleted file mode 100644 index ac9da635209b8b8a170f587485ab01a1e9844fcb..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/i_zidl_tool_test.ts +++ /dev/null @@ -1,105 +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 MySequenceable from "./my_sequenceable"; -import IInterfaceDeclare from "../interfaceDeclare/i_interface_declare"; - -export default interface IZidlToolTest { - onewayVoidVoid(callback: onewayVoidVoidCallback): void; - voidVoid(callback: voidVoidCallback): void; - booleanVoid(callback: booleanVoidCallback): void; - byteVoid(callback: byteVoidCallback): void; - shortVoid(callback: shortVoidCallback): void; - intVoid(callback: intVoidCallback): void; - longVoid(callback: longVoidCallback): void; - floatVoid(callback: floatVoidCallback): void; - doubleVoid(callback: doubleVoidCallback): void; - stringVoid(callback: stringVoidCallback): void; - sequenceableVoid(callback: sequenceableVoidCallback): void; - interfaceVoid(callback: interfaceVoidCallback): void; - mapStringStringVoid(callback: mapStringStringVoidCallback): void; - doubleArrayVoid(callback: doubleArrayVoidCallback): void; - voidInMapStringInt(param: Map, callback: voidInMapStringIntCallback): void; - voidInStringArray(param: string[], callback: voidInStringArrayCallback): void; - voidOutMapStringInt(callback: voidOutMapStringIntCallback): void; - voidOutStringArray(callback: voidOutStringArrayCallback): void; - voidInOutMapStringInt(param: Map, callback: voidInOutMapStringIntCallback): void; - voidInOutStringArray(param: string[], callback: voidInOutStringArrayCallback): void; - voidInInt(param: number, callback: voidInIntCallback): void; - voidInString(param: string, callback: voidInStringCallback): void; - voidOutInt(callback: voidOutIntCallback): void; - voidOutString(callback: voidOutStringCallback): void; - voidInOutInt(param: number, callback: voidInOutIntCallback): void; - voidInOutString(param: string, callback: voidInOutStringCallback): void; - voidParameterTypeBoolean(param: boolean, callback: voidParameterTypeBooleanCallback): void; - voidParameterTypeByte(param: number, callback: voidParameterTypeByteCallback): void; - voidParameterTypeShort(param: number, callback: voidParameterTypeShortCallback): void; - voidParameterTypeInt(param: number, callback: voidParameterTypeIntCallback): void; - voidParameterTypeLong(param: number, callback: voidParameterTypeLongCallback): void; - voidParameterTypeFloat(param: number, callback: voidParameterTypeFloatCallback): void; - voidParameterTypeDouble(param: number, callback: voidParameterTypeDoubleCallback): void; - voidParameterTypeString(param: string, callback: voidParameterTypeStringCallback): void; - voidParameterTypeSequenceable(param: MySequenceable, callback: voidParameterTypeSequenceableCallback): void; - voidParameterTypeInterface(param: IInterfaceDeclare, callback: voidParameterTypeInterfaceCallback): void; - voidParameterTypeMapStringString(param: Map, callback: voidParameterTypeMapStringStringCallback): void; - voidParameterTypeDoubleArray(param: number[], callback: voidParameterTypeDoubleArrayCallback): void; - voidOrderOutIn(paramI: number, callback: voidOrderOutInCallback): void; - voidOrderInOutIn(paramI: number, paramS: string, callback: voidOrderInOutInCallback): void; - voidOrderOutInOut(paramS: string, callback: voidOrderOutInOutCallback): void; - voidOrderInInOutOut(paramS: string, paramI: number, callback: voidOrderInInOutOutCallback): void; -} -export type onewayVoidVoidCallback = (errCode: number) => void; -export type voidVoidCallback = (errCode: number) => void; -export type booleanVoidCallback = (errCode: number, returnValue: boolean) => void; -export type byteVoidCallback = (errCode: number, returnValue: number) => void; -export type shortVoidCallback = (errCode: number, returnValue: number) => void; -export type intVoidCallback = (errCode: number, returnValue: number) => void; -export type longVoidCallback = (errCode: number, returnValue: number) => void; -export type floatVoidCallback = (errCode: number, returnValue: number) => void; -export type doubleVoidCallback = (errCode: number, returnValue: number) => void; -export type stringVoidCallback = (errCode: number, returnValue: string) => void; -export type sequenceableVoidCallback = (errCode: number, returnValue: MySequenceable) => void; -export type interfaceVoidCallback = (errCode: number, returnValue: IInterfaceDeclare) => void; -export type mapStringStringVoidCallback = (errCode: number, returnValue: Map) => void; -export type doubleArrayVoidCallback = (errCode: number, returnValue: number[]) => void; -export type voidInMapStringIntCallback = (errCode: number) => void; -export type voidInStringArrayCallback = (errCode: number) => void; -export type voidOutMapStringIntCallback = (errCode: number, param: Map) => void; -export type voidOutStringArrayCallback = (errCode: number, param: string[]) => void; -export type voidInOutMapStringIntCallback = (errCode: number, param: Map) => void; -export type voidInOutStringArrayCallback = (errCode: number, param: string[]) => void; -export type voidInIntCallback = (errCode: number) => void; -export type voidInStringCallback = (errCode: number) => void; -export type voidOutIntCallback = (errCode: number, param: number) => void; -export type voidOutStringCallback = (errCode: number, param: string) => void; -export type voidInOutIntCallback = (errCode: number, param: number) => void; -export type voidInOutStringCallback = (errCode: number, param: string) => void; -export type voidParameterTypeBooleanCallback = (errCode: number) => void; -export type voidParameterTypeByteCallback = (errCode: number) => void; -export type voidParameterTypeShortCallback = (errCode: number) => void; -export type voidParameterTypeIntCallback = (errCode: number) => void; -export type voidParameterTypeLongCallback = (errCode: number) => void; -export type voidParameterTypeFloatCallback = (errCode: number) => void; -export type voidParameterTypeDoubleCallback = (errCode: number) => void; -export type voidParameterTypeStringCallback = (errCode: number) => void; -export type voidParameterTypeSequenceableCallback = (errCode: number) => void; -export type voidParameterTypeInterfaceCallback = (errCode: number) => void; -export type voidParameterTypeMapStringStringCallback = (errCode: number) => void; -export type voidParameterTypeDoubleArrayCallback = (errCode: number) => void; -export type voidOrderOutInCallback = (errCode: number, paramS: string) => void; -export type voidOrderInOutInCallback = (errCode: number, paramI: number) => void; -export type voidOrderOutInOutCallback = (errCode: number, paramI: number, paramS: string) => void; -export type voidOrderInInOutOutCallback = (errCode: number, paramI: number, paramS2: string) => void; - diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/my_sequenceable.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/my_sequenceable.ts deleted file mode 100644 index 742b78e6a737b29de1a909d4ed6c03b1768064cd..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/my_sequenceable.ts +++ /dev/null @@ -1,28 +0,0 @@ -export default class MySequenceable { - constructor() { - this.num = 32; - this.str = "nihao"; - } - getNum() : number { - return this.num; - } - - getString() : string { - return this.str; - } - - marshalling(messageParcel) { - console.info('marshalling++++'); - messageParcel.writeInt(this.num); - messageParcel.writeString(this.str); - return true; - } - unmarshalling(messageParcel) { - console.info('unmarshalling++++'); - this.num = messageParcel.readInt(); - this.str = messageParcel.readString(); - return true; - } - private num; - private str; -} \ No newline at end of file diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/zidl_tool_test_proxy.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/zidl_tool_test_proxy.ts deleted file mode 100644 index c1431ca78cc44f27500b399da5b0805a27bb4947..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlTool/zidl_tool_test_proxy.ts +++ /dev/null @@ -1,948 +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 {onewayVoidVoidCallback} from "./i_zidl_tool_test"; -import {voidVoidCallback} from "./i_zidl_tool_test"; -import {booleanVoidCallback} from "./i_zidl_tool_test"; -import {byteVoidCallback} from "./i_zidl_tool_test"; -import {shortVoidCallback} from "./i_zidl_tool_test"; -import {intVoidCallback} from "./i_zidl_tool_test"; -import {longVoidCallback} from "./i_zidl_tool_test"; -import {floatVoidCallback} from "./i_zidl_tool_test"; -import {doubleVoidCallback} from "./i_zidl_tool_test"; -import {stringVoidCallback} from "./i_zidl_tool_test"; -import {sequenceableVoidCallback} from "./i_zidl_tool_test"; -import {interfaceVoidCallback} from "./i_zidl_tool_test"; -import {mapStringStringVoidCallback} from "./i_zidl_tool_test"; -import {doubleArrayVoidCallback} from "./i_zidl_tool_test"; -import {voidInMapStringIntCallback} from "./i_zidl_tool_test"; -import {voidInStringArrayCallback} from "./i_zidl_tool_test"; -import {voidOutMapStringIntCallback} from "./i_zidl_tool_test"; -import {voidOutStringArrayCallback} from "./i_zidl_tool_test"; -import {voidInOutMapStringIntCallback} from "./i_zidl_tool_test"; -import {voidInOutStringArrayCallback} from "./i_zidl_tool_test"; -import {voidInIntCallback} from "./i_zidl_tool_test"; -import {voidInStringCallback} from "./i_zidl_tool_test"; -import {voidOutIntCallback} from "./i_zidl_tool_test"; -import {voidOutStringCallback} from "./i_zidl_tool_test"; -import {voidInOutIntCallback} from "./i_zidl_tool_test"; -import {voidInOutStringCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeBooleanCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeByteCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeShortCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeIntCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeLongCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeFloatCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeDoubleCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeStringCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeSequenceableCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeInterfaceCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeMapStringStringCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeDoubleArrayCallback} from "./i_zidl_tool_test"; -import {voidOrderOutInCallback} from "./i_zidl_tool_test"; -import {voidOrderInOutInCallback} from "./i_zidl_tool_test"; -import {voidOrderOutInOutCallback} from "./i_zidl_tool_test"; -import {voidOrderInInOutOutCallback} from "./i_zidl_tool_test"; -import IZidlToolTest from "./i_zidl_tool_test"; -import rpc from "@ohos.rpc"; -import MySequenceable from "./my_sequenceable"; -import IInterfaceDeclare from "../interfaceDeclare/i_interface_declare"; -import InterfaceDeclareStub from "../interfaceDeclare/interface_declare_stub"; - -export default class ZidlToolTestProxy implements IZidlToolTest { - constructor(proxy) { - this.proxy = proxy; - } - - onewayVoidVoid(callback: onewayVoidVoidCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_ASYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_ONEWAY_VOID_VOID, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidVoid(callback: voidVoidCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_VOID, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - booleanVoid(callback: booleanVoidCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_BOOLEAN_VOID, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _returnValue = undefined; - callback(_errCode, _returnValue); - return; - } - let _returnValue = result.reply.readInt() == 1 ? true : false; - callback(_errCode, _returnValue); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - byteVoid(callback: byteVoidCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_BYTE_VOID, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _returnValue = undefined; - callback(_errCode, _returnValue); - return; - } - let _returnValue = result.reply.readInt(); - callback(_errCode, _returnValue); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - shortVoid(callback: shortVoidCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_SHORT_VOID, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _returnValue = undefined; - callback(_errCode, _returnValue); - return; - } - let _returnValue = result.reply.readInt(); - callback(_errCode, _returnValue); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - intVoid(callback: intVoidCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_INT_VOID, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _returnValue = undefined; - callback(_errCode, _returnValue); - return; - } - let _returnValue = result.reply.readInt(); - callback(_errCode, _returnValue); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - longVoid(callback: longVoidCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_LONG_VOID, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _returnValue = undefined; - callback(_errCode, _returnValue); - return; - } - let _returnValue = result.reply.readLong(); - callback(_errCode, _returnValue); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - floatVoid(callback: floatVoidCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_FLOAT_VOID, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _returnValue = undefined; - callback(_errCode, _returnValue); - return; - } - let _returnValue = result.reply.readFloat(); - callback(_errCode, _returnValue); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - doubleVoid(callback: doubleVoidCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_DOUBLE_VOID, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _returnValue = undefined; - callback(_errCode, _returnValue); - return; - } - let _returnValue = result.reply.readDouble(); - callback(_errCode, _returnValue); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - stringVoid(callback: stringVoidCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_STRING_VOID, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _returnValue = undefined; - callback(_errCode, _returnValue); - return; - } - let _returnValue = result.reply.readString(); - callback(_errCode, _returnValue); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - sequenceableVoid(callback: sequenceableVoidCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_SEQUENCEABLE_VOID, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _returnValue = undefined; - callback(_errCode, _returnValue); - return; - } - let _returnValue = new MySequenceable(); - result.reply.readSequenceable(_returnValue); - callback(_errCode, _returnValue); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - interfaceVoid(callback: interfaceVoidCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_INTERFACE_VOID, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _returnValue = undefined; - callback(_errCode, _returnValue); - return; - } - let _returnValue = result.reply.readRemoteObject(); - callback(_errCode, _returnValue); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - mapStringStringVoid(callback: mapStringStringVoidCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_MAP_STRING_STRING_VOID, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _returnValue = undefined; - callback(_errCode, _returnValue); - return; - } - let _returnValue = new Map(); - let _returnValueSize = result.reply.readInt(); - for (let i = 0; i < _returnValueSize; ++i) { - let key = result.reply.readString(); - let value = result.reply.readString(); - _returnValue.set(key, value); - } - callback(_errCode, _returnValue); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - doubleArrayVoid(callback: doubleArrayVoidCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_DOUBLE_ARRAY_VOID, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _returnValue = undefined; - callback(_errCode, _returnValue); - return; - } - let _returnValue = result.reply.readDoubleArray(); - callback(_errCode, _returnValue); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidInMapStringInt(param: Map, callback: voidInMapStringIntCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeInt(param.size); - for (let [key, value] of param) { - _data.writeString(key); - _data.writeInt(value); - } - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_IN_MAP_STRING_INT, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidInStringArray(param: string[], callback: voidInStringArrayCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeStringArray(param); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_IN_STRING_ARRAY, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidOutMapStringInt(callback: voidOutMapStringIntCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_OUT_MAP_STRING_INT, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _param = undefined; - callback(_errCode,_param); - return; - } - let _param = new Map(); - let _paramSize = result.reply.readInt(); - for (let i = 0; i < _paramSize; ++i) { - let key = result.reply.readString(); - let value = result.reply.readInt(); - _param.set(key, value); - } - callback(_errCode,_param); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidOutStringArray(callback: voidOutStringArrayCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_OUT_STRING_ARRAY, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _param = undefined; - callback(_errCode,_param); - return; - } - let _param = result.reply.readStringArray(); - callback(_errCode,_param); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidInOutMapStringInt(param: Map, callback: voidInOutMapStringIntCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeInt(param.size); - for (let [key, value] of param) { - _data.writeString(key); - _data.writeInt(value); - } - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_IN_OUT_MAP_STRING_INT, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _param = undefined; - callback(_errCode,_param); - return; - } - let _param = new Map(); - let _paramSize = result.reply.readInt(); - for (let i = 0; i < _paramSize; ++i) { - let key = result.reply.readString(); - let value = result.reply.readInt(); - _param.set(key, value); - } - callback(_errCode,_param); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidInOutStringArray(param: string[], callback: voidInOutStringArrayCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeStringArray(param); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_IN_OUT_STRING_ARRAY, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _param = undefined; - callback(_errCode,_param); - return; - } - let _param = result.reply.readStringArray(); - callback(_errCode,_param); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidInInt(param: number, callback: voidInIntCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeInt(param); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_IN_INT, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidInString(param: string, callback: voidInStringCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeString(param); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_IN_STRING, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidOutInt(callback: voidOutIntCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_OUT_INT, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _param = undefined; - callback(_errCode,_param); - return; - } - let _param = result.reply.readInt(); - callback(_errCode,_param); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidOutString(callback: voidOutStringCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_OUT_STRING, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _param = undefined; - callback(_errCode,_param); - return; - } - let _param = result.reply.readString(); - callback(_errCode,_param); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidInOutInt(param: number, callback: voidInOutIntCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeInt(param); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_IN_OUT_INT, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _param = undefined; - callback(_errCode,_param); - return; - } - let _param = result.reply.readInt(); - callback(_errCode,_param); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidInOutString(param: string, callback: voidInOutStringCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeString(param); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_IN_OUT_STRING, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _param = undefined; - callback(_errCode,_param); - return; - } - let _param = result.reply.readString(); - callback(_errCode,_param); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidParameterTypeBoolean(param: boolean, callback: voidParameterTypeBooleanCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeInt(param ? 1 : 0); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_PARAMETER_TYPE_BOOLEAN, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidParameterTypeByte(param: number, callback: voidParameterTypeByteCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeInt(param); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_PARAMETER_TYPE_BYTE, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidParameterTypeShort(param: number, callback: voidParameterTypeShortCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeInt(param); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_PARAMETER_TYPE_SHORT, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidParameterTypeInt(param: number, callback: voidParameterTypeIntCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeInt(param); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_PARAMETER_TYPE_INT, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidParameterTypeLong(param: number, callback: voidParameterTypeLongCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeLong(param); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_PARAMETER_TYPE_LONG, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidParameterTypeFloat(param: number, callback: voidParameterTypeFloatCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeFloat(param); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_PARAMETER_TYPE_FLOAT, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidParameterTypeDouble(param: number, callback: voidParameterTypeDoubleCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeDouble(param); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_PARAMETER_TYPE_DOUBLE, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidParameterTypeString(param: string, callback: voidParameterTypeStringCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeString(param); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_PARAMETER_TYPE_STRING, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidParameterTypeSequenceable(param: MySequenceable, callback: voidParameterTypeSequenceableCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeSequenceable(param); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_PARAMETER_TYPE_SEQUENCEABLE, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidParameterTypeInterface(param: IInterfaceDeclare, callback: voidParameterTypeInterfaceCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeRemoteObject(param as InterfaceDeclareStub); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_PARAMETER_TYPE_INTERFACE, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidParameterTypeMapStringString(param: Map, callback: voidParameterTypeMapStringStringCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeInt(param.size); - for (let [key, value] of param) { - _data.writeString(key); - _data.writeString(value); - } - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_PARAMETER_TYPE_MAP_STRING_STRING, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidParameterTypeDoubleArray(param: number[], callback: voidParameterTypeDoubleArrayCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeDoubleArray(param); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_PARAMETER_TYPE_DOUBLE_ARRAY, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidOrderOutIn(paramI: number, callback: voidOrderOutInCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeInt(paramI); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_ORDER_OUT_IN, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _paramS = undefined; - callback(_errCode,_paramS); - return; - } - let _paramS = result.reply.readString(); - callback(_errCode,_paramS); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidOrderInOutIn(paramI: number, paramS: string, callback: voidOrderInOutInCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeInt(paramI); - _data.writeString(paramS); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_ORDER_IN_OUT_IN, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _paramI = undefined; - callback(_errCode,_paramI); - return; - } - let _paramI = result.reply.readInt(); - callback(_errCode,_paramI); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidOrderOutInOut(paramS: string, callback: voidOrderOutInOutCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeString(paramS); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_ORDER_OUT_IN_OUT, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _paramI = undefined; - let _paramS = undefined; - callback(_errCode,_paramI, _paramS); - return; - } - let _paramI = result.reply.readInt(); - let _paramS = result.reply.readString(); - callback(_errCode,_paramI, _paramS); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidOrderInInOutOut(paramS: string, paramI: number, callback: voidOrderInInOutOutCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeString(paramS); - _data.writeInt(paramI); - this.proxy.sendRequest(ZidlToolTestProxy.COMMAND_VOID_ORDER_IN_IN_OUT_OUT, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - if (_errCode != 0) { - let _paramI = undefined; - let _paramS2 = undefined; - callback(_errCode,_paramI, _paramS2); - return; - } - let _paramI = result.reply.readInt(); - let _paramS2 = result.reply.readString(); - callback(_errCode,_paramI, _paramS2); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - static readonly COMMAND_ONEWAY_VOID_VOID = 1; - static readonly COMMAND_VOID_VOID = 2; - static readonly COMMAND_BOOLEAN_VOID = 3; - static readonly COMMAND_BYTE_VOID = 4; - static readonly COMMAND_SHORT_VOID = 5; - static readonly COMMAND_INT_VOID = 6; - static readonly COMMAND_LONG_VOID = 7; - static readonly COMMAND_FLOAT_VOID = 8; - static readonly COMMAND_DOUBLE_VOID = 9; - static readonly COMMAND_STRING_VOID = 10; - static readonly COMMAND_SEQUENCEABLE_VOID = 11; - static readonly COMMAND_INTERFACE_VOID = 12; - static readonly COMMAND_MAP_STRING_STRING_VOID = 13; - static readonly COMMAND_DOUBLE_ARRAY_VOID = 14; - static readonly COMMAND_VOID_IN_MAP_STRING_INT = 15; - static readonly COMMAND_VOID_IN_STRING_ARRAY = 16; - static readonly COMMAND_VOID_OUT_MAP_STRING_INT = 17; - static readonly COMMAND_VOID_OUT_STRING_ARRAY = 18; - static readonly COMMAND_VOID_IN_OUT_MAP_STRING_INT = 19; - static readonly COMMAND_VOID_IN_OUT_STRING_ARRAY = 20; - static readonly COMMAND_VOID_IN_INT = 21; - static readonly COMMAND_VOID_IN_STRING = 22; - static readonly COMMAND_VOID_OUT_INT = 23; - static readonly COMMAND_VOID_OUT_STRING = 24; - static readonly COMMAND_VOID_IN_OUT_INT = 25; - static readonly COMMAND_VOID_IN_OUT_STRING = 26; - static readonly COMMAND_VOID_PARAMETER_TYPE_BOOLEAN = 27; - static readonly COMMAND_VOID_PARAMETER_TYPE_BYTE = 28; - static readonly COMMAND_VOID_PARAMETER_TYPE_SHORT = 29; - static readonly COMMAND_VOID_PARAMETER_TYPE_INT = 30; - static readonly COMMAND_VOID_PARAMETER_TYPE_LONG = 31; - static readonly COMMAND_VOID_PARAMETER_TYPE_FLOAT = 32; - static readonly COMMAND_VOID_PARAMETER_TYPE_DOUBLE = 33; - static readonly COMMAND_VOID_PARAMETER_TYPE_STRING = 34; - static readonly COMMAND_VOID_PARAMETER_TYPE_SEQUENCEABLE = 35; - static readonly COMMAND_VOID_PARAMETER_TYPE_INTERFACE = 36; - static readonly COMMAND_VOID_PARAMETER_TYPE_MAP_STRING_STRING = 37; - static readonly COMMAND_VOID_PARAMETER_TYPE_DOUBLE_ARRAY = 38; - static readonly COMMAND_VOID_ORDER_OUT_IN = 39; - static readonly COMMAND_VOID_ORDER_IN_OUT_IN = 40; - static readonly COMMAND_VOID_ORDER_OUT_IN_OUT = 41; - static readonly COMMAND_VOID_ORDER_IN_IN_OUT_OUT = 42; - private proxy -} - diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts deleted file mode 100644 index a17db0f5d20ac1d674258b1e094355c2276fc2b4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts +++ /dev/null @@ -1,25 +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. - */ - - -export default interface IInterfaceAttributeDeclaratoinOneway { - voidVoidFirst(callback: voidVoidFirstCallback): void; - voidVoidSecond(callback: voidVoidSecondCallback): void; - voidVoidThird(callback: voidVoidThirdCallback): void; -} -export type voidVoidFirstCallback = (errCode: number) => void; -export type voidVoidSecondCallback = (errCode: number) => void; -export type voidVoidThirdCallback = (errCode: number) => void; - diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlToolOneWay/interface_attribute_declaratoin_oneway_proxy.ts b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlToolOneWay/interface_attribute_declaratoin_oneway_proxy.ts deleted file mode 100644 index b3f7e054918f4b007c75210222f4e3330b594b30..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/ets/zidlToolOneWay/interface_attribute_declaratoin_oneway_proxy.ts +++ /dev/null @@ -1,77 +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 {voidVoidFirstCallback} from "./i_interface_attribute_declaratoin_oneway"; -import {voidVoidSecondCallback} from "./i_interface_attribute_declaratoin_oneway"; -import {voidVoidThirdCallback} from "./i_interface_attribute_declaratoin_oneway"; -import IInterfaceAttributeDeclaratoinOneway from "./i_interface_attribute_declaratoin_oneway"; -import rpc from "@ohos.rpc"; - -export default class InterfaceAttributeDeclaratoinOnewayProxy implements IInterfaceAttributeDeclaratoinOneway { - constructor(proxy) { - this.proxy = proxy; - } - - voidVoidFirst(callback: voidVoidFirstCallback): void - { - let _option = new rpc.MessageOption(1); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(InterfaceAttributeDeclaratoinOnewayProxy.COMMAND_VOID_VOID_FIRST, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidVoidSecond(callback: voidVoidSecondCallback): void - { - let _option = new rpc.MessageOption(1); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(InterfaceAttributeDeclaratoinOnewayProxy.COMMAND_VOID_VOID_SECOND, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - voidVoidThird(callback: voidVoidThirdCallback): void - { - let _option = new rpc.MessageOption(1); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - this.proxy.sendRequest(InterfaceAttributeDeclaratoinOnewayProxy.COMMAND_VOID_VOID_THIRD, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - static readonly COMMAND_VOID_VOID_FIRST = 1; - static readonly COMMAND_VOID_VOID_SECOND = 2; - static readonly COMMAND_VOID_VOID_THIRD = 3; - private proxy -} - diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/module.json b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/module.json deleted file mode 100644 index 281074d04f55fce36b1433cf84248ecce4fd89ae..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/module.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.zidlclienttest.MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:phone_entry_main", - "icon": "$media:icon", - "label": "$string:entry_label", - "visible": true, - "orientation": "portrait", - "launchType": "singleton", - "skills": [ - { - "actions": [ - "action.system.home" - ], - "entities": [ - "entity.system.home" - ] - } - ] - } - ], - "extensionAbilities": [ - { - "srcEntrance": "./ets/ServiceAbility/ServiceAbility.ts", - "name": "com.example.zidlclienttest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - }, - { - "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", - "name": "com.example.zidlclienttest.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" - } - ] - } -} \ No newline at end of file diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/resources/base/element/string.json deleted file mode 100644 index 2977b612ec4595b13eaaffe3e8fc578e83c42d48..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/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/zidltest/actsamszidlclienttest/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index 474a55588fd7216113dd42073aadf254d4dba023..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 6898b31d2085f478ee1ed9d933a5910cbf901d92..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/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/zidltest/actsamszidlclienttest/signature/openharmony_sx.p7b b/ability/ability_runtime/zidltest/actsamszidlclienttest/signature/openharmony_sx.p7b deleted file mode 100755 index dcec6c9615032c1b48bf185e839d9720dd68aab0..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/zidltest/actsamszidlclienttest/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/AppScope/app.json b/ability/ability_runtime/zidltest/actsamszidlservice/AppScope/app.json deleted file mode 100644 index 89dc01d02a14fa22dbd7b4abe8cf15517c6e9b02..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.zidlservice", - "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/zidltest/actsamszidlservice/AppScope/resources/base/element/string.json b/ability/ability_runtime/zidltest/actsamszidlservice/AppScope/resources/base/element/string.json deleted file mode 100644 index be09cccde1bc7369ef47a5cd45d2b06884c88602..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/zidltest/actsamszidlservice/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/zidltest/actsamszidlservice/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/BUILD.gn b/ability/ability_runtime/zidltest/actsamszidlservice/BUILD.gn deleted file mode 100644 index c9ac8571e07429934720670a09cc87985a527d0d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/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_assist_suite("ActsAmsZidlServiceRelyHap") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":actsamszidlservicerelyhap_js_assets", - ":actsamszidlservicerelyhap_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsAmsZidlServiceRelyHap" - - testonly = true - subsystem_name = "ability" - part_name = "ability_runtime" -} - -ohos_app_scope("actsamszidlservicerelyhap_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actsamszidlservicerelyhap_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("actsamszidlservicerelyhap_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":actsamszidlservicerelyhap_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index a41751fb10f96d4103d1120e59c5c5f5aa089e72..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/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.app.ability.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/zidltest/actsamszidlservice/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 12e4e6d211629ca8d78f2255d6be1b96615ea696..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,51 +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.app.ability.UIAbility' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("ACTS_ProcessManage VendorAppService MainAbility onCreate") - globalThis.abilityWant = want; - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("ACTS_ProcessManage VendorAppService MainAbility onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("ACTS_ProcessManage VendorAppService MainAbility onWindowStageCreate") - globalThis.abilityContext = this.context - windowStage.setUIContent(this.context, "pages/index", null) - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("ACTS_ProcessManage VendorAppService MainAbility onWindowStageDestroy") - } - - async onForeground() { - // Ability has brought to foreground - console.log("ACTS_ProcessManage VendorAppService MainAbility onForeground") - } - - onBackground() { - // Ability has back to background - console.log("ACTS_ProcessManage VendorAppService MainAbility onBackground") - } -}; diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index 59a8864b1e2b7196abfc979fcd2cdbeb43b6c953..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,434 +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 Want from '@ohos.application.Want'; -import {voidOutStringCallback} from "./zidlTool/i_zidl_tool_test"; -import {voidOutIntCallback} from "./zidlTool/i_zidl_tool_test"; -import {voidOutMapStringIntCallback} from "./zidlTool/i_zidl_tool_test"; -import {voidOutStringArrayCallback} from "./zidlTool/i_zidl_tool_test"; -import {voidInOutMapStringIntCallback} from "./zidlTool/i_zidl_tool_test"; -import {voidInOutStringArrayCallback} from "./zidlTool/i_zidl_tool_test"; -import {voidInOutIntCallback} from "./zidlTool/i_zidl_tool_test"; -import {voidInOutStringCallback} from "./zidlTool/i_zidl_tool_test"; -import {booleanVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {byteVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {shortVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {intVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {longVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {floatVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {doubleVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {stringVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {sequenceableVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {interfaceVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {mapStringStringVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {doubleArrayVoidCallback} from "./zidlTool/i_zidl_tool_test"; -import {voidOrderOutInCallback} from "./zidlTool/i_zidl_tool_test" -import {voidOrderInOutInCallback} from "./zidlTool/i_zidl_tool_test" -import {voidOrderOutInOutCallback} from "./zidlTool/i_zidl_tool_test" -import {voidOrderInInOutOutCallback} from "./zidlTool/i_zidl_tool_test" -import {onewayVoidVoidCallback} from "./zidlTool/i_zidl_tool_test" -import {voidInMapStringIntCallback} from "./zidlTool/i_zidl_tool_test" -import {voidVoidCallback} from "./zidlTool/i_zidl_tool_test" -import {voidInStringArrayCallback} from "./zidlTool/i_zidl_tool_test" -import ZidlTestServiceStub from './zidlTool/zidl_tool_test_stub'; -import MySequenceable from "./zidlTool/my_sequenceable"; -import InterfaceDeclareProxy from './interfaceDeclare/interface_declare_proxy' -import InterfaceDeclareStub from './interfaceDeclare/interface_declare_stub' -import {voidInIntCallback} from "./zidlTool/i_zidl_tool_test" -import {voidInStringCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeBooleanCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeByteCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeShortCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeIntCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeLongCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeFloatCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeDoubleCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeStringCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeSequenceableCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeInterfaceCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeMapStringStringCallback} from "./zidlTool/i_zidl_tool_test" -import {voidParameterTypeDoubleArrayCallback} from "./zidlTool/i_zidl_tool_test" -import {testInterfaceCallback} from './interfaceDeclare/i_interface_declare' - -var SUCCESS = 0; -var FAIL = 1; - -class ZidlTestImp extends ZidlTestServiceStub { - - onewayVoidVoid(callback: onewayVoidVoidCallback) { - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_0200 called"); - callback(SUCCESS); - } - - voidVoid(callback: voidVoidCallback) { - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_0300 called"); - callback(SUCCESS); - } - - booleanVoid(callback: booleanVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_0400 called"); - var boolean = true; - callback(SUCCESS, boolean); - } - - byteVoid(callback: byteVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_0500 called"); - var mybyte = 1; - callback(SUCCESS, mybyte); - } - - shortVoid(callback: shortVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_0600 called"); - var myshort = 222; - callback(SUCCESS, myshort); - } - - intVoid(callback: intVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_0700 called"); - var myint = 333; - callback(SUCCESS, myint); - } - - longVoid(callback: longVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_0800 called"); - var mylong = 4444; - callback(SUCCESS, mylong); - } - - floatVoid(callback: floatVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_0900 called"); - var myfloat = 10.1; - callback(SUCCESS, myfloat); - } - - doubleVoid(callback: doubleVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_1000 called"); - var mydouble = 22.1; - callback(SUCCESS, mydouble); - } - - stringVoid(callback: stringVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_1100 called"); - var mystring = "stringVoid"; - callback(SUCCESS, mystring); - } - - sequenceableVoid(callback: sequenceableVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_1200 called"); - let mySequence = new MySequenceable(); - callback(SUCCESS, mySequence); - } - - interfaceVoid(callback: interfaceVoidCallback) { - class InterfaceDeclare extends InterfaceDeclareStub { - testInterface(data: number, callback: testInterfaceCallback): void{ - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_1300 interfaceStub called"); - let result = FAIL; - - if (data == 1500) { - result = SUCCESS; - } - callback(result); - } - } - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_1300 toolStub called"); - let serverInterface = new InterfaceDeclare('serverInterface'); - callback(SUCCESS, serverInterface); - } - - mapStringStringVoid(callback: mapStringStringVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_1400 called"); - let myMap = new Map(); - myMap.set("string1","string2"); - callback(SUCCESS, myMap); - } - - doubleArrayVoid(callback: doubleArrayVoidCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_1500 called"); - var array = [1.1, 2.1, 3.1]; - callback(SUCCESS, array); - } - - voidInMapStringInt(myMap, callback: voidInMapStringIntCallback){ - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_1600_1 called:'+ myMap.get("string1")); - if(myMap.get("string1") == 1){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidInStringArray(strarray, callback: voidInStringArrayCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_1600_2 called:"+ JSON.stringify(strarray)); - if(strarray[0] == "aaa"&&strarray[1] == "bbb"&&strarray[2] == "ccc"){ - callback(SUCCESS); - }else { - callback(FAIL); - } - } - - voidOutMapStringInt(callback : voidOutMapStringIntCallback){ - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_1700 called'); - var map=new Map(); - map.set("voidOutMapStringInt", 1); - callback(SUCCESS, map); - } - - voidOutStringArray(callback :voidOutStringArrayCallback){ - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_1700 called'); - var strarray = ["aa", "dd"]; - callback(SUCCESS, strarray); - } - - voidInOutMapStringInt(mapIn, callback: voidInOutMapStringIntCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_1800 called'); - var errCode = FAIL; - if ((mapIn.get("voidInOutMapStringInt1") == 1801) && - (mapIn.get("voidInOutMapStringInt2") == 1802)) { - mapIn.set("voidInOutMapStringInt1", 1802); - mapIn.set("voidInOutMapStringInt2", 1801); - errCode = SUCCESS; - } - callback(errCode, mapIn); - } - - voidInOutStringArray(strArrayIn, callback: voidInOutStringArrayCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_1800 called'); - var errCode = FAIL; - if ((strArrayIn[0] == "ddd") && - (strArrayIn[1] == "ccc")) { - strArrayIn[0] = "aaa"; - strArrayIn[1] = "bbb"; - errCode = SUCCESS; - } - callback(errCode, strArrayIn); - } - - voidInInt(number, callback : voidInIntCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_1900 called:'+ JSON.stringify(number)); - if(number == 8888){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidInString(string, callback : voidInStringCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_1900 called:'+ JSON.stringify(string)); - if(string == "voidInString"){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidOutInt(callback : voidOutIntCallback){ - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_2000 called'); - var number = 123; - callback(SUCCESS, number); - } - - voidOutString(callback : voidOutStringCallback){ - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_2000 called'); - var string = "voidOutString"; - callback(SUCCESS, string); - } - - voidInOutInt(number, callback: voidInOutIntCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_2100_1 called:'+ JSON.stringify(number)); - var num = 456789; - if(number == 123456){ - callback(SUCCESS, num); - }else{ - callback(FAIL, number); - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_2100_1 Call_Fail') - } - } - voidInOutString(strinput, callback: voidInOutStringCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_2100_2 called:'+ JSON.stringify(strinput)); - var str = "456789"; - if(strinput == "voidInOutString"){ - callback(SUCCESS, str); - }else{ - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_2100_2 Call_Fail'); - callback(FAIL, strinput); - } - } - - voidParameterTypeBoolean(oBooleanTrue, callback : voidParameterTypeBooleanCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_2200 called:'+ JSON.stringify(oBooleanTrue)); - if(oBooleanTrue == true){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidParameterTypeByte(number, callback : voidParameterTypeByteCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_2300 called:'+ JSON.stringify(number)); - if(number == 1111){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidParameterTypeShort(number, callback : voidParameterTypeShortCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_2400 called:'+ JSON.stringify(number)); - if(number == 2222){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidParameterTypeInt(number, callback : voidParameterTypeIntCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_2500 called:'+ JSON.stringify(number)); - if(number == 3333){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidParameterTypeLong(number, callback : voidParameterTypeLongCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_2600 called:'+ JSON.stringify(number)); - if(number == 4444){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidParameterTypeFloat(number, callback : voidParameterTypeFloatCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_2700 called:'+ JSON.stringify(number)); - if(number == 5555.1){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidParameterTypeDouble(number, callback : voidParameterTypeDoubleCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_2800 called:'+ JSON.stringify(number)); - if(number == 6666.1){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidParameterTypeString(string, callback : voidParameterTypeStringCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_2900 called:'+ JSON.stringify(string)); - if(string == "voidParameterTypeString"){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidParameterTypeSequenceable(MySequenceable, callback : voidParameterTypeSequenceableCallback) { - console.log('ZidlTest Process Server ACTS_Zidl_Js2JsMulti_3000 called:'+ JSON.stringify(MySequenceable)); - if((MySequenceable != null) && (MySequenceable.getNum() == 32) && (MySequenceable.getString() == "nihao")){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidParameterTypeInterface(param: InterfaceDeclareProxy, callback : voidParameterTypeInterfaceCallback) { - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_3100 called"); - let proxy = new InterfaceDeclareProxy(param); - proxy.testInterface(3300, (errCode)=>{ - if (errCode == SUCCESS) { - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_3100 callback SUCCESS"); - callback(SUCCESS); - } else { - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_3100 callback FAIL"); - callback(FAIL); - } - }); - - } - - voidParameterTypeMapStringString(map, callback : voidParameterTypeMapStringStringCallback) { - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_3200 called:'+ map.get("voidParameterTypeMapStringString")); - if(map.get("voidParameterTypeMapStringString") == "fdhatdh"){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidParameterTypeDoubleArray(array, callback : voidParameterTypeDoubleArrayCallback){ - console.log('ZidlTest Server ACTS_Zidl_Js2JsMulti_3300 called:'+ JSON.stringify(array)); - if(array.length == 2 && array[0] == 1.1 && array[1] == 2.1){ - callback(SUCCESS); - }else{ - callback(FAIL); - } - } - - voidOrderOutIn(paramI, callback: voidOrderOutInCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_3400 called" + paramI); - var mystring = "hello world"; - callback(SUCCESS, mystring); - } - - voidOrderInOutIn(paramI, paramS, callback: voidOrderInOutInCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_3500 called" + paramI + " " + paramS); - var mynumber = 6; - callback(SUCCESS, mynumber); - } - - voidOrderOutInOut(paramS, callback: voidOrderOutInOutCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_3600 called" + paramS); - var mynumber = 3; - var mystring = "paramcallback"; - callback(SUCCESS, mynumber, mystring); - } - - voidOrderInInOutOut(paramS, paramI, callback: voidOrderInInOutOutCallback){ - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_3700 called" + paramS + " " + paramI); - var mystring = "callback"; - var mynumber = 4; - callback(SUCCESS, mynumber, mystring); - } -} - -export default class ServiceAbility extends ServiceExtension { - onCreate(want: Want) { - globalThis.abilityWant = want; - console.log('ZidlService ServiceAbility onCreate, want: ' + want.abilityName); - } - - onRequest(want, startId) { - console.log('ZidlService ServiceAbility onRequest, want: ' + want.abilityName - + ', startId: ' + startId); - } - - onConnect(want) { - console.log('ZidlService ServiceAbility onConnect, want:' + want.abilityName); - return new ZidlTestImp('connect'); - } - - onDisconnect(want) { - console.log('ZidlService ServiceAbility onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('AZidlService ServiceAbility onDestroy'); - } -}; diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts deleted file mode 100644 index a9469ce4d7e1d4fbd3ec452076ab8121b8b8adf7..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/i_interface_declare.ts +++ /dev/null @@ -1,21 +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. - */ - - -export default interface IInterfaceDeclare { - testInterface(data: number, callback: testInterfaceCallback): void; -} -export type testInterfaceCallback = (errCode: number) => void; - diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts deleted file mode 100644 index 9f9cc9c43d3b15599f88aa223e7308c43b997e60..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_proxy.ts +++ /dev/null @@ -1,44 +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 {testInterfaceCallback} from "./i_interface_declare"; -import IInterfaceDeclare from "./i_interface_declare"; -import rpc from "@ohos.rpc"; - -export default class InterfaceDeclareProxy implements IInterfaceDeclare { - constructor(proxy) { - this.proxy = proxy; - } - - testInterface(data: number, callback: testInterfaceCallback): void - { - let _option = new rpc.MessageOption(rpc.MessageOption.TF_SYNC); - let _data = new rpc.MessageParcel(); - let _reply = new rpc.MessageParcel(); - _data.writeInt(data); - this.proxy.sendRequest(InterfaceDeclareProxy.COMMAND_TEST_INTERFACE, _data, _reply, _option).then(function(result) { - if (result.errCode === 0) { - let _errCode = result.reply.readInt(); - callback(_errCode); - } else { - console.log("sendRequest failed, errCode: " + result.errCode); - } - }) - } - - static readonly COMMAND_TEST_INTERFACE = 1; - private proxy -} - diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts deleted file mode 100644 index 1606f77b4c0390be639f06cb093ee672cf05d478..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/interfaceDeclare/interface_declare_stub.ts +++ /dev/null @@ -1,47 +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 {testInterfaceCallback} from "./i_interface_declare"; -import IInterfaceDeclare from "./i_interface_declare"; -import rpc from "@ohos.rpc"; - -export default class InterfaceDeclareStub extends rpc.RemoteObject implements IInterfaceDeclare { - constructor(des: string) { - super(des); - } - - onRemoteRequest(code: number, data, reply, option): boolean { - console.log("onRemoteRequest called, code = " + code); - switch(code) { - case InterfaceDeclareStub.COMMAND_TEST_INTERFACE: { - let _data = data.readInt(); - this.testInterface(_data, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - default: { - console.log("invalid request code" + code); - break; - } - } - return false; - } - - testInterface(data: number, callback: testInterfaceCallback): void{} - - static readonly COMMAND_TEST_INTERFACE = 1; -} - diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/service.ts deleted file mode 100644 index b49731a414958a281c2f0c4eab0e7fb408eb2c2f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/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/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/i_zidl_tool_test.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/i_zidl_tool_test.ts deleted file mode 100644 index ac9da635209b8b8a170f587485ab01a1e9844fcb..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/i_zidl_tool_test.ts +++ /dev/null @@ -1,105 +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 MySequenceable from "./my_sequenceable"; -import IInterfaceDeclare from "../interfaceDeclare/i_interface_declare"; - -export default interface IZidlToolTest { - onewayVoidVoid(callback: onewayVoidVoidCallback): void; - voidVoid(callback: voidVoidCallback): void; - booleanVoid(callback: booleanVoidCallback): void; - byteVoid(callback: byteVoidCallback): void; - shortVoid(callback: shortVoidCallback): void; - intVoid(callback: intVoidCallback): void; - longVoid(callback: longVoidCallback): void; - floatVoid(callback: floatVoidCallback): void; - doubleVoid(callback: doubleVoidCallback): void; - stringVoid(callback: stringVoidCallback): void; - sequenceableVoid(callback: sequenceableVoidCallback): void; - interfaceVoid(callback: interfaceVoidCallback): void; - mapStringStringVoid(callback: mapStringStringVoidCallback): void; - doubleArrayVoid(callback: doubleArrayVoidCallback): void; - voidInMapStringInt(param: Map, callback: voidInMapStringIntCallback): void; - voidInStringArray(param: string[], callback: voidInStringArrayCallback): void; - voidOutMapStringInt(callback: voidOutMapStringIntCallback): void; - voidOutStringArray(callback: voidOutStringArrayCallback): void; - voidInOutMapStringInt(param: Map, callback: voidInOutMapStringIntCallback): void; - voidInOutStringArray(param: string[], callback: voidInOutStringArrayCallback): void; - voidInInt(param: number, callback: voidInIntCallback): void; - voidInString(param: string, callback: voidInStringCallback): void; - voidOutInt(callback: voidOutIntCallback): void; - voidOutString(callback: voidOutStringCallback): void; - voidInOutInt(param: number, callback: voidInOutIntCallback): void; - voidInOutString(param: string, callback: voidInOutStringCallback): void; - voidParameterTypeBoolean(param: boolean, callback: voidParameterTypeBooleanCallback): void; - voidParameterTypeByte(param: number, callback: voidParameterTypeByteCallback): void; - voidParameterTypeShort(param: number, callback: voidParameterTypeShortCallback): void; - voidParameterTypeInt(param: number, callback: voidParameterTypeIntCallback): void; - voidParameterTypeLong(param: number, callback: voidParameterTypeLongCallback): void; - voidParameterTypeFloat(param: number, callback: voidParameterTypeFloatCallback): void; - voidParameterTypeDouble(param: number, callback: voidParameterTypeDoubleCallback): void; - voidParameterTypeString(param: string, callback: voidParameterTypeStringCallback): void; - voidParameterTypeSequenceable(param: MySequenceable, callback: voidParameterTypeSequenceableCallback): void; - voidParameterTypeInterface(param: IInterfaceDeclare, callback: voidParameterTypeInterfaceCallback): void; - voidParameterTypeMapStringString(param: Map, callback: voidParameterTypeMapStringStringCallback): void; - voidParameterTypeDoubleArray(param: number[], callback: voidParameterTypeDoubleArrayCallback): void; - voidOrderOutIn(paramI: number, callback: voidOrderOutInCallback): void; - voidOrderInOutIn(paramI: number, paramS: string, callback: voidOrderInOutInCallback): void; - voidOrderOutInOut(paramS: string, callback: voidOrderOutInOutCallback): void; - voidOrderInInOutOut(paramS: string, paramI: number, callback: voidOrderInInOutOutCallback): void; -} -export type onewayVoidVoidCallback = (errCode: number) => void; -export type voidVoidCallback = (errCode: number) => void; -export type booleanVoidCallback = (errCode: number, returnValue: boolean) => void; -export type byteVoidCallback = (errCode: number, returnValue: number) => void; -export type shortVoidCallback = (errCode: number, returnValue: number) => void; -export type intVoidCallback = (errCode: number, returnValue: number) => void; -export type longVoidCallback = (errCode: number, returnValue: number) => void; -export type floatVoidCallback = (errCode: number, returnValue: number) => void; -export type doubleVoidCallback = (errCode: number, returnValue: number) => void; -export type stringVoidCallback = (errCode: number, returnValue: string) => void; -export type sequenceableVoidCallback = (errCode: number, returnValue: MySequenceable) => void; -export type interfaceVoidCallback = (errCode: number, returnValue: IInterfaceDeclare) => void; -export type mapStringStringVoidCallback = (errCode: number, returnValue: Map) => void; -export type doubleArrayVoidCallback = (errCode: number, returnValue: number[]) => void; -export type voidInMapStringIntCallback = (errCode: number) => void; -export type voidInStringArrayCallback = (errCode: number) => void; -export type voidOutMapStringIntCallback = (errCode: number, param: Map) => void; -export type voidOutStringArrayCallback = (errCode: number, param: string[]) => void; -export type voidInOutMapStringIntCallback = (errCode: number, param: Map) => void; -export type voidInOutStringArrayCallback = (errCode: number, param: string[]) => void; -export type voidInIntCallback = (errCode: number) => void; -export type voidInStringCallback = (errCode: number) => void; -export type voidOutIntCallback = (errCode: number, param: number) => void; -export type voidOutStringCallback = (errCode: number, param: string) => void; -export type voidInOutIntCallback = (errCode: number, param: number) => void; -export type voidInOutStringCallback = (errCode: number, param: string) => void; -export type voidParameterTypeBooleanCallback = (errCode: number) => void; -export type voidParameterTypeByteCallback = (errCode: number) => void; -export type voidParameterTypeShortCallback = (errCode: number) => void; -export type voidParameterTypeIntCallback = (errCode: number) => void; -export type voidParameterTypeLongCallback = (errCode: number) => void; -export type voidParameterTypeFloatCallback = (errCode: number) => void; -export type voidParameterTypeDoubleCallback = (errCode: number) => void; -export type voidParameterTypeStringCallback = (errCode: number) => void; -export type voidParameterTypeSequenceableCallback = (errCode: number) => void; -export type voidParameterTypeInterfaceCallback = (errCode: number) => void; -export type voidParameterTypeMapStringStringCallback = (errCode: number) => void; -export type voidParameterTypeDoubleArrayCallback = (errCode: number) => void; -export type voidOrderOutInCallback = (errCode: number, paramS: string) => void; -export type voidOrderInOutInCallback = (errCode: number, paramI: number) => void; -export type voidOrderOutInOutCallback = (errCode: number, paramI: number, paramS: string) => void; -export type voidOrderInInOutOutCallback = (errCode: number, paramI: number, paramS2: string) => void; - diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts deleted file mode 100644 index bef9dcbe25c82b2c96e8ac8cc6493ce3d080baf6..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/my_sequenceable.ts +++ /dev/null @@ -1,28 +0,0 @@ -export default class MySequenceable { - constructor() { - this.num = 14; - this.str = "hello"; - } - getNum() : number { - return this.num; - } - - getString() : string { - return this.str; - } - - marshalling(messageParcel) { - console.info('marshalling++++'); - messageParcel.writeInt(this.num); - messageParcel.writeString(this.str); - return true; - } - unmarshalling(messageParcel) { - console.info('unmarshalling++++'); - this.num = messageParcel.readInt(); - this.str = messageParcel.readString(); - return true; - } - private num; - private str; -} \ No newline at end of file diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/zidl_tool_test_stub.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/zidl_tool_test_stub.ts deleted file mode 100644 index 466bc3d6040a0b3c01ca401b05d96dc1a55cacb9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility/zidlTool/zidl_tool_test_stub.ts +++ /dev/null @@ -1,549 +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 {onewayVoidVoidCallback} from "./i_zidl_tool_test"; -import {voidVoidCallback} from "./i_zidl_tool_test"; -import {booleanVoidCallback} from "./i_zidl_tool_test"; -import {byteVoidCallback} from "./i_zidl_tool_test"; -import {shortVoidCallback} from "./i_zidl_tool_test"; -import {intVoidCallback} from "./i_zidl_tool_test"; -import {longVoidCallback} from "./i_zidl_tool_test"; -import {floatVoidCallback} from "./i_zidl_tool_test"; -import {doubleVoidCallback} from "./i_zidl_tool_test"; -import {stringVoidCallback} from "./i_zidl_tool_test"; -import {sequenceableVoidCallback} from "./i_zidl_tool_test"; -import {interfaceVoidCallback} from "./i_zidl_tool_test"; -import {mapStringStringVoidCallback} from "./i_zidl_tool_test"; -import {doubleArrayVoidCallback} from "./i_zidl_tool_test"; -import {voidInMapStringIntCallback} from "./i_zidl_tool_test"; -import {voidInStringArrayCallback} from "./i_zidl_tool_test"; -import {voidOutMapStringIntCallback} from "./i_zidl_tool_test"; -import {voidOutStringArrayCallback} from "./i_zidl_tool_test"; -import {voidInOutMapStringIntCallback} from "./i_zidl_tool_test"; -import {voidInOutStringArrayCallback} from "./i_zidl_tool_test"; -import {voidInIntCallback} from "./i_zidl_tool_test"; -import {voidInStringCallback} from "./i_zidl_tool_test"; -import {voidOutIntCallback} from "./i_zidl_tool_test"; -import {voidOutStringCallback} from "./i_zidl_tool_test"; -import {voidInOutIntCallback} from "./i_zidl_tool_test"; -import {voidInOutStringCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeBooleanCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeByteCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeShortCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeIntCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeLongCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeFloatCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeDoubleCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeStringCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeSequenceableCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeInterfaceCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeMapStringStringCallback} from "./i_zidl_tool_test"; -import {voidParameterTypeDoubleArrayCallback} from "./i_zidl_tool_test"; -import {voidOrderOutInCallback} from "./i_zidl_tool_test"; -import {voidOrderInOutInCallback} from "./i_zidl_tool_test"; -import {voidOrderOutInOutCallback} from "./i_zidl_tool_test"; -import {voidOrderInInOutOutCallback} from "./i_zidl_tool_test"; -import IZidlToolTest from "./i_zidl_tool_test"; -import rpc from "@ohos.rpc"; -import MySequenceable from "./my_sequenceable"; -import IInterfaceDeclare from "../interfaceDeclare/i_interface_declare"; -import InterfaceDeclareStub from "../interfaceDeclare/interface_declare_stub"; - -export default class ZidlToolTestStub extends rpc.RemoteObject implements IZidlToolTest { - constructor(des: string) { - super(des); - } - - onRemoteRequest(code: number, data, reply, option): boolean { - console.log("onRemoteRequest called, code = " + code); - switch(code) { - case ZidlToolTestStub.COMMAND_ONEWAY_VOID_VOID: { - this.onewayVoidVoid((errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_VOID: { - this.voidVoid((errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_BOOLEAN_VOID: { - this.booleanVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(returnValue ? 1 : 0); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_BYTE_VOID: { - this.byteVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(returnValue); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_SHORT_VOID: { - this.shortVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(returnValue); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_INT_VOID: { - this.intVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(returnValue); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_LONG_VOID: { - this.longVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeLong(returnValue); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_FLOAT_VOID: { - this.floatVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeFloat(returnValue); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_DOUBLE_VOID: { - this.doubleVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeDouble(returnValue); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_STRING_VOID: { - this.stringVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeString(returnValue); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_SEQUENCEABLE_VOID: { - this.sequenceableVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeSequenceable(returnValue); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_INTERFACE_VOID: { - this.interfaceVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeRemoteObject(returnValue as InterfaceDeclareStub); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_MAP_STRING_STRING_VOID: { - this.mapStringStringVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(returnValue.size); - for (let [key, value] of returnValue) { - reply.writeString(key); - reply.writeString(value); - } - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_DOUBLE_ARRAY_VOID: { - this.doubleArrayVoid((errCode, returnValue) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeDoubleArray(returnValue); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_IN_MAP_STRING_INT: { - let _param = new Map(); - let _paramSize = data.readInt(); - for (let i = 0; i < _paramSize; ++i) { - let key = data.readString(); - let value = data.readInt(); - _param.set(key, value); - } - this.voidInMapStringInt(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_IN_STRING_ARRAY: { - let _param = data.readStringArray(); - this.voidInStringArray(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_OUT_MAP_STRING_INT: { - this.voidOutMapStringInt((errCode, param) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(param.size); - for (let [key, value] of param) { - reply.writeString(key); - reply.writeInt(value); - } - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_OUT_STRING_ARRAY: { - this.voidOutStringArray((errCode, param) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeStringArray(param); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_IN_OUT_MAP_STRING_INT: { - let _param = new Map(); - let _paramSize = data.readInt(); - for (let i = 0; i < _paramSize; ++i) { - let key = data.readString(); - let value = data.readInt(); - _param.set(key, value); - } - this.voidInOutMapStringInt(_param, (errCode, param) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(param.size); - for (let [key, value] of param) { - reply.writeString(key); - reply.writeInt(value); - } - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_IN_OUT_STRING_ARRAY: { - let _param = data.readStringArray(); - this.voidInOutStringArray(_param, (errCode, param) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeStringArray(param); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_IN_INT: { - let _param = data.readInt(); - this.voidInInt(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_IN_STRING: { - let _param = data.readString(); - this.voidInString(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_OUT_INT: { - this.voidOutInt((errCode, param) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(param); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_OUT_STRING: { - this.voidOutString((errCode, param) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeString(param); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_IN_OUT_INT: { - let _param = data.readInt(); - this.voidInOutInt(_param, (errCode, param) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(param); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_IN_OUT_STRING: { - let _param = data.readString(); - this.voidInOutString(_param, (errCode, param) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeString(param); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_BOOLEAN: { - let _param = data.readInt() == 1 ? true : false; - this.voidParameterTypeBoolean(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_BYTE: { - let _param = data.readInt(); - this.voidParameterTypeByte(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_SHORT: { - let _param = data.readInt(); - this.voidParameterTypeShort(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_INT: { - let _param = data.readInt(); - this.voidParameterTypeInt(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_LONG: { - let _param = data.readLong(); - this.voidParameterTypeLong(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_FLOAT: { - let _param = data.readFloat(); - this.voidParameterTypeFloat(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_DOUBLE: { - let _param = data.readDouble(); - this.voidParameterTypeDouble(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_STRING: { - let _param = data.readString(); - this.voidParameterTypeString(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_SEQUENCEABLE: { - let _param = new MySequenceable(); - data.readSequenceable(_param); - this.voidParameterTypeSequenceable(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_INTERFACE: { - let _param = data.readRemoteObject(); - this.voidParameterTypeInterface(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_MAP_STRING_STRING: { - let _param = new Map(); - let _paramSize = data.readInt(); - for (let i = 0; i < _paramSize; ++i) { - let key = data.readString(); - let value = data.readString(); - _param.set(key, value); - } - this.voidParameterTypeMapStringString(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_PARAMETER_TYPE_DOUBLE_ARRAY: { - let _param = data.readDoubleArray(); - this.voidParameterTypeDoubleArray(_param, (errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_ORDER_OUT_IN: { - let _paramI = data.readInt(); - this.voidOrderOutIn(_paramI, (errCode, paramS) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeString(paramS); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_ORDER_IN_OUT_IN: { - let _paramI = data.readInt(); - let _paramS = data.readString(); - this.voidOrderInOutIn(_paramI, _paramS, (errCode, paramI) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(paramI); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_ORDER_OUT_IN_OUT: { - let _paramS = data.readString(); - this.voidOrderOutInOut(_paramS, (errCode, paramI, paramS) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(paramI); - reply.writeString(paramS); - } - }); - return true; - } - case ZidlToolTestStub.COMMAND_VOID_ORDER_IN_IN_OUT_OUT: { - let _paramS = data.readString(); - let _paramI = data.readInt(); - this.voidOrderInInOutOut(_paramS, _paramI, (errCode, paramI, paramS2) => { - reply.writeInt(errCode); - if (errCode == 0) { - reply.writeInt(paramI); - reply.writeString(paramS2); - } - }); - return true; - } - default: { - console.log("invalid request code" + code); - break; - } - } - return false; - } - - onewayVoidVoid(callback: onewayVoidVoidCallback): void{} - voidVoid(callback: voidVoidCallback): void{} - booleanVoid(callback: booleanVoidCallback): void{} - byteVoid(callback: byteVoidCallback): void{} - shortVoid(callback: shortVoidCallback): void{} - intVoid(callback: intVoidCallback): void{} - longVoid(callback: longVoidCallback): void{} - floatVoid(callback: floatVoidCallback): void{} - doubleVoid(callback: doubleVoidCallback): void{} - stringVoid(callback: stringVoidCallback): void{} - sequenceableVoid(callback: sequenceableVoidCallback): void{} - interfaceVoid(callback: interfaceVoidCallback): void{} - mapStringStringVoid(callback: mapStringStringVoidCallback): void{} - doubleArrayVoid(callback: doubleArrayVoidCallback): void{} - voidInMapStringInt(param: Map, callback: voidInMapStringIntCallback): void{} - voidInStringArray(param: string[], callback: voidInStringArrayCallback): void{} - voidOutMapStringInt(callback: voidOutMapStringIntCallback): void{} - voidOutStringArray(callback: voidOutStringArrayCallback): void{} - voidInOutMapStringInt(param: Map, callback: voidInOutMapStringIntCallback): void{} - voidInOutStringArray(param: string[], callback: voidInOutStringArrayCallback): void{} - voidInInt(param: number, callback: voidInIntCallback): void{} - voidInString(param: string, callback: voidInStringCallback): void{} - voidOutInt(callback: voidOutIntCallback): void{} - voidOutString(callback: voidOutStringCallback): void{} - voidInOutInt(param: number, callback: voidInOutIntCallback): void{} - voidInOutString(param: string, callback: voidInOutStringCallback): void{} - voidParameterTypeBoolean(param: boolean, callback: voidParameterTypeBooleanCallback): void{} - voidParameterTypeByte(param: number, callback: voidParameterTypeByteCallback): void{} - voidParameterTypeShort(param: number, callback: voidParameterTypeShortCallback): void{} - voidParameterTypeInt(param: number, callback: voidParameterTypeIntCallback): void{} - voidParameterTypeLong(param: number, callback: voidParameterTypeLongCallback): void{} - voidParameterTypeFloat(param: number, callback: voidParameterTypeFloatCallback): void{} - voidParameterTypeDouble(param: number, callback: voidParameterTypeDoubleCallback): void{} - voidParameterTypeString(param: string, callback: voidParameterTypeStringCallback): void{} - voidParameterTypeSequenceable(param: MySequenceable, callback: voidParameterTypeSequenceableCallback): void{} - voidParameterTypeInterface(param: IInterfaceDeclare, callback: voidParameterTypeInterfaceCallback): void{} - voidParameterTypeMapStringString(param: Map, callback: voidParameterTypeMapStringStringCallback): void{} - voidParameterTypeDoubleArray(param: number[], callback: voidParameterTypeDoubleArrayCallback): void{} - voidOrderOutIn(paramI: number, callback: voidOrderOutInCallback): void{} - voidOrderInOutIn(paramI: number, paramS: string, callback: voidOrderInOutInCallback): void{} - voidOrderOutInOut(paramS: string, callback: voidOrderOutInOutCallback): void{} - voidOrderInInOutOut(paramS: string, paramI: number, callback: voidOrderInInOutOutCallback): void{} - - static readonly COMMAND_ONEWAY_VOID_VOID = 1; - static readonly COMMAND_VOID_VOID = 2; - static readonly COMMAND_BOOLEAN_VOID = 3; - static readonly COMMAND_BYTE_VOID = 4; - static readonly COMMAND_SHORT_VOID = 5; - static readonly COMMAND_INT_VOID = 6; - static readonly COMMAND_LONG_VOID = 7; - static readonly COMMAND_FLOAT_VOID = 8; - static readonly COMMAND_DOUBLE_VOID = 9; - static readonly COMMAND_STRING_VOID = 10; - static readonly COMMAND_SEQUENCEABLE_VOID = 11; - static readonly COMMAND_INTERFACE_VOID = 12; - static readonly COMMAND_MAP_STRING_STRING_VOID = 13; - static readonly COMMAND_DOUBLE_ARRAY_VOID = 14; - static readonly COMMAND_VOID_IN_MAP_STRING_INT = 15; - static readonly COMMAND_VOID_IN_STRING_ARRAY = 16; - static readonly COMMAND_VOID_OUT_MAP_STRING_INT = 17; - static readonly COMMAND_VOID_OUT_STRING_ARRAY = 18; - static readonly COMMAND_VOID_IN_OUT_MAP_STRING_INT = 19; - static readonly COMMAND_VOID_IN_OUT_STRING_ARRAY = 20; - static readonly COMMAND_VOID_IN_INT = 21; - static readonly COMMAND_VOID_IN_STRING = 22; - static readonly COMMAND_VOID_OUT_INT = 23; - static readonly COMMAND_VOID_OUT_STRING = 24; - static readonly COMMAND_VOID_IN_OUT_INT = 25; - static readonly COMMAND_VOID_IN_OUT_STRING = 26; - static readonly COMMAND_VOID_PARAMETER_TYPE_BOOLEAN = 27; - static readonly COMMAND_VOID_PARAMETER_TYPE_BYTE = 28; - static readonly COMMAND_VOID_PARAMETER_TYPE_SHORT = 29; - static readonly COMMAND_VOID_PARAMETER_TYPE_INT = 30; - static readonly COMMAND_VOID_PARAMETER_TYPE_LONG = 31; - static readonly COMMAND_VOID_PARAMETER_TYPE_FLOAT = 32; - static readonly COMMAND_VOID_PARAMETER_TYPE_DOUBLE = 33; - static readonly COMMAND_VOID_PARAMETER_TYPE_STRING = 34; - static readonly COMMAND_VOID_PARAMETER_TYPE_SEQUENCEABLE = 35; - static readonly COMMAND_VOID_PARAMETER_TYPE_INTERFACE = 36; - static readonly COMMAND_VOID_PARAMETER_TYPE_MAP_STRING_STRING = 37; - static readonly COMMAND_VOID_PARAMETER_TYPE_DOUBLE_ARRAY = 38; - static readonly COMMAND_VOID_ORDER_OUT_IN = 39; - static readonly COMMAND_VOID_ORDER_IN_OUT_IN = 40; - static readonly COMMAND_VOID_ORDER_OUT_IN_OUT = 41; - static readonly COMMAND_VOID_ORDER_IN_IN_OUT_OUT = 42; -} - diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts deleted file mode 100644 index 77d68a9d282f8f10b04cf8605f63c41f8165243e..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts +++ /dev/null @@ -1,65 +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 Want from '@ohos.application.Want'; -import ZidlTestServiceStubOneway from './zidlToolOneWay/interface_attribute_declaratoin_oneway_stub'; -import {voidVoidFirstCallback} from './zidlToolOneWay/i_interface_attribute_declaratoin_oneway' -import {voidVoidSecondCallback} from './zidlToolOneWay/i_interface_attribute_declaratoin_oneway' -import {voidVoidThirdCallback} from './zidlToolOneWay/i_interface_attribute_declaratoin_oneway' - -const SUCCESS = 0; -const FAIL = 1; - -class ZidlTestImpOneway extends ZidlTestServiceStubOneway { - voidVoidFirst(callback: voidVoidFirstCallback) { - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_0100_1 called"); - callback(SUCCESS); - } - - voidVoidSecond(callback: voidVoidSecondCallback) { - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_0100_2 called"); - callback(SUCCESS); - } - - voidVoidThird(callback: voidVoidThirdCallback) { - console.log("ZidlTest Server ACTS_Zidl_Js2JsMulti_0100_3 called"); - callback(SUCCESS); - } -} - -export default class ServiceAbility2 extends ServiceExtension { - onCreate(want: Want) { - globalThis.abilityWant = want; - console.log('ZidlService ServiceAbility2 onCreate, want: ' + want.abilityName); - } - - onRequest(want, startId) { - console.log('ZidlService ServiceAbility2 onRequest, want: ' + want.abilityName - + ', startId: ' + startId); - } - - onConnect(want) { - console.log('ZidlService ServiceAbility2 onConnect, want:' + want.abilityName); - return new ZidlTestImpOneway('connect'); - } - - onDisconnect(want) { - console.log('ZidlService ServiceAbility2 onDisconnect, want:' + want.abilityName); - } - - onDestroy() { - console.log('AZidlService ServiceAbility2 onDestroy'); - } -}; diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/service.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/service.ts deleted file mode 100644 index b49731a414958a281c2f0c4eab0e7fb408eb2c2f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/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/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts deleted file mode 100644 index a17db0f5d20ac1d674258b1e094355c2276fc2b4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/i_interface_attribute_declaratoin_oneway.ts +++ /dev/null @@ -1,25 +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. - */ - - -export default interface IInterfaceAttributeDeclaratoinOneway { - voidVoidFirst(callback: voidVoidFirstCallback): void; - voidVoidSecond(callback: voidVoidSecondCallback): void; - voidVoidThird(callback: voidVoidThirdCallback): void; -} -export type voidVoidFirstCallback = (errCode: number) => void; -export type voidVoidSecondCallback = (errCode: number) => void; -export type voidVoidThirdCallback = (errCode: number) => void; - diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts deleted file mode 100644 index 016f352bd6d609916ad6e3b12e63e075a6fbe490..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/ServiceAbility2/zidlToolOneWay/interface_attribute_declaratoin_oneway_stub.ts +++ /dev/null @@ -1,64 +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 {voidVoidFirstCallback} from "./i_interface_attribute_declaratoin_oneway"; -import {voidVoidSecondCallback} from "./i_interface_attribute_declaratoin_oneway"; -import {voidVoidThirdCallback} from "./i_interface_attribute_declaratoin_oneway"; -import IInterfaceAttributeDeclaratoinOneway from "./i_interface_attribute_declaratoin_oneway"; -import rpc from "@ohos.rpc"; - -export default class InterfaceAttributeDeclaratoinOnewayStub extends rpc.RemoteObject implements IInterfaceAttributeDeclaratoinOneway { - constructor(des: string) { - super(des); - } - - onRemoteRequest(code: number, data, reply, option): boolean { - console.log("onRemoteRequest called, code = " + code); - switch(code) { - case InterfaceAttributeDeclaratoinOnewayStub.COMMAND_VOID_VOID_FIRST: { - this.voidVoidFirst((errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case InterfaceAttributeDeclaratoinOnewayStub.COMMAND_VOID_VOID_SECOND: { - this.voidVoidSecond((errCode) => { - reply.writeInt(errCode); - }); - return true; - } - case InterfaceAttributeDeclaratoinOnewayStub.COMMAND_VOID_VOID_THIRD: { - this.voidVoidThird((errCode) => { - reply.writeInt(errCode); - }); - return true; - } - default: { - console.log("invalid request code" + code); - break; - } - } - return false; - } - - voidVoidFirst(callback: voidVoidFirstCallback): void{} - voidVoidSecond(callback: voidVoidSecondCallback): void{} - voidVoidThird(callback: voidVoidThirdCallback): void{} - - static readonly COMMAND_VOID_VOID_FIRST = 1; - static readonly COMMAND_VOID_VOID_SECOND = 2; - static readonly COMMAND_VOID_VOID_THIRD = 3; -} - diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/pages/index/index.ets deleted file mode 100644 index 16e1531e48430510168d31c9f8d8c595c3b62ab9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/pages/index/index.ets +++ /dev/null @@ -1,37 +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'; - -@Entry -@Component -struct Index { - - aboutToAppear() { - console.info("start run testcase!!!!") - } - - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('pmsystemappa') - .fontSize(50) - .fontWeight(FontWeight.Bold) - .margin({ - top: 20 - }) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/ets/pages/second/second.ets deleted file mode 100644 index 2c768edb999b1b54fef3268922817734b1f1c954..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/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/zidltest/actsamszidlservice/entry/src/main/module.json b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/module.json deleted file mode 100644 index e2a0798375b37b856f0b63216617c18fc24ad983..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/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": [ - "default", - "tablet" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.zidlservice.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.zidlservice.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - }, - { - "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", - "name": "com.example.zidlservice.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/zidltest/actsamszidlservice/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/resources/base/element/string.json deleted file mode 100644 index d75325f3cf0a50c1dfe4dbc5162c8737276c3dd9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/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/zidltest/actsamszidlservice/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 6898b31d2085f478ee1ed9d933a5910cbf901d92..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/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/zidltest/actsamszidlservice/signature/openharmony_sx.p7b b/ability/ability_runtime/zidltest/actsamszidlservice/signature/openharmony_sx.p7b deleted file mode 100755 index 1111250997325e43b38523c176b0870b62e584b0..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/zidltest/actsamszidlservice/signature/openharmony_sx.p7b and /dev/null differ