diff --git a/ability/ability_runtime/BUILD.gn b/ability/ability_runtime/BUILD.gn index d9de82cbbc37c89053fe0de9c0c6ad07ed7195f6..3d5a3725727c494feb01c16d36f14f6c0bd17eec 100644 --- a/ability/ability_runtime/BUILD.gn +++ b/ability/ability_runtime/BUILD.gn @@ -25,7 +25,6 @@ group("ability_runtime") { "actscalltest:actscalltest", "actsfwkdataaccessortest:dataability", "actsserviceabilityclienttest:serviceability", - "actsstartcomponenttest:actsstartcomponenttest", "actsstserviceabilityclientcase:ActsStServiceAbilityClientCaseTest", "actsusers:actsusers", "amscontextualinforquery:amscontextualinforquery", @@ -43,8 +42,6 @@ group("ability_runtime") { "processmultiinstance:processmultiinstance", "stage:stage", "want:want", - - #"zidltest:zidltest", ] } } diff --git a/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets index 7b8c0055ab5d9492f7dd370eafea98646cf3861f..d7c7f45734ec4337f85fe951642451a05aec5e7b 100644 --- a/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/actscalltest/systemcallentrytest/entry/src/main/ets/test/Ability.test.ets @@ -95,6 +95,10 @@ function getMissionId(abilityName, state) { }) } +function sleep(time) { + return new Promise((resolve)=>setTimeout(resolve,time)); +} + function delay(time) { let delta; if (typeof time != 'number' || time <= 0) { @@ -1767,6 +1771,7 @@ export default function abilityTest(abilityContext) { done(); } } + await sleep(1000); await globalThis.abilityContext.startAbility(want, startAbilityCallback); diff --git a/ability/ability_runtime/actsstartcomponenttest/BUILD.gn b/ability/ability_runtime/actsstartcomponenttest/BUILD.gn deleted file mode 100644 index bbb5260599f35b47a90d89bdbdc4e563e640e21d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/BUILD.gn +++ /dev/null @@ -1,27 +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("//build/ohos_var.gni") - -group("actsstartcomponenttest") { - testonly = true - if (is_standard_system) { - deps = [ - "SpecifiedUserActionExtension_100:ActsSpecifiedUserActionextensionZeroTest", - "SpecifiedUserActionExtension_101:ActsSpecifiedUserActionextensiononeTest", - - # "SpecifiedUserAction_100:ActsSpecifiedUserActionZeroTest", - # "SpecifiedUserAction_101:ActsSpecifiedUserActiononeTest", - ] - } -} diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/app.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/app.json deleted file mode 100644 index 092fe3b37ef3530c83d2dcdbb79a22f1bedeae1c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsspecifieduseractionextensionzerotest", - "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/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/resources/base/element/string.json deleted file mode 100644 index be09cccde1bc7369ef47a5cd45d2b06884c88602..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/BUILD.gn b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/BUILD.gn deleted file mode 100644 index cf7ceec227311a4c121c2ebec6c43ac031ec2f15..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/BUILD.gn +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsSpecifiedUserActionextensionZeroTest") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":actsspecifieduseractionextensionzerotest_js_assets", - ":actsspecifieduseractionextensionzerotest_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsSpecifiedUserActionextensionZeroTest" -} - -ohos_app_scope("actsspecifieduseractionextensionzerotest_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actsspecifieduseractionextensionzerotest_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("actsspecifieduseractionextensionzerotest_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":actsspecifieduseractionextensionzerotest_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/Test.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/Test.json deleted file mode 100644 index febfcbe0a8e08d09c19e7788f5f8c70ffe237b9e..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/Test.json +++ /dev/null @@ -1,49 +0,0 @@ - -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "120000", - "package": "com.example.actsspecifieduseractionextensionzerotest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsSpecifiedUserActionextensionZeroTest.hap", - "ActsSpecifiedUserActionextensiononeTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "PushKit", - "push": [ - "ActsSpecifiedUserActionextensionZeroTest.hap->/system/app/ActsSpecifiedUserActionextensionZeroTest.hap"] - }, - { - "type": "ShellKit", - "run-command": [ - "acm create -n 101 -t normal", - "acm create -n 102 -t normal", - "acm switch -i 101" - ], - "teardown-command":[ - "acm delete -i 101", - "acm delete -i 102" - ] - }, - { - "type": "PushKit", - "push": [ - "ActsSpecifiedUserActionextensiononeTest.hap->/system/app/ActsSpecifiedUserActionextensiononeTest.hap"] - }, - { - "type": "ShellKit", - "run-command": [ - "acm switch -i 100" - ] - } - ] -} - diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 196c3b8b3760abbd14b1e6b6d28e609dcf1b85bd..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/Application/AbilityStage.ts +++ /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 AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageContext = this.context; - globalThis.startnum = 0 - console.log("MyAbilityStage finish") - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 77038a5e923d6947c4419b4c9f0365e72b2327a7..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/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.application.Ability' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate"); - globalThis.abilityWant = want; - globalThis.abilityContext = this.context - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility onDestroy"); - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility onWindowStageCreate"); - windowStage.setUIContent(this.context, "pages/index/index", null); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy"); - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility onForeground"); - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground"); - } -}; diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility2/MainAbility2.ts deleted file mode 100644 index 892ee1bfb3bd2e6686d3e2f2d2f617f1730f290e..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/MainAbility2/MainAbility2.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' -function PublishCallBackOne() { - console.debug("====>Publish CallBack ACTS_STAWA_CommonEvent====>"); - console.debug("====>close this context====>") - globalThis.ability2Context.terminateSelf(); -} - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility2 onCreate") - - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility2 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility2 onWindowStageCreate") - globalThis.ability2Context = this.context - windowStage.setUIContent(this.context, "pages/index", null) - commonEvent.publish("ABILITYCONTEX_Start_CommonEvent", PublishCallBackOne); - } - - 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/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index 4a1e4947d0bf77fc0af62c6df3d070dc1b95bb73..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,230 +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 {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import rpc from '@ohos.rpc'; -import osaccount from '@ohos.account.osAccount' -globalThis.ACCOUNT_ID100; -globalThis.ACCOUNT_ID101; -globalThis.ACCOUNT_ID102; -class Stub extends rpc.RemoteObject { - constructor(des) { - super(des); - } - // process client's request - onRemoteRequest(code, data, reply, option) { - reply.writeNoException(); - reply.writeString("success"); - return true; - } -} - -function onConnectCallback(element) { - console.log('connectAbilityWithAccount onConnect element.bundleName : ' + element.bundleName) - console.log('connectAbilityWithAccount onConnect element.abilityName : ' + element.abilityName) -} - -function onDisconnectCallback(element) { - console.log('connectAbilityWithAccount onDisconnect element.bundleName : ' + element.bundleName) - console.log('connectAbilityWithAccount onDisconnect element.abilityName : ' + element.abilityName) -} - -function onFailedCallback(code) { - console.log('connectAbilityWithAccount onFailed errCode : ' + code) -} - -export default class 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: - console.log('ServiceAbility case 1'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.MainAbility2' - },globalThis.ACCOUNT_ID100 ,{ - windowMode: 2, - displayId: 1 - }).then(() => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_0100 ====>success!") - }) - console.debug("====>case 1 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - case 2: - console.log('ServiceAbility case 2'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.MainAbility2' - },globalThis.ACCOUNT_ID102 ,{ - windowMode: 2, - displayId: 1 - }).then(() => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_0300 ====>success!") - }) - console.debug("====>case 2 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - case 3: - console.log('ServiceAbility case 3'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensiononetest', - abilityName: 'com.example.actsspecifieduseractionextensiononetest.MainAbility2' - },globalThis.ACCOUNT_ID101,((err, data) => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_0500====>fail!!!"+ JSON.stringify(err)) - console.log("====>end ACTS_StartServiceAbilityWithAccount_0500====>sunccess!"+ JSON.stringify(data)) - })) - console.debug("====>case 3 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - case 4: - console.log('ServiceAbility case 4'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.MainAbility2' - },globalThis.ACCOUNT_ID102, { - windowMode: 2, - displayId: 1 - },((err, data) => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_0600====>fail!!!"+ JSON.stringify(err)) - console.log("====>end ACTS_StartServiceAbilityWithAccount_0600====>sunccess!"+ JSON.stringify(data)) - })) - console.debug("====>case 4 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - case 5: - console.log('ServiceAbility case 5'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2' - },globalThis.ACCOUNT_ID100).then((data) => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_0700====>success!"+ JSON.stringify(data)) - }) - break; - case 6: - console.log('ServiceAbility case 6'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2' - },globalThis.ACCOUNT_ID102,((err, data) => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_0900====>fail!!!") - console.log("====>end ACTS_StartServiceAbilityWithAccount_0900====>sunccess!") - })) - console.debug("====>case 6 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - case 7: - console.log('ServiceAbility case 7'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensiononetest', - abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility2' - }, globalThis.ACCOUNT_ID101,((err, data) => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_1100====>fail!!!"+ JSON.stringify(err)) - console.log("====>end ACTS_StartServiceAbilityWithAccount_1100====>sunccess!"+ JSON.stringify(data)) - })) - console.debug("====>case 7 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - case 8: - console.log('ServiceAbility case 8'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2' - }, globalThis.ACCOUNT_ID102,((err, data) => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_1200====>fail!!!"+ JSON.stringify(err)) - console.log("====>end ACTS_StartServiceAbilityWithAccount_1200====>sunccess!"+ JSON.stringify(data)) - })) - console.debug("====>case 8 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - case 9: - console.log('ServiceAbility case 9'); - this.context.connectAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2', - action: "StartAbilityPromise" - }, globalThis.ACCOUNT_ID100, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - },) - break; - case 10: - console.log('ServiceAbility case 10'); - this.context.connectAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2', - action: "StartAbilityPromise" - },globalThis.ACCOUNT_ID102, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - },) - - console.debug("====>case 10 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensionzerotest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - default: - console.log("====> ServiceAbility end default =====>") - break; - } - } - 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/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility/service.ts deleted file mode 100644 index 91a83dbc24c50064a2031ddf77606699a059fac9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/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/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts deleted file mode 100644 index c70f0a2d3cfda08ff3f4038d37128a08c013d16a..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts +++ /dev/null @@ -1,60 +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 commonEvent from "@ohos.commonEvent" -import rpc from '@ohos.rpc'; - -export default class ServiceAbility2 extends ServiceExtensionAbility { - onCreate(want) { - console.log('ServiceAbility2 onCreate'); - globalThis.abilityWant = want; - } - - onDestory(){ - console.log('ServiceAbility2 onDestory'); - } - - onRequest(want,startId) { - console.log('ServiceAbility2 onRequest'); - commonEvent.publish("ABILITYCONTEX_Start_CommonEvent",() => { - console.log("publish Publish ABILITYCONTEX_Start_CommonEvent callback") - this.context.terminateSelf(); - console.log("====> terminateSelf End=====>") - }); - } - - onConnect(want: Want) { - console.log('ServiceAbility2 onConnect'); - if (want.action == 'StartAbilityPromise') { - console.log('stub StartAbilityPromise OnConnect start '); - commonEvent.publish("ABILITYCONTEX_Start_CommonEvent",() => { - console.log("publish Publish ABILITYCONTEX_Start_CommonEvent callback") - this.context.terminateSelf(); - console.log("====> StartAbilityPromise End=====>") - }); - } - 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/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility2/service.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/ServiceAbility2/service.ts deleted file mode 100644 index 91a83dbc24c50064a2031ddf77606699a059fac9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/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/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/pages/index/index.ets deleted file mode 100644 index ae1248c48c93d453fcd7eda5a426fcb47cbe59c0..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/pages/index/index.ets +++ /dev/null @@ -1,49 +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) - console.info("subscribeEvent run !!!!") - const configService = core.getDefaultService('config') - console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters)) - configService.setConfig(globalThis.abilityWant.parameters) - testsuite(globalThis.abilityContext) - core.execute() - } - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('MainAbility') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/pages/second/second.ets deleted file mode 100644 index 2c768edb999b1b54fef3268922817734b1f1c954..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/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/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/Ability.test.ets deleted file mode 100644 index a3586361441e1111245eadf7c2c8da640d5b44ee..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/Ability.test.ets +++ /dev/null @@ -1,833 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import commonEvent from '@ohos.commonEvent' -import osaccount from '@ohos.account.osAccount' - -var ACTS_ABILITYCONTEX = { - events: ["ABILITYCONTEX_Start_CommonEvent"] -}; - -const START_ABILITY_TIMEOUT = 3000; -console.debug("====>in Ability.test====>"); - -export default function abilityTest(abilityContext) { - console.debug("====>in ACTS_InterfaceMultiUsers====>"); - describe('ACTS_StartService', function () { - beforeAll(function(done) { - var osAccountManager = osaccount.getAccountManager(); - console.debug("====>get AccountManager finish===="); - osAccountManager.activateOsAccount(100, (err)=>{ - console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); - setTimeout(()=>{ - osAccountManager.queryActivatedOsAccountIds((err,data1)=>{ - console.debug("====>getOsAccountLocalIdFromProcess100" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess100" + " data:" + JSON.stringify(data1)); - globalThis.ACCOUNT_ID100 = data1[0]; - osAccountManager.activateOsAccount(101, (err)=>{ - console.debug("====>activateOsAccount localId: 101 err:" + JSON.stringify(err)); - setTimeout(()=>{ - osAccountManager.queryActivatedOsAccountIds((err,data2)=>{ - console.debug("====>getOsAccountLocalIdFromProcess101" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess101" + " data:" + JSON.stringify(data2)); - globalThis.ACCOUNT_ID101 = data2[0]; - osAccountManager.activateOsAccount(102, (err)=>{ - console.debug("====>activateOsAccount localId: 102 err:" + JSON.stringify(err)); - osAccountManager.queryActivatedOsAccountIds((err,data3)=>{ - console.debug("====>getOsAccountLocalIdFromProcess102" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess102" + " data:" + JSON.stringify(data3)); - globalThis.ACCOUNT_ID102 = data3[0]; - osAccountManager.activateOsAccount(100, (err)=>{ - console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); - done(); - }) - }) - }) - }) - },3000) - }) - }) - },3000) - }) - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_0100 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : In multi-user non-concurrent mode, - * the specified user is equal to the current user and the user's task list exists (promise) - */ - it('ACTS_StartServiceAbilityWithAccount_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 == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_0100 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_0100 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_0100 - 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(ACTS_ABILITYCONTEX).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 abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.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_StartServiceAbilityWithAccount_0100 timeout'); - if (flag == true) { - expect().assertFail(); - console.debug('ACTS_StartServiceAbilityWithAccount_0100 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_0300 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * when the specified user does not have a task list (the user does not exist), call Promise - */ - it('ACTS_StartServiceAbilityWithAccount_0300', 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 == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0300 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_0300 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_0300 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_0300 - 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(ACTS_ABILITYCONTEX).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 abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_0500 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * the specified user is not equal to the current user, - * and the user's task list exists, call AsyncCallback - */ - it('ACTS_StartServiceAbilityWithAccount_0500', 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().assertFail(); - expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0500 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - // setTimeout(() => { - - // }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_0500 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_0500 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_0500 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - - function onDisconnectCallback(element) { - console.log('onDisconnectCallback====> element=' + JSON.stringify(element)); - done(); - } - - function onFailedCallback(code) { - console.log('onFailedCallback====> code=' + JSON.stringify(code)) - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).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 abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_0600 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * when the specified user does not have a task list (the user does not exist), - * call AsyncCallback - */ - it('ACTS_StartServiceAbilityWithAccount_0600', 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 == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0600 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_0600 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_0600 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_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(ACTS_ABILITYCONTEX).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 abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_0700 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * when the specified user is equal to the current user, - * and the user's task list exists, call Promise - */ - it('ACTS_StartServiceAbilityWithAccount_0700', 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 == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0700 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).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 abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.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_StartServiceAbilityWithAccount_0700 timeout'); - if (flag == true) { - expect().assertFail(); - console.debug('ACTS_StartServiceAbilityWithAccount_0700 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_0900 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * when the specified user does not have a task list (the user does not exist), - * call Promise - */ - it('ACTS_StartServiceAbilityWithAccount_0900', 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 == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0900 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_0900 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_0900 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_0900 - 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(ACTS_ABILITYCONTEX).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 abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_1100 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * the specified user is not equal to the current user, - * and the user's task list exists, call AsyncCallback - */ - it('ACTS_StartServiceAbilityWithAccount_1100', 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().assertFail(); - expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>1100 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_1100 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_1100 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_1100 - 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(ACTS_ABILITYCONTEX).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("====>1100start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_1200 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * when the specified user does not have a task list (the user does not exist), - * call AsyncCallback - */ - it('ACTS_StartServiceAbilityWithAccount_1200', 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 == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>1200 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_1200 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_1200 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_1200 - 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(ACTS_ABILITYCONTEX).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("====>1200start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_ConnectServiceAbilityWithAccount_0100 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * when the specified user is equal to the current user and the user's task list exists - */ - it('ACTS_ConnectServiceAbilityWithAccount_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 == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).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("====>0100 ConnectServiceAbility connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.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_ConnectServiceAbilityWithAccount_0100 timeout'); - if (flag == true) { - expect().assertFail(); - console.debug('ACTS_ConnectServiceAbilityWithAccount_0100 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /* - * @tc.number : ACTS_ConnectServiceAbilityWithAccount_0300 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * when the specified user does not have a task list (the user does not exist) - */ - it('ACTS_ConnectServiceAbilityWithAccount_0300', 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 == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0300 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_ConnectServiceAbilityWithAccount_0300 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_ConnectServiceAbilityWithAccount_0300 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_ConnectServiceAbilityWithAccount_0300 - 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(ACTS_ABILITYCONTEX).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("====>0300 ConnectServiceAbility connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - }) -} diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 14db1352021eca93318bfef24eaece89517e9ba8..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/ets/test/List.test.ets +++ /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 abilityTest from './Ability.test.ets' - - -export default function testsuite(context) { - - console.debug("====>in list.test====>"); - abilityTest(context) - -} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/module.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/module.json deleted file mode 100644 index 79e3b5316dd06122aba615f800d0d68fcd361d3f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/module.json +++ /dev/null @@ -1,131 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.actsspecifieduseractionextensionzerotest.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.example.actsspecifieduseractionextensionzerotest.MainAbility2", - "srcEntrance": "./ets/MainAbility2/MainAbility2.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.actsspecifieduseractionextensionzerotest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - }, - { - "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", - "name": "com.example.actsspecifieduseractionextensionzerotest.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.MANAGE_LOCAL_ACCOUNTS", - "reason": "ceshi" - }, - { - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION", - "reason": "ceshi" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" - }, - { - "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/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/element/string.json deleted file mode 100644 index d75325f3cf0a50c1dfe4dbc5162c8737276c3dd9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/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/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 6898b31d2085f478ee1ed9d933a5910cbf901d92..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/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/actsstartcomponenttest/SpecifiedUserActionExtension_100/signature/openharmony_sx.p7b b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_100/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/app.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/app.json deleted file mode 100644 index 3af7577046c529ec844fd187c327d9fe488f38d9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsspecifieduseractionextensiononetest", - "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/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/resources/base/element/string.json deleted file mode 100644 index be09cccde1bc7369ef47a5cd45d2b06884c88602..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/BUILD.gn b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/BUILD.gn deleted file mode 100644 index 35bca596beb835dee6ad6f26c3ce5c1b7b041021..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/BUILD.gn +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsSpecifiedUserActionextensiononeTest") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":actsspecifieduseractionextensiononetest_js_assets", - ":actsspecifieduseractionextensiononetest_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsSpecifiedUserActionextensiononeTest" -} - -ohos_app_scope("actsspecifieduseractionextensiononetest_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actsspecifieduseractionextensiononetest_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("actsspecifieduseractionextensiononetest_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":actsspecifieduseractionextensiononetest_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/Test.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/Test.json deleted file mode 100644 index fed06e990bb311e6f04b4fa3c1d8d03827329b6b..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/Test.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "com.example.actsspecifieduseractionextensiononetest", - "shell-timeout": "300000" - }, - "kits": [ - { - "type": "ShellKit", - "run-command": [ - "acm create -n 101 -t normal", - "acm create -n 102 -t normal", - "acm switch -i 101" - ], - "teardown-command":[ - "acm delete -i 101", - "acm delete -i 102" - ] - }, - { - "test-file-name": [ - "ActsSpecifiedUserActionextensiononeTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "remount" - ] - }, - { - "type": "PushKit", - "push": [ - "ActsSpecifiedUserActionextensiononeTest.hap->/system/app/ActsSpecifiedUserActionextensiononeTest.hap" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "acm switch -i 100" - ] - }, - - { - "type": "PushKit", - "push": [ - "ActsSpecifiedUserActionextensionZeroTest.hap->/system/app/ActsSpecifiedUserActionextensionZeroTest.hap" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "acm switch -i 101" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "chmod 644 /data/*.hap" - ] - } - ] -} diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 70b1618e9cc97658683c4577d275da01f37dbf41..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,24 +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 AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageContext = this.context; - globalThis.startnum = 0 - console.log("MyAbilityStage finish") - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 8be28c127eab8f0e5bf9522ea34f0817021db14c..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility/MainAbility.ts +++ /dev/null @@ -1,51 +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.application.Ability' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate"); - globalThis.abilityWant = want; - globalThis.abilityContext = this.context - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility onDestroy"); - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility onWindowStageCreate"); - windowStage.setUIContent(this.context, "pages/index/index", null); - } - - onWindowStageDestroy() { - // Main window is destroyed, release UI related resources - console.log("MainAbility onWindowStageDestroy"); - } - - onForeground() { - // Ability has brought to foreground - console.log("MainAbility onForeground"); - } - - onBackground() { - // Ability has back to background - console.log("MainAbility onBackground"); - } -}; diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility2/MainAbility2.ts deleted file mode 100644 index ea606f68626946be6167c55ca8a9b745b19c21f5..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/MainAbility2/MainAbility2.ts +++ /dev/null @@ -1,58 +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.application.Ability' -import commonEvent from '@ohos.commonEvent' -function PublishCallBackOne() { - console.debug("====>Publish CallBack ACTS_STAWA_CommonEvent====>"); - console.debug("====>close this context====>") - globalThis.ability2Context.terminateSelf(); -} - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility2 onCreate") - - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility2 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility2 onWindowStageCreate") - globalThis.ability2Context = this.context - windowStage.setUIContent(this.context, "pages/index", null) - commonEvent.publish("ABILITYCONTEX_Start_CommonEvent", PublishCallBackOne); - } - - 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/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility/ServiceAbility.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility/ServiceAbility.ts deleted file mode 100644 index 83124f2c7e9d32cd4b7b13fa46c1aaf972922493..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility/ServiceAbility.ts +++ /dev/null @@ -1,144 +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); - } - // process client's request - onRemoteRequest(code, data, reply, option) { - reply.writeNoException(); - reply.writeString("success"); - return true; - } -} - -function onConnectCallback(element) { - console.log('connectAbilityWithAccount onConnect element.bundleName : ' + element.bundleName) - console.log('connectAbilityWithAccount onConnect element.abilityName : ' + element.abilityName) -} - -function onDisconnectCallback(element) { - console.log('connectAbilityWithAccount onDisconnect element.bundleName : ' + element.bundleName) - console.log('connectAbilityWithAccount onDisconnect element.abilityName : ' + element.abilityName) -} - -function onFailedCallback(code) { - console.log('connectAbilityWithAccount onFailed errCode : ' + code) -} - -export default class 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: - console.log('ServiceAbility case 1'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.MainAbility2' - },100, { - windowMode: 2, - displayId: 1 - }).then((data) => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_0200 ====>success!") - }) - console.debug("====>case 1 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensiononetest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - break; - - case 2: - console.log('ServiceAbility case 2'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2' - }, globalThis.ACCOUNT_ID100).then((data) => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_0800====>success!"+ JSON.stringify(data)) - }) - console.debug("====>case 3 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensiononetest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - - case 3: - console.log('ServiceAbility case 3'); - this.context.connectAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensionzerotest', - abilityName: 'com.example.actsspecifieduseractionextensionzerotest.ServiceAbility2' - }, globalThis.ACCOUNT_ID100, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback, - },) - console.debug("====>case 5 end====>"); - var myStub = new Stub("com.example.actsspecifieduseractionextensiononetest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - break; - case 4: - console.log('ServiceAbility case 4'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensiononetest', - abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility2' - },101,((err, data) => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_1000====>fail!!!"+ JSON.stringify(err)) - console.log("====>end ACTS_StartServiceAbilityWithAccount_1000====>sunccess!"+ JSON.stringify(data)) - })) - break; - case 5: - console.log('ServiceAbility case 5'); - this.context.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionextensiononetest', - abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility2' - }, globalThis.ACCOUNT_ID101,((err, data) => { - console.log("====>end ACTS_StartServiceAbilityWithAccount_0400====>fail!!!"+ JSON.stringify(err)) - console.log("====>end ACTS_StartServiceAbilityWithAccount_0400====>sunccess!"+ JSON.stringify(data)) - })) - break; - default: - console.log("====> ServiceAbility end default =====>") - break; - } - } - 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/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility/service.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility/service.ts deleted file mode 100644 index 383f9f0ebefc00d5761c83f88fcd1ba6c9500cd1..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility/service.ts +++ /dev/null @@ -1,11 +0,0 @@ -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/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts deleted file mode 100644 index bedb302158f3ca7dc5fcda757bbca056c27a63e3..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts +++ /dev/null @@ -1,52 +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 Want from '@ohos.application.Want'; -import commonEvent from "@ohos.commonEvent" -import rpc from '@ohos.rpc'; - -export default class ServiceAbility2 extends ServiceExtensionAbility { - onCreate(want) { - console.log('ServiceAbility2 onCreate'); - globalThis.abilityWant = want; - } - - onDestory(){ - console.log('ServiceAbility2 onDestory'); - } - - onRequest(want,startId) { - console.log('ServiceAbility2 onRequest'); - commonEvent.publish("ABILITYCONTEX_Start_CommonEvent",() => { - console.log("publish Publish ABILITYCONTEX_Start_CommonEvent callback") - this.context.terminateSelf(); - console.log("====> terminateSelf End=====>") - }); - } - - onConnect(want: 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/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility2/service.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility2/service.ts deleted file mode 100644 index 383f9f0ebefc00d5761c83f88fcd1ba6c9500cd1..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/ServiceAbility2/service.ts +++ /dev/null @@ -1,11 +0,0 @@ -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/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/pages/index/index.ets deleted file mode 100644 index 43f30ae365e727a0006bc0bba273e6efff796f19..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/pages/index/index.ets +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2021 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import file from '@system.file'; -import {Core, ExpectExtend, InstrumentLog, ReportExtend} from "deccjsunit/index" -import testsuite from "../../test/List.test.ets" -@Entry -@Component -struct Index { - aboutToAppear() { - console.info("start run testcase!!!!") - const core = Core.getInstance() - const expectExtend = new ExpectExtend({ - 'id': 'extend' - }) - core.addService('expect', expectExtend) - const reportExtend = new ReportExtend(file) - - core.addService('report', reportExtend) - core.init() - core.subscribeEvent('task', reportExtend) - console.info("subscribeEvent run !!!!") - const configService = core.getDefaultService('config') - console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters)) - configService.setConfig(globalThis.abilityWant.parameters) - testsuite(globalThis.abilityContext) - core.execute() - } - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('MainAbility') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/pages/second/second.ets deleted file mode 100644 index 2c768edb999b1b54fef3268922817734b1f1c954..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/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/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/Ability.test.ets deleted file mode 100644 index 35c02872784a50cbc3d3daa0be7d59fd82737167..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/Ability.test.ets +++ /dev/null @@ -1,458 +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 "deccjsunit/index" -import commonEvent from '@ohos.commonEvent' -import osaccount from '@ohos.account.osAccount' - - -var ACTS_ABILITYCONTEX = { - events: ["ABILITYCONTEX_Start_CommonEvent"] -}; - -const START_ABILITY_TIMEOUT = 3000; -console.debug("====>in Ability.test====>"); - -export default function abilityTest(abilityContext) { - console.debug("====>in ACTS_InterfaceMultiUsers====>"); - describe('ACTS_StartService', function () { - beforeAll(function(done) { - var osAccountManager = osaccount.getAccountManager(); - console.debug("====>get AccountManager finish===="); - osAccountManager.activateOsAccount(100, (err)=>{ - console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); - setTimeout(()=>{ - osAccountManager.queryActivatedOsAccountIds((err,data1)=>{ - console.debug("====>getOsAccountLocalIdFromProcess100" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess100" + " data:" + JSON.stringify(data1)); - globalThis.ACCOUNT_ID100 = data1[0]; - osAccountManager.activateOsAccount(101, (err)=>{ - console.debug("====>activateOsAccount localId: 101 err:" + JSON.stringify(err)); - setTimeout(()=>{ - osAccountManager.queryActivatedOsAccountIds((err,data2)=>{ - console.debug("====>getOsAccountLocalIdFromProcess101" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess101" + " data:" + JSON.stringify(data2)); - globalThis.ACCOUNT_ID101 = data2[0]; - osAccountManager.activateOsAccount(102, (err)=>{ - console.debug("====>activateOsAccount localId: 102 err:" + JSON.stringify(err)); - osAccountManager.queryActivatedOsAccountIds((err,data3)=>{ - console.debug("====>getOsAccountLocalIdFromProcess102" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess102" + " data:" + JSON.stringify(data3)); - globalThis.ACCOUNT_ID102 = data3[0]; - osAccountManager.activateOsAccount(101, (err)=>{ - console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); - done(); - }) - }) - }) - }) - },3000) - }) - }) - },3000) - }) - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_0200 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * the specified user is not equal to the current user, - * and the user's task list exists, call Promise - */ - it('ACTS_StartServiceAbilityWithAccount_0200', 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().assertFail(); - expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_0200 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_0200 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_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(ACTS_ABILITYCONTEX).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 abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensiononetest', - abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_0800 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * the specified user is not equal to the current user, - * and the user's task list exists, call Promise - */ - it('ACTS_StartServiceAbilityWithAccount_0800', 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 == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0800 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - done(); - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_0800 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_0800 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_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(ACTS_ABILITYCONTEX).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 abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensiononetest', - abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_ConnectServiceAbilityWithAccount_0200 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * the specified user is not equal to the current user, - * and the user's task list exists - */ - it('ACTS_ConnectServiceAbilityWithAccount_0200', 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().assertFail(); - expect(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>ACTS_ConnectServiceAbilityWithAccount_0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>ACTS_ConnectServiceAbilityWithAccount_0200 UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(false); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>ACTS_ConnectServiceAbilityWithAccount_0200 disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_ConnectServiceAbilityWithAccount_0200 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_ConnectServiceAbilityWithAccount_0200 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>ACTS_ConnectServiceAbilityWithAccount_0200 in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_ConnectServiceAbilityWithAccount_0200 - timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - }, 1000); - } - - function onDisconnectCallback(element) { - console.log('ACTS_ConnectServiceAbilityWithAccount_0200 onDisconnectCallback====> element=' + JSON.stringify(element)); - } - - function onFailedCallback(code) { - console.log('ACTS_ConnectServiceAbilityWithAccount_0200 onFailedCallback====> code=' + JSON.stringify(code)) - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("====>ACTS_ConnectServiceAbilityWithAccount_0200 Create Subscriber====>"); - data.getSubscribeInfo().then(async (SubscribeInfo) => { - console.debug("====>ACTS_ConnectServiceAbilityWithAccount_0200 SubscribeInfo is====>" + JSON.stringify(SubscribeInfo)); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>ACTS_ConnectServiceAbilityWithAccount_0200 0200start connectAbility====>"); - globalThis.number = await abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensiononetest', - abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>ACTS_ConnectServiceAbilityWithAccount_0200 number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_1000 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * when the specified user is equal to the current user, - * and the user's task list exists, call AsyncCallback - */ - it('ACTS_StartServiceAbilityWithAccount_1000', 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(data.event == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>1000 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_1000 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_1000 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_1000 - 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(ACTS_ABILITYCONTEX).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 abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensiononetest', - abilityName: 'com.example.actsspecifieduseractionextensiononetest.ServiceAbility' - }, { - onConnect: onConnectCallback, - onDisconnect: onDisconnectCallback, - onFailed: onFailedCallback - }) - console.debug("====>number is====>" + JSON.stringify(globalThis.number)); - }) - }) - }) - - /* - * @tc.number : ACTS_StartServiceAbilityWithAccount_0400 - * @tc.name : In multi-user non-concurrent mode - * @tc.desc : System application, in multi-user non-concurrent mode, - * when the specified user is equal to the current user, - * and the user's task list exists, call AsyncCallback - */ - it('ACTS_StartServiceAbilityWithAccount_0400', 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 == "ABILITYCONTEX_Start_CommonEvent").assertTrue(); - console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); - if (data.event == "ABILITYCONTEX_Start_CommonEvent") { - startresult = true - } - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - flag = false - expect(startresult).assertEqual(true); - abilityContext.disconnectAbility(globalThis.number).then((err) => { - console.debug("====>err is====>" + JSON.stringify(err)); - }) - console.log('====>disconnectAbility finish'); - setTimeout(() => { - done(); - }, 1000) - } - - function onConnectCallback(element, remote) { - console.log('ACTS_StartServiceAbilityWithAccount_0400 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_StartServiceAbilityWithAccount_0400 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(() => { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if (flag == true) { - console.debug('ACTS_StartServiceAbilityWithAccount_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(ACTS_ABILITYCONTEX).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 abilityContext.connectAbility( - { - bundleName: 'com.example.actsspecifieduseractionextensiononetest', - abilityName: 'com.example.actsspecifieduseractionextensiononetest.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/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 4436395534f304976110ce8ce85ca2e7ac9984f4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/ets/test/List.test.ets +++ /dev/null @@ -1,23 +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(context) { - - console.debug("====>in list.test====>"); - abilityTest(context) - -} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/module.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/module.json deleted file mode 100644 index 3b963d0c7cc3048040d7dd89c4c50d2b534ef801..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/module.json +++ /dev/null @@ -1,131 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.actsspecifieduseractionextensiononetest.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.example.actsspecifieduseractionextensiononetest.MainAbility2", - "srcEntrance": "./ets/MainAbility2/MainAbility2.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.actsspecifieduseractionextensiononetest.ServiceAbility", - "icon": "$media:icon", - "srcLanguage": "ets", - "description": "$string:phone_entry_main", - "type": "service", - "visible": true - }, - { - "srcEntrance": "./ets/ServiceAbility2/ServiceAbility2.ts", - "name": "com.example.actsspecifieduseractionextensiononetest.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.MANAGE_LOCAL_ACCOUNTS", - "reason": "ceshi" - }, - { - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION", - "reason": "ceshi" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" - }, - { - "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/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/element/string.json deleted file mode 100644 index d75325f3cf0a50c1dfe4dbc5162c8737276c3dd9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/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/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 6898b31d2085f478ee1ed9d933a5910cbf901d92..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/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/actsstartcomponenttest/SpecifiedUserActionExtension_101/signature/openharmony_sx.p7b b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserActionExtension_101/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/app.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/app.json deleted file mode 100644 index 51a7178ef9945ef296bbb58c0ec19f2f3ccaae7a..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsspecifieduseractionzerotest", - "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/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/resources/base/element/string.json deleted file mode 100644 index be09cccde1bc7369ef47a5cd45d2b06884c88602..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/BUILD.gn b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/BUILD.gn deleted file mode 100644 index 2f4eac94fd97eec421a600dc27cd69c2eea21f1e..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/BUILD.gn +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsSpecifiedUserActionZeroTest") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":actsspecifieduseractionzerotest_js_assets", - ":actsspecifieduseractionzerotest_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsSpecifiedUserActionZeroTest" -} - -ohos_app_scope("actsspecifieduseractionzerotest_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actsspecifieduseractionzerotest_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("actsspecifieduseractionzerotest_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":actsspecifieduseractionzerotest_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/Test.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/Test.json deleted file mode 100644 index 50653b9cfccaae4dfeadb0669ca6c3d6a07ab271..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/Test.json +++ /dev/null @@ -1,50 +0,0 @@ - -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "com.example.actsspecifieduseractionzerotest", - "shell-timeout": "60000" - }, - "kits": [ - { - "test-file-name": [ - "ActsSpecifiedUserActionZeroTest.hap", - "ActsSpecifiedUserActiononeTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "PushKit", - "push": [ - "ActsSpecifiedUserActionZeroTest.hap->/system/app/ActsSpecifiedUserActionZeroTest.hap"] - }, - { - "type": "ShellKit", - "run-command": [ - "acm create -n 101 -t normal", - "acm create -n 102 -t normal", - "acm switch -i 101" - ] - }, - { - "type": "PushKit", - "push": [ - "ActsSpecifiedUserActiononeTest.hap->/system/app/ActsSpecifiedUserActiononeTest.hap"] - }, - { - "type": "ShellKit", - "run-command": [ - "acm switch -i 100" - ], - "teardown-command":[ - "acm delete -i 101", - "acm delete -i 102" - ] - } - -] -} - diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 08dee12306de669ae4e52f53c5234d98461148f4..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 69a9a4bac10f41ef5d60cbc5bb1aa90f85d7dc50..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/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.application.Ability' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - globalThis.abilityWant = want; - } - - 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, "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/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility2/MainAbility2.ts deleted file mode 100644 index 209189314ea2c328102dbee3a923d99b898447a8..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/MainAbility2/MainAbility2.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 Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' -function PublishCallBackOne() { - console.debug("====>Publish CallBack ACTS_STAWA_CommonEvent====>"); - console.debug("====>close this context====>") - globalThis.ability2Context.terminateSelf(); -} -export default class MainAbility2 extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility2 onCreate") - - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility2 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility2 onWindowStageCreate") - globalThis.ability2Context = this.context - windowStage.setUIContent(this.context, "pages/index", null) - commonEvent.publish("ABILITYCONTEX_Start_CommonEvent", PublishCallBackOne); - } - - 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/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts deleted file mode 100644 index 8941ea468ec094392a23a0ea114f227fcddf128d..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts +++ /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 ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility' -import commonEvent from "@ohos.commonEvent" -import rpc from '@ohos.rpc'; -class Stub extends rpc.RemoteObject { - constructor(des) { - super(des); - } - // process client's request - onRemoteRequest(code, data, reply, option) { - reply.writeNoException(); - reply.writeString("success"); - return true; - } -} -export default class ServiceAbility2 extends ServiceExtensionAbility { - 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'); - if (want.action == 'StartAbilityPromise') { - console.log('stub StartAbilityPromise OnConnect start '); - commonEvent.publish("ABILITYCONTEX_Start_CommonEvent",() => { - console.log("publish Publish ABILITYCONTEX_Start_CommonEvent callback") - console.log("====> StartAbilityPromise End=====>") - }); - - var myStub = new Stub("com.example.actsspecifieduseractionzerotest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - } - } - - 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/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/ServiceAbility2/service.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/ServiceAbility2/service.ts deleted file mode 100644 index b4e93f63e685c503c43c7e9ba6a88c3ba155fcfa..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/ServiceAbility2/service.ts +++ /dev/null @@ -1,26 +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/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/pages/index/index.ets deleted file mode 100644 index ae1248c48c93d453fcd7eda5a426fcb47cbe59c0..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/pages/index/index.ets +++ /dev/null @@ -1,49 +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) - console.info("subscribeEvent run !!!!") - const configService = core.getDefaultService('config') - console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters)) - configService.setConfig(globalThis.abilityWant.parameters) - testsuite(globalThis.abilityContext) - core.execute() - } - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('MainAbility') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/pages/second/second.ets deleted file mode 100644 index 2c768edb999b1b54fef3268922817734b1f1c954..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/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/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 72baf47de53d1392864356c566692a78e02d9ff6..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/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 './abilityTest.ets' - - -export default function testsuite(context) { - - abilityTest(context) - -} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/abilityTest.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/abilityTest.ets deleted file mode 100644 index 7951c6ae3b79bac98003419005f88ba92e796fb9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/ets/test/abilityTest.ets +++ /dev/null @@ -1,935 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import commonEvent from '@ohos.commonEvent'; -import osaccount from '@ohos.account.osAccount' - -var ACTS_ABILITYCONTEX = { - events: ["ABILITYCONTEX_Start_CommonEvent"] -}; -var ACCOUNT_ID100; -var ACCOUNT_ID101; -var ACCOUNT_ID102; - -const START_ABILITY_TIMEOUT = 3000; -export default function abilityTest(abilityContext) { - describe('ACTS_AbilityContext', function () { - beforeAll(function(done) { - var osAccountManager = osaccount.getAccountManager(); - console.debug("====>get AccountManager finish===="); - osAccountManager.activateOsAccount(100, (err)=>{ - console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); - setTimeout(()=>{ - osAccountManager.queryActivatedOsAccountIds((err,data1)=>{ - console.debug("====>getOsAccountLocalIdFromProcess100" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess100" + " data:" + JSON.stringify(data1)); - ACCOUNT_ID100 = data1[0]; - osAccountManager.activateOsAccount(101, (err)=>{ - console.debug("====>activateOsAccount localId: 101 err:" + JSON.stringify(err)); - setTimeout(()=>{ - osAccountManager.queryActivatedOsAccountIds((err,data2)=>{ - console.debug("====>getOsAccountLocalIdFromProcess101" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess101" + " data:" + JSON.stringify(data2)); - ACCOUNT_ID101 = data2[0]; - osAccountManager.activateOsAccount(102, (err)=>{ - console.debug("====>activateOsAccount localId: 102 err:" + JSON.stringify(err)); - osAccountManager.queryActivatedOsAccountIds((err,data3)=>{ - console.debug("====>getOsAccountLocalIdFromProcess102" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess102" + " data:" + JSON.stringify(data3)); - ACCOUNT_ID102 = data3[0]; - osAccountManager.activateOsAccount(100, (err)=>{ - console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); - done(); - }) - }) - }) - }) - },3000) - }) - }) - },3000) - }) - }) - - - /* - * @tc.number: ACTS_StartStandardAbilityWithAccount_0100 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user is equal to the current user and the user's task list exists, - * call the AbilityContext::startAbilityWithAccount interface of - * Promise (with the StartOptions parameter) to start Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_0100', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_0100====>start") - var Subscriber; - var flag = false; - - function SubscribeCallBack(err, data) { - flag = true; - expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); - console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_0100====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>ACTS_StartStandardAbilityWithAccount_0100 UnSubscribeCallback====>"); - setTimeout(function(){ - done(); - },2000) - } - - function timeout() { - if(flag == false) { - expect().assertFail(); - console.debug('ACTS_StartStandardAbilityWithAccount_0100 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - },ACCOUNT_ID100, - { - windowMode: 2, - displayId: 1 - }).then((data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_0100====>success!"+ JSON.stringify(data)) - }) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_0300 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user does not have a task list (the user does not exist), - * call the AbilityContext::startAbilityWithAccount interface of - * Promise (with the StartOptions parameter) to start Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_0300', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_0300 ====> start") - - function timeout() { - console.debug('ACTS_StartStandardAbilityWithAccount_0300 ====> timeout'); - done(); - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility12' - },ACCOUNT_ID102, - { - windowMode: 2, - displayId: 1 - }).then((data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_0300====>success!"+ JSON.stringify(data)) - expect().assertFail(); - done(); - }) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_0500 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, - * call the AbilityContext::startAbilityWithAccount interface - * of AsyncCallback (with the StartOptions parameter) to start Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_0500', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_0500 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>0500 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_0500====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityWithAccount_0500 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractiononetest', - abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' - },ACCOUNT_ID101, { - windowMode: 2, - displayId: 1 - }, ((err, data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_0500====>success!!!" + JSON.stringify(data)) - })) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_0600 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user does not have a task list (the user does not exist), call the - * AbilityContext::startAbilityWithAccount interface of - * AsyncCallback (with the StartOptions parameter) to start the Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_0600', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_0600 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>0600 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_0600====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityWithAccount_0600 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - },ACCOUNT_ID102, { - windowMode: 2, - displayId: 1 - }, ((err, data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_0600====>success!!!" + JSON.stringify(data)) - })) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_0700 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user is equal to the current user and the user's task list exists, call the - * AbilityCont. - * ext::startAbilityWithAccount interface of Promise (without the StartOptions parameter) - * to start Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_0700', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_0700 ====> start") - - var Subscriber; - var flag = false; - - function SubscribeCallBack(err, data) { - flag = true; - expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); - console.debug("====>0700 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_0700====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>ACTS_StartStandardAbilityWithAccount_0700 UnSubscribeCallback====>"); - done(); - } - - function timeout() { - if(flag == false) { - expect().assertFail(); - console.debug('ACTS_StartStandardAbilityWithAccount_0700 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - },ACCOUNT_ID100).then((data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_0700====>success!"+ JSON.stringify(data)) - }) - }) - - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_0900 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user does not have a task list (the user does not exist), call - * the AbilityContext::startAbilityWithAccount interface of - * Promise (without the StartOptions parameter) to start the Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_0900', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_0900 ====> start") - - var Subscriber; - - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>0900 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_0900====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityWithAccount_0900 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - },ACCOUNT_ID102).then((data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_0900====>success!"+ JSON.stringify(data)) - }) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_1100 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, call the - * AbilityContext::startAbilityWithAccount interface of - * AsyncCallback (without the StartOptions parameter) to start the Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_1100', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_1100 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>1100 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_1100====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityWithAccount_1100 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractiononetest', - abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' - },ACCOUNT_ID101, ((err, data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_1100====>success!!!" + JSON.stringify(data)) - })) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_1200 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user does not have a task list (the user does not exist), call the - * AbilityContext::startAbilityWithAccount interface of - * AsyncCallback (without the StartOptions parameter) to start the Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_1200', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_1200 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>1200 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_1200====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityWithAccount_1200 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - },ACCOUNT_ID102,((err, data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_1200====>success!!!" + JSON.stringify(data)) - })) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0100 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user is equal to the current user and the user's task list exists, - * call the Promise's AbilityContext::startAbilityForResultWithAccount - * (with the StartOptions parameter) interface to start Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_0100', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0100 ====> start") - var Subscriber; - var flag = false; - - function SubscribeCallBack(err, data) { - flag = true; - expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); - console.debug("====>0100 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityForResultWithAccount_0100====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>ACTS_StartStandardAbilityForResultWithAccount_0100 UnSubscribeCallback====>"); - done(); - } - - function timeout() { - if(flag == false){ - expect().assertFail(); - console.debug('ACTS_StartStandardAbilityForResultWithAccount_0100 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractiononetest', - abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' - }, ACCOUNT_ID100, - { - windowMode: 2, - displayId: 1 - }).then((data) => { - console.log("====>end ACTS_StartStandardAbilityForResultWithAccount_0100====>success!"+ JSON.stringify(data)) - }) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0300 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user does not have a task list (the user does not exist), - * call the AbilityContext::startAbilityForResultWithAccount (with the StartOptions parameter) - * interface of Promise to start Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_0300', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0300 ====> start") - - function timeout() { - console.debug('ACTS_StartStandardAbilityForResultWithAccount_0300 ====> timeout'); - done(); - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - },ACCOUNT_ID102, - { - windowMode: 2, - displayId: 1 - }).then((data) => { - console.log("====>end ACTS_StartStandardAbilityForResultWithAccount_0300====>success!"+ JSON.stringify(data)) - expect().assertFail(); - done(); - }) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0500 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, call the - * AsyncCallback's AbilityContext::startAbilityForResultWithAccount (with the StartOptions parameter) - * interface to start Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_0500', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0500 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>0500 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityForResultWithAccount_0500====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityForResultWithAccount_0500 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractiononetest', - abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' - }, ACCOUNT_ID101, - { - windowMode: 2, - displayId: 1 - }, ((err, data) => { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0500 === success!" + JSON.stringify(data)) - })) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0600 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user does not have a task list (the user does not exist), call the - * AbilityContext::startAbilityForResultWithAccount (with the StartOptions parameter) interface of - * AsyncCallback to start the Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_0600', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0600 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>0600 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityForResultWithAccount_0600====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - - console.debug('ACTS_StartStandardAbilityForResultWithAccount_0600 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - }, ACCOUNT_ID102, - { - windowMode: 2, - displayId: 1 - }, ((err, data) => { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0600 === success!" + JSON.stringify(data)) - })) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0700 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user is equal to the current user and the user's task list exists, - * call the Promise's AbilityContext::startAbilityForResultWithAccount - * (without the StartOptions parameter) interface to start the Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_0700', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0700 ====> start") - - var Subscriber; - var flag = false; - - function SubscribeCallBack(err, data) { - flag = true; - expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); - console.debug("====>0700 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityForResultWithAccount_0700====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - if(flag == false) - { - expect().assertFail(); - console.debug('ACTS_StartStandardAbilityForResultWithAccount_0700 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractiononetest', - abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' - }, ACCOUNT_ID100).then((data) => { - console.log("====>end ACTS_StartStandardAbilityForResultWithAccount_0700====>success!"+ JSON.stringify(data)) - }) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0900 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user does not have a task list (the user does not exist), call the - * AbilityContext::startAbilityForResultWithAccount (no StartOptions parameter) interface of - * Promise to start Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_0900', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0900 ====> start") - - function timeout() { - console.debug('ACTS_StartStandardAbilityForResultWithAccount_0900 ====> timeout'); - done(); - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - },ACCOUNT_ID102).then((data) => { - console.log("====>end ACTS_StartStandardAbilityForResultWithAccount_0900====>success!"+ JSON.stringify(data)) - expect().assertFail(); - done(); - }) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_1100 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, - * call the AsyncCallback's - * AbilityContext::startAbilityForResultWithAccount (without the StartOptions parameter) interface - * to start the Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_1100', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_1100 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>1100 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityForResultWithAccount_1100====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityForResultWithAccount_1100 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractiononetest', - abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' - }, ACCOUNT_ID101, ((err, data) => { - console.log("ACTS_StartStandardAbilityForResultWithAccount_1100 === success!" + JSON.stringify(data)) - })) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_1200 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user does not have a task list (the user does not exist), - * call the AbilityContext::startAbilityForResultWithAccount (no StartOptions parameter) - * interface of AsyncCallback to start Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_1200', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_1200 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>1200 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityForResultWithAccount_1200====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - }, ACCOUNT_ID102, ((err, data) => { - console.log("ACTS_StartStandardAbilityForResultWithAccount_1200 === success!" + JSON.stringify(data)) - })) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityForResultWithAccount_1200 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - - /** - * @tc.number: ACTS_ConnectStandardAbilityWithAccount_0100 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is equal to the current user and the user's task list exists, - * call the AbilityContext::connectAbilityWithAccount interface to connect to Ability. - */ - it('ACTS_ConnectStandardAbilityWithAccount_0100', 0, async function (done) { - console.log("ACTS_ConnectStandardAbilityWithAccount_0100====>start") - var Subscriber; - var flag = true; - var number = 0; - - function onConnectCallback(element, remote) { - console.log('ACTS_ConnectStandardAbilityWithAccount_0100 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_ConnectStandardAbilityWithAccount_0100 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(()=> { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if(flag == true) { - console.debug('ACTS_ConnectStandardAbilityWithAccount_0100 - 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)) - } - - - function SubscribeCallBack(err, data) { - flag = true; - expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); - console.debug("====>WithAccount 0100 Subscribe CallBack data:====>" + JSON.stringify(data)); - abilityContext.disconnectAbility(number).then((err)=>{ - console.debug("====>err is====>" + JSON.stringify(err)); - }) - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_ConnectStandardAbilityWithAccount_0100====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>ACTS_ConnectStandardAbilityWithAccount_0100 UnSubscribeCallback====>"); - done(); - } - - function timeout() { - if(flag == false) { - expect().assertFail(); - console.debug('ACTS_ConnectStandardAbilityWithAccount_0100 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start connectAbilityWithAccount====>"); - number = await abilityContext.connectAbilityWithAccount({ - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.ServiceAbility2', - action: "StartAbilityPromise" - }, ACCOUNT_ID100,{ - onConnect:onConnectCallback, - onDisconnect:onDisconnectCallback, - onFailed: onFailedCallback - }) - }) - - /** - * @tc.number: ACTS_ConnectStandardAbilityWithAccount_0300 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user does not have a task list (the user does not exist), - * call the AbilityContext::connectAbilityWithAccount interface to connect the Ability. - */ - it('ACTS_ConnectStandardAbilityWithAccount_0300', 0, async function (done) { - console.log("ACTS_ConnectStandardAbilityWithAccount_0300 ====> start") - var Subscriber; - var flag = true; - var number = 0; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>WithAccount 0300 Subscribe CallBack data:====>" + JSON.stringify(data)); - abilityContext.disconnectAbility(number).then((err)=>{ - console.debug("====>err is====>" + JSON.stringify(err)); - }) - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function onConnectCallback(element, remote) { - console.log('ACTS_ConnectStandardAbilityWithAccount_0300 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_ConnectStandardAbilityWithAccount_0300 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(()=> { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if(flag == true) { - console.debug('ACTS_ConnectStandardAbilityWithAccount_0300 - 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(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_ConnectStandardAbilityWithAccount_0300====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>start connectAbilityWithAccount====>"); - number = await abilityContext.connectAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.ServiceAbility2', - action: "StartAbilityPromise" - },ACCOUNT_ID102 ,{ - onConnect:onConnectCallback, - onDisconnect:onDisconnectCallback, - onFailed: onFailedCallback - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_ConnectStandardAbilityWithAccount_0300 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - }) -} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/module.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/module.json deleted file mode 100644 index c353cc06d91ebac5b8cb4ca3e44cafb450d8b42a..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/module.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.actsspecifieduseractionzerotest.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.example.actsspecifieduseractionzerotest.MainAbility2", - "srcEntrance": "./ets/MainAbility2/MainAbility2.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/ServiceAbility2/ServiceAbility2.ts", - "name": "com.example.actsspecifieduseractionzerotest.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.MANAGE_LOCAL_ACCOUNTS", - "reason": "ceshi" - }, - { - "name": "ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION", - "reason": "ceshi" - }, - { - "name":"ohos.permission.REMOVE_CACHE_FILES", - "reason":"need use ohos.permission.REMOVE_CACHE_FILES" - }, - { - "name":"ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS", - "reason":"need use ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS" - }, - { - "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/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/element/string.json deleted file mode 100644 index d75325f3cf0a50c1dfe4dbc5162c8737276c3dd9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/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/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 6898b31d2085f478ee1ed9d933a5910cbf901d92..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/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/actsstartcomponenttest/SpecifiedUserAction_100/signature/openharmony_sx.p7b b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_100/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/app.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/app.json deleted file mode 100644 index 9b04e81d77e7570aff3a3af7a9c792358af952ea..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/app.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "app": { - "bundleName": "com.example.actsspecifieduseractiononetest", - "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/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/resources/base/element/string.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/resources/base/element/string.json deleted file mode 100644 index be09cccde1bc7369ef47a5cd45d2b06884c88602..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/resources/base/element/string.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "string": [ - { - "name": "app_name", - "value": "ohosProject" - } - ] -} diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/resources/base/media/app_icon.png b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/resources/base/media/app_icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/AppScope/resources/base/media/app_icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/BUILD.gn b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/BUILD.gn deleted file mode 100644 index 7ce5fd5bbdd4d24a7d8ab95696ce7b25c68b1ca0..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/BUILD.gn +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("ActsSpecifiedUserActiononeTest") { - hap_profile = "entry/src/main/module.json" - js_build_mode = "debug" - deps = [ - ":actsspecifieduseractiononetest_js_assets", - ":actsspecifieduseractiononetest_resources", - ] - ets2abc = true - certificate_profile = "signature/openharmony_sx.p7b" - hap_name = "ActsSpecifiedUserActiononeTest" -} - -ohos_app_scope("actsspecifieduseractiononetest_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("actsspecifieduseractiononetest_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("actsspecifieduseractiononetest_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":actsspecifieduseractiononetest_app_profile" ] - hap_profile = "entry/src/main/module.json" -} diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/Test.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/Test.json deleted file mode 100644 index a8c171bda36735c5943541d63d88791a045ab5ea..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/Test.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "description": "Configuration for hjunit demo Tests", - "driver": { - "type": "JSUnitTest", - "test-timeout": "300000", - "package": "com.example.actsspecifieduseractiononetest", - "shell-timeout": "300000" - }, - "kits": [ - { - "type": "ShellKit", - "run-command": [ - "acm create -n 101 -t normal", - "acm create -n 102 -t normal", - "acm switch -i 101" - ] - }, - { - "test-file-name": [ - "ActsSpecifiedUserActiononeTest.hap" - ], - "type": "AppInstallKit", - "cleanup-apps": true - }, - { - "type": "ShellKit", - "run-command": [ - "remount" - ] - }, - { - "type": "PushKit", - "push": [ - "ActsSpecifiedUserActiononeTest.hap->/system/app/ActsSpecifiedUserActiononeTest.hap" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "acm switch -i 100" - ] - }, - - { - "type": "PushKit", - "push": [ - "ActsSpecifiedUserActionZeroTest.hap->/system/app/ActsSpecifiedUserActionZeroTest.hap" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "acm switch -i 101" - ] - }, - { - "type": "ShellKit", - "run-command": [ - "chmod 644 /data/*.hap" - ] - } - ] -} diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/Application/AbilityStage.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/Application/AbilityStage.ts deleted file mode 100644 index 8375d549288c1fc101c0ab596545af9d626118da..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/Application/AbilityStage.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import AbilityStage from "@ohos.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility/MainAbility.ts deleted file mode 100644 index 69a9a4bac10f41ef5d60cbc5bb1aa90f85d7dc50..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/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.application.Ability' - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate") - globalThis.abilityWant = want; - } - - 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, "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/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility2/MainAbility2.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility2/MainAbility2.ts deleted file mode 100644 index 6176b8ae0398e0573d77f1d005f1011fa6f323a0..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/MainAbility2/MainAbility2.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 Ability from '@ohos.application.Ability' -import commonEvent from '@ohos.commonEvent' -function PublishCallBackOne() { - console.debug("====>Publish CallBack ACTS_STAWA_CommonEvent====>"); - console.debug("====>close this context====>") - globalThis.ability2Context.terminateSelf(); -} - -export default class MainAbility extends Ability { - - onCreate(want, launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility2 onCreate") - - } - - onDestroy() { - // Ability is destroying, release resources for this ability - console.log("MainAbility2 onDestroy") - } - - onWindowStageCreate(windowStage) { - // Main window is created, set main page for this ability - console.log("MainAbility2 onWindowStageCreate") - globalThis.ability2Context = this.context - commonEvent.publish("ABILITYCONTEX_Start_CommonEvent", PublishCallBackOne); - } - - 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/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts deleted file mode 100644 index c45bdac905c73438b73d0b7959bd38895327124f..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/ServiceAbility2/ServiceAbility2.ts +++ /dev/null @@ -1,68 +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 rpc from '@ohos.rpc'; -class Stub extends rpc.RemoteObject { - constructor(des) { - super(des); - } - // process client's request - onRemoteRequest(code, data, reply, option) { - reply.writeNoException(); - reply.writeString("success"); - return true; - } -} -export default class ServiceAbility2 extends ServiceExtensionAbility { - onCreate(want) { - console.log('ServiceAbility2 onCreate'); - globalThis.abilityWant = want; - } - - onDestory(){ - console.log('ServiceAbility2 onDestory'); - } - - onRequest(want,startId) { - console.log('ServiceAbility2 onRequest'); - } - - onConnect(want) { - let extensionContext = this.context - console.log('ServiceAbility2 onConnect'); - if (want.action == 'StartAbilityPromise') { - console.log('stub StartAbilityPromise OnConnect start '); - commonEvent.publish("ABILITYCONTEX_Start_CommonEvent",() => { - console.log("publish Publish ABILITYCONTEX_Start_CommonEvent callback") - extensionContext.terminateSelf(); - console.log("====> StartAbilityPromise End=====>") - }); - - var myStub = new Stub("com.example.actsspecifieduseractiononetest.MainAbility"); - console.log('ThirdAbility onConnect before return:') - return myStub; - } - } - - 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/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/ServiceAbility2/service.ts b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/ServiceAbility2/service.ts deleted file mode 100644 index 91a83dbc24c50064a2031ddf77606699a059fac9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/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/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/pages/index/index.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/pages/index/index.ets deleted file mode 100644 index ae1248c48c93d453fcd7eda5a426fcb47cbe59c0..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/pages/index/index.ets +++ /dev/null @@ -1,49 +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) - console.info("subscribeEvent run !!!!") - const configService = core.getDefaultService('config') - console.info('parameters---->' + JSON.stringify(globalThis.abilityWant.parameters)) - configService.setConfig(globalThis.abilityWant.parameters) - testsuite(globalThis.abilityContext) - core.execute() - } - build() { - Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { - Text('MainAbility') - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - .height('100%') - } -} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/pages/second/second.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/pages/second/second.ets deleted file mode 100644 index 2c768edb999b1b54fef3268922817734b1f1c954..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/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/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/List.test.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/List.test.ets deleted file mode 100644 index 5635f2840894a3a90336344a0d439a5e2942b166..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/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 './abilityTest.ets' - - -export default function testsuite(context) { - - abilityTest(context) - -} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/abilityTest.ets b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/abilityTest.ets deleted file mode 100644 index 470e2e0f645240b347bea3b4d4f11b653370d7a9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/ets/test/abilityTest.ets +++ /dev/null @@ -1,540 +0,0 @@ -/* - * Copyright (c) 2022 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from "deccjsunit/index" -import commonEvent from '@ohos.commonEvent'; -import osaccount from '@ohos.account.osAccount' - -var ACTS_ABILITYCONTEX = { - events: ["ABILITYCONTEX_Start_CommonEvent"] -}; -var ACCOUNT_ID100; -var ACCOUNT_ID101; -var ACCOUNT_ID102; - -const START_ABILITY_TIMEOUT = 3000; -export default function abilityTest(abilityContext) { - describe('ACTS_AbilityContext', function () { - beforeAll(function(done) { - var osAccountManager = osaccount.getAccountManager(); - console.debug("====>get AccountManager finish===="); - osAccountManager.activateOsAccount(100, (err)=>{ - console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); - setTimeout(()=>{ - osAccountManager.queryActivatedOsAccountIds((err,data1)=>{ - console.debug("====>getOsAccountLocalIdFromProcess100" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess100" + " data:" + JSON.stringify(data1)); - ACCOUNT_ID100 = data1[0]; - osAccountManager.activateOsAccount(101, (err)=>{ - console.debug("====>activateOsAccount localId: 101 err:" + JSON.stringify(err)); - setTimeout(()=>{ - osAccountManager.queryActivatedOsAccountIds((err,data2)=>{ - console.debug("====>getOsAccountLocalIdFromProcess101" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess101" + " data:" + JSON.stringify(data2)); - ACCOUNT_ID101 = data2[0]; - osAccountManager.activateOsAccount(102, (err)=>{ - console.debug("====>activateOsAccount localId: 102 err:" + JSON.stringify(err)); - osAccountManager.queryActivatedOsAccountIds((err,data3)=>{ - console.debug("====>getOsAccountLocalIdFromProcess102" + " err:" + JSON.stringify(err)); - console.debug("====>getOsAccountLocalIdFromProcess102" + " data:" + JSON.stringify(data3)); - ACCOUNT_ID102 = data3[0]; - osAccountManager.activateOsAccount(101, (err)=>{ - console.debug("====>activateOsAccount localId: 100 err:" + JSON.stringify(err)); - done(); - }) - }) - }) - }) - },3000) - }) - }) - },3000) - }) - }) - - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_0200 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, - * call the Promise's AbilityContext::startAbilityWithAccount - * interface (with the StartOptions parameter) to start Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_0200', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_0200====>start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_0200====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityWithAccount_0200 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - },ACCOUNT_ID100, - { - windowMode: 2, - displayId: 1 - }).then((data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_0200====>success!"+ JSON.stringify(data)) - }) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_0400 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user is equal to the current user and the user's task list exists, - * call the AbilityContext::startAbilityWithAccount interface of - * AsyncCallback (with the StartOptions parameter) to start Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_0400', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_0400 ====> start") - - var Subscriber; - var flag = false; - - function SubscribeCallBack(err, data) { - flag = true; - expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); - console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_0400====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - if(flag == false){ - expect().assertFail(); - console.debug('ACTS_StartStandardAbilityWithAccount_0400 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - done(); - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractiononetest', - abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' - },ACCOUNT_ID101, - { - windowMode: 2, - displayId: 1 - }, ((err, data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_0400====>success!!!" + JSON.stringify(data)) - })) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_0800 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, - * call the Promise's AbilityContext::startAbilityWithAccount - * interface (without the StartOptions parameter) to start the Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_0800', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_0800 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>0800 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_0800====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityWithAccount_0800 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - },ACCOUNT_ID100).then((data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_0800====>success!"+ JSON.stringify(data)) - }) - }) - - - /** - * @tc.number: ACTS_StartStandardAbilityWithAccount_1000 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user is equal to the current user and the user's task list exists, call the - * AbilityContext::startAbilityWithAccount interface of - * AsyncCallback (without the StartOptions parameter) to start the Ability. - */ - it('ACTS_StartStandardAbilityWithAccount_1000', 0, async function (done) { - console.log("ACTS_StartStandardAbilityWithAccount_1000 ====> start") - - var Subscriber; - var flag = false; - - function SubscribeCallBack(err, data) { - flag = true; - expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); - console.debug("====>1000 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityWithAccount_1000====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - if(flag == false){ - expect().assertFail(); - console.debug('ACTS_StartStandardAbilityWithAccount_1000 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbility====>"); - await abilityContext.startAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractiononetest', - abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' - },ACCOUNT_ID101, ((err, data) => { - console.log("====>end ACTS_StartStandardAbilityWithAccount_1000====>success!!!" + JSON.stringify(data)) - })) - }) - - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0200 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, call the - * Promise's AbilityContext::startAbilityForResultWithAccount (with the StartOptions parameter) - * interface to start Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_0200', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0200 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>0200 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityForResultWithAccount_0200====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityForResultWithAccount_0200 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - }, ACCOUNT_ID100, - { - windowMode: 2, - displayId: 1 - }).then((data) => { - console.log("====>end ACTS_StartStandardAbilityForResultWithAccount_0200====>success!"+ JSON.stringify(data)) - }) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0400 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: When the specified user is equal to the current user and the user's task list exists, call the - * AsyncCallback's AbilityContext::startAbilityForResultWithAccount (with the StartOptions parameter) - * interface to start the Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_0400', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0400 ====> start") - - var Subscriber; - var flag = false; - - function SubscribeCallBack(err, data) { - flag = true; - expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); - console.debug("====>0400 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityForResultWithAccount_0400====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - if(flag == false){ - expect().assertFail(); - console.debug('ACTS_StartStandardAbilityForResultWithAccount_0400 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - - } - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractiononetest', - abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' - }, ACCOUNT_ID101, - { - windowMode: 2, - displayId: 1 - }, ((err, data) => { - console.log("StartStandardAbilityForResultWithAccount_0400 === success!" + JSON.stringify(data)) - })) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_0800 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, - * call the Promise's - * AbilityContext::startAbilityForResultWithAccount (without the StartOptions parameter) interface - * to start Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_0800', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_0800 ====> start") - - var Subscriber; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>0800 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityForResultWithAccount_0800====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_StartStandardAbilityForResultWithAccount_0800 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.MainAbility2' - }, ACCOUNT_ID100).then((data) => { - console.log("====>end ACTS_StartStandardAbilityForResultWithAccount_0800====>success!"+ JSON.stringify(data)) - }) - }) - - /** - * @tc.number: ACTS_StartStandardAbilityForResultWithAccount_1000 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, - * call the AsyncCallback's - * AbilityContext::startAbilityForResultWithAccount (without the StartOptions parameter) - * interface to start the Ability. - */ - it('ACTS_StartStandardAbilityForResultWithAccount_1000', 0, async function (done) { - console.log("ACTS_StartStandardAbilityForResultWithAccount_1000 ====> start") - var flag = false; - var Subscriber; - - function SubscribeCallBack(err, data) { - flag = true; - expect(data.event).assertEqual("ABILITYCONTEX_Start_CommonEvent"); - console.debug("====>1000 Subscribe CallBack data:====>" + JSON.stringify(data)); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - - commonEvent.createSubscriber(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_StartStandardAbilityForResultWithAccount_1000====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - if(flag == false){ - expect().assertFail(); - console.debug('ACTS_StartStandardAbilityForResultWithAccount_1000 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - - } - } - - - setTimeout(timeout, START_ABILITY_TIMEOUT); - console.debug("====>start startAbilityForResult====>"); - await abilityContext.startAbilityForResultWithAccount( - { - bundleName: 'com.example.actsspecifieduseractiononetest', - abilityName: 'com.example.actsspecifieduseractiononetest.MainAbility2' - }, ACCOUNT_ID101, ((err, data) => { - console.log("ACTS_StartStandardAbilityForResultWithAccount_1000 === success!" + JSON.stringify(data)) - })) - }) - - - /** - * @tc.number: ACTS_ConnectStandardAbilityWithAccount_0200 - * @tc.name: Provides a system interface to specify user startup components (standard page). - * @tc.desc: If the specified user is not equal to the current user and the user's task list exists, - * call the AbilityContext::connectAbilityWithAccount interface to connect the Ability. - */ - it('ACTS_ConnectStandardAbilityWithAccount_0200', 0, async function (done) { - console.log("ACTS_ConnectStandardAbilityWithAccount_0200 ====> start") - var Subscriber; - var flag = true; - var number = 0; - - function SubscribeCallBack(err, data) { - expect().assertFail(); - console.debug("====>WithAccount 0300 Subscribe CallBack data:====>" + JSON.stringify(data)); - abilityContext.disconnectAbility(number).then((err)=>{ - console.debug("====>err is====>" + JSON.stringify(err)); - }) - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback); - } - function onConnectCallback(element, remote) { - console.log('ACTS_ConnectStandardAbilityWithAccount_0200 onConnectCallback====> element=' + JSON.stringify(element)); - console.log('ACTS_ConnectStandardAbilityWithAccount_0200 onConnectCallback====> remote=' + JSON.stringify(remote)); - setTimeout(()=> { - console.log('====>in timeout'); - console.debug("====>flag is====>" + JSON.stringify(flag)); - if(flag == true) { - console.debug('ACTS_ConnectStandardAbilityWithAccount_0300 - 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(ACTS_ABILITYCONTEX).then(async (data) => { - console.debug("ACTS_ConnectStandardAbilityWithAccount_0200====>Create Subscriber====>"); - Subscriber = data; - commonEvent.subscribe(Subscriber, SubscribeCallBack); - console.debug("====>start connectAbilityWithAccount====>"); - number = await abilityContext.connectAbilityWithAccount( - { - bundleName: 'com.example.actsspecifieduseractionzerotest', - abilityName: 'com.example.actsspecifieduseractionzerotest.ServiceAbility2', - action: "StartAbilityPromise" - },ACCOUNT_ID102 ,{ - onConnect:onConnectCallback, - onDisconnect:onDisconnectCallback, - onFailed: onFailedCallback - }) - }) - - function UnSubscribeCallback() { - console.debug("====>UnSubscribeCallback====>"); - done(); - } - - function timeout() { - console.debug('ACTS_ConnectStandardAbilityWithAccount_0200 ====> timeout'); - commonEvent.unsubscribe(Subscriber, UnSubscribeCallback) - } - setTimeout(timeout, START_ABILITY_TIMEOUT); - }) - }) -} \ No newline at end of file diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/module.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/module.json deleted file mode 100644 index d1014c0d76671e6ac62a405d793da2ae7d26cfcb..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/module.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.actsspecifieduseractiononetest.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.example.actsspecifieduseractiononetest.MainAbility2", - "srcEntrance": "./ets/MainAbility2/MainAbility2.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/ServiceAbility2/ServiceAbility2.ts", - "name": "com.example.actsspecifieduseractiononetest.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/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/element/string.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/element/string.json deleted file mode 100644 index d75325f3cf0a50c1dfe4dbc5162c8737276c3dd9..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/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/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/media/icon.png b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/media/icon.png deleted file mode 100644 index ce307a8827bd75456441ceb57d530e4c8d45d36c..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/media/icon.png and /dev/null differ diff --git a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/profile/main_pages.json b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/entry/src/main/resources/base/profile/main_pages.json deleted file mode 100644 index 6898b31d2085f478ee1ed9d933a5910cbf901d92..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/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/actsstartcomponenttest/SpecifiedUserAction_101/signature/openharmony_sx.p7b b/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/signature/openharmony_sx.p7b deleted file mode 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/actsstartcomponenttest/SpecifiedUserAction_101/signature/openharmony_sx.p7b and /dev/null differ diff --git a/ability/ability_runtime/actsusers/BUILD.gn b/ability/ability_runtime/actsusers/BUILD.gn index 09d4ac72b697d9f8ee93da7d1f1d7ce0a5bb5b6a..51a0a8c8babe307638de8a8359921986ccf5a917 100644 --- a/ability/ability_runtime/actsusers/BUILD.gn +++ b/ability/ability_runtime/actsusers/BUILD.gn @@ -22,8 +22,6 @@ group("actsusers") { "ActsAmsUsersKillProcessAppB:ActsAmsUsersKillProcessAppB", "ActsAmsUsersKillProcessAppC:ActsAmsUsersKillProcessAppC", "ActsAmsUsersSystemTest:ActsAmsUsersSystemTest", - "actsextensionconnectabilitytest:ActsExtensionConnectAbilityTest", - "actsserviceabilityrelytest:actsServiceAbilityRelyHap", ] } } diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js index 4ad19de910c75b5cb17618db4a6a7e6a51ec0266..6a799876d5fe8670b3458fc274c3a85cbf224538 100644 --- a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js +++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/FeatureAbilityJsunit.test.js @@ -1254,7 +1254,7 @@ describe('ActsFeatureAbilityTest', function () { expect(typeof (info.entryDir)).assertEqual("string"); expect(info.name).assertEqual("com.example.actsfeatureabilitytest"); - expect(info.description).assertEqual("$string:mainability_description"); + expect(info.description).assertEqual("descriptionTest"); // expect(info.descriptionId).assertEqual(0); //create by DevEco when building HAP. expect(info.systemApp).assertEqual(true); expect(info.enabled).assertEqual(true); diff --git a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js index 8d2da70e98ff0446be75854721bfdb3322174fe9..af4bb8374836a54dbb6a38f53780a56cb2759277 100644 --- a/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js +++ b/ability/ability_runtime/featureability/actsfeatureabilitytest/entry/src/main/js/test/StartAbilityJsunit.test.js @@ -315,37 +315,6 @@ describe('ConnectAbilityTest', function () { done() }) - /* - * @tc.number: SUB_AA_JsApi_Ability_1600 - * @tc.name: testAblity1600. - * @tc.desc: startAbilityForResult: The input parameter want is not configured (the value is {}).(by callback) - */ - it("SUB_AA_JsApi_Ability_1600", 0, async function (done) { - let parameter = {} - featureAbility.startAbilityForResult(parameter, (error, data) => { - console.log('testAblity1600 data: ' + JSON.stringify(data)) - console.log('testAblity1600 error: ' + JSON.stringify(error)) - expect().assertEqual(error.code) - done(); - }) - }) - - /* - * @tc.number: SUB_AA_JsApi_Ability_1700 - * @tc.name: testAblity1700. - * @tc.desc: startAbilityForResult: The input parameter optParam is undefined.(by promise) - */ - it("SUB_AA_JsApi_Ability_1700", 0, async function (done) { - await featureAbility.startAbilityForResult(undefined).then((data) => { - console.log('testAblity1700 data: ' + JSON.stringify(data)) - expect.assertFail() - }).catch((error) => { - console.log('testAblity1700' + JSON.stringify(error)); - expect(errCode1).assertEqual(error.code) - }) - done() - }) - /* * @tc.number: SUB_AA_JsApi_Ability_1800 * @tc.name: testAblity1800. @@ -359,34 +328,6 @@ describe('ConnectAbilityTest', function () { }) }) - /* - * @tc.number: SUB_AA_JsApi_Ability_1900 - * @tc.name: testAblity1900. - * @tc.desc: startAbilityForResult-wrong input parameter format want a layer outside.(by promise) - */ - it("SUB_AA_JsApi_Ability_1900", 0, async function (done) { - let parameter = { - 'StartAbilityParameter': { - 'want': { - 'bundleName': bundleName, - 'abilityName': mainAbilityName, - 'parameters': { - 'key': resultCode, - 'terminate': true - } - } - } - } - await featureAbility.startAbilityForResult(parameter).then((data) => { - console.log('testAblity1900 data: ' + JSON.stringify(data)) - expect.assertFail() - }).catch((error) => { - console.log('testAblity1900 err:' + JSON.stringify(error)); - expect(errCode1).assertEqual(error.code) - }) - done() - }) - /* * @tc.number: SUB_AA_JsApi_Ability_2000 * @tc.name: testAblity2000. @@ -438,28 +379,4 @@ describe('ConnectAbilityTest', function () { }) done() }) - - /* - * @tc.number: SUB_AA_JsApi_Ability_2200 - * @tc.name: testAblity2200. - * @tc.desc: startAbilityForResult-want-Set bundleName and abilityName+flag-flag to character strings.(by callback) - */ - it("SUB_AA_JsApi_Ability_2200", 0, async function (done) { - let parameter = { - 'want': { - 'bundleName': bundleName, - 'abilityName': mainAbilityName, - 'flages': 'abc', - 'parameters': { - 'key': resultCode, - 'terminate': true - } - } - } - featureAbility.startAbilityForResult(parameter, (error, data) => { - console.log('testAblity2200' + JSON.stringify(error)); - expect(undefined).assertEqual(error.code) - done() - }) - }) }) diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/FmsAcquireForm2.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/FmsAcquireForm2.test.ets index fb5be5b983e2e6c5daec25b7371270f8c320e6e7..59d7e28a15d9f0ae4ae11be36baba1b31d3df993 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/FmsAcquireForm2.test.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formacquiretest2/entry/src/main/ets/MainAbility/test/FmsAcquireForm2.test.ets @@ -206,46 +206,6 @@ export default function test() { console.info(`FMS_acquireForm_4000 featureAbility.startAbility end`); }); - /** - * @tc.number: FMS_acquireForm_4100 - * @tc.name: Failed to add form when parameter moduleName is wrong. - * @tc.desc: Failed to create form when verifying that the parameter (moduleName) of creating form is wrong. - */ - it(`FMS_acquireForm_4100`, 0, async (done) => { - console.info(`FMS_acquireForm_4100 start`); - function onErrorCallBack(_, data) { - console.info("!!!====>FMS_acquireForm_4100 onErrorCallBack data:====>" + JSON.stringify(data)); - expect(data.event).assertEqual("FMS_FormOnError_commonEvent"); - expect(data.data).assertEqual("invalid params received on operating form."); - commonEvent.unsubscribe(subscriberOnError, () => unsubscribeOnErrorCallback("FMS_acquireForm_4100")); - console.info(`FMS_acquireForm_4100 end`); - done(); - } - commonEvent.subscribe(subscriberOnError, onErrorCallBack); - console.info(`FMS_acquireForm_4100 featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostj", - abilityName: "com.ohos.st.formsystemhostj.MainAbility", - parameters: { - "formId": "0", - "name": "Form_Js001", - "bundle": "com.form.formsystemtestservicea.hmservice", - "ability": "com.form.formsystemtestservicea.hmservice.FormAbility", - "moduleName": "", - "temporary": false, - "isCreate": true - } - } - }).then((res: any) => { - console.info(`FMS_acquireForm_4100 featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`FMS_acquireForm_4100 featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`FMS_acquireForm_4100 featureAbility.startAbility end`); - }); - - /** * @tc.number: FMS_acquireForm_4200 * @tc.name: Success to add form when parameter formName is blank. diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/FmsDeleteForm.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/FmsDeleteForm.test.ets index 91077a27afcc0f5a485fe645b9d177006db056a9..18845d9315a96a872bce4b97e8a6427a6f0494ac 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/FmsDeleteForm.test.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdeletetest/entry/src/main/ets/MainAbility/test/FmsDeleteForm.test.ets @@ -684,145 +684,6 @@ export default function test() { console.info(`${tcNumber} featureAbility.startAbility end`); }); - /** - * @tc.number: FMS_deleteForm_0700_2 - * @tc.name: After deleting a normal form, the form reference is 0. - * After deleting a form, there are still created normal forms in FMS. - * @tc.desc: 1.host A an host B create one normal card respectively - * 2.host A delete the form and verify the result is true - */ - it(`FMS_deleteForm_0700_2`, 0, async (done) => { - const tcNumber = `FMS_deleteForm_0700_2`; - let formId; - let formIdB; - let supplyFlag = false; - let supplyFlagUpdate = false; - - // timer speed up - commonEvent.publish(`fms.time_speed`, { code: 900 }, () => { - console.info(`${tcNumber} time speed up`); - }); - await changeTime(10, 29, 55); - async function delPublishCallback() { - console.info(`${tcNumber} delPublishCallback`); - await sleep(5000); - commonEvent.unsubscribe(subscriberSupply, () => unsubscribeSupplyCallback(tcNumber)); - if (supplyFlag && supplyFlagUpdate) { - deleteFormB(); - } else { - deleteFormB(); - expect().assertFail(); - } - console.info(`${tcNumber} delPublishCallback end`); - } - - async function delPublishCallbackB() { - console.info(`${tcNumber} delPublishCallbackB`); - await sleep(1000); - console.info(`${tcNumber} delPublishCallbackB end`); - console.info(`${tcNumber} end`); - done(); - } - - async function deleteFormB() { - console.info(`${tcNumber} deleteFormB start`); - // timer speed reset - commonEvent.publish(`fms.time_speed`, { code: 1 }, () => { - console.info(`${tcNumber} time speed up`); - }); - await sleep(1000); - const commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhostd", - data: formIdB - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallbackB); - console.info(`${tcNumber} deleteFormB end`); - } - - const onAcquiredCallbackB = async (_, data) => { - console.info(`${tcNumber} onAcquiredCallbackB data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); - formIdB = data.data; - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); - const commonEventPublishData = { - bundleName: "com.ohos.st.formsystemhostc", - data: formId - }; - commonEvent.publish(deleteForm_Event, commonEventPublishData, delPublishCallback); - }; - - const onAcquiredCallback = async (_, data) => { - console.info(`${tcNumber} onAcquiredCallback data: ${JSON.stringify(data)}`); - expect(data.event).assertEqual(`FMS_FormOnAcquired_commonEvent`); - commonEvent.unsubscribe(subscriberOnAcquired, () => unsubscribeOnAcquiredCallback(tcNumber)); - formId = data.data; - subscriberOnAcquired = await commonEvent.createSubscriber(onAcquiredForm_Event); - await sleep(1000); - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallbackB); - - console.info(`${tcNumber} featureAbility.startAbility again start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostd", - abilityName: "com.ohos.st.formsystemhostd.MainAbility", - parameters: { - formId: "0", - name: "Form_Js002", - bundle: "com.form.formsystemtestserviceb.hmservice", - ability: "com.form.formsystemtestserviceb.hmservice.FormAbility", - moduleName: "entry", - temporary: false, - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility again end`); - }; - commonEvent.subscribe(subscriberOnAcquired, onAcquiredCallback); - - const onSupplyCallback = async (_, data) => { - if (data.parameters.kind == "onDestroy") { - console.info(`${tcNumber} onSupplyCallback ${JSON.stringify(data)}`); - expect(data.parameters.parameters).assertEqual(formId); - supplyFlag = true; - } - if (data.parameters.kind == "onUpdate") { - if (data.parameters.parameters == formId) { - expect().assertFail(); - } else if (data.parameters.parameters == formIdB) { - supplyFlagUpdate = true; - } - } - }; - commonEvent.subscribe(subscriberSupply, onSupplyCallback); - - console.info(`${tcNumber} featureAbility.startAbility start`); - await featureAbility.startAbility({ - want: { - bundleName: "com.ohos.st.formsystemhostc", - abilityName: "com.ohos.st.formsystemhostc.MainAbility", - parameters: { - formId: "0", - name: "Form_Js001", - bundle: "com.form.formsystemtestservicea.hmservice", - ability: "com.form.formsystemtestservicea.hmservice.FormAbility", - moduleName: "entry", - temporary: false, - isCreate: true - } - } - }).then((res: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); - }).catch((err: any) => { - console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); - }); - console.info(`${tcNumber} featureAbility.startAbility end`); - }); - /** * @tc.number: FMS_deleteForm_0900 * @tc.name: Form ID error (FormID does not exist) diff --git a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/test/FmsDynamicRefreshForm.test.ets b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/test/FmsDynamicRefreshForm.test.ets index 22aaf1dd8c8acff6c9f316965bc80f5b0b2378a1..efaa811b298e51718e335f170be315f9dcba72db 100644 --- a/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/test/FmsDynamicRefreshForm.test.ets +++ b/ability/ability_runtime/formmanager/fa/formsystemtest_ets/formdynamicrefreshtest/entry/src/main/ets/MainAbility/test/FmsDynamicRefreshForm.test.ets @@ -70,6 +70,7 @@ export default function test() { }; commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { console.info('FMS_timedRefresh_0100 publish' + JSON.stringify(err)); + done() }); }; commonEvent.subscribe(subscriberOnRefresh, onRefreshCallback); @@ -119,6 +120,7 @@ export default function test() { }; commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { console.info('FMS_timedRefresh_0200 publish' + JSON.stringify(err)); + done() }); }; commonEvent.subscribe(subscriberOnRefresh, onRefreshCallback); @@ -169,6 +171,7 @@ export default function test() { }; commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { console.info('FMS_timedRefresh_0300 publish' + JSON.stringify(err)); + done() }); }; commonEvent.subscribe(subscriberOnRefresh, onRefreshCallback); @@ -201,6 +204,7 @@ export default function test() { console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); }).catch((err: any) => { console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + done() }); console.info(`${tcNumber} featureAbility.startAbility again end`); }; @@ -225,6 +229,7 @@ export default function test() { console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); }).catch((err: any) => { console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + done() }); console.info(`${tcNumber} featureAbility.startAbility end`); }); @@ -250,6 +255,7 @@ export default function test() { }; commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { console.info('FMS_timedRefresh_0400 publish' + JSON.stringify(err)); + done() }); }; commonEvent.subscribe(subscriberOnRefresh, onRefreshCallback); @@ -283,6 +289,7 @@ export default function test() { console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); }).catch((err: any) => { console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + done() }); console.info(`${tcNumber} featureAbility.startAbility again end`); }; @@ -309,6 +316,7 @@ export default function test() { console.info(`${tcNumber} featureAbility.startAbilityhost res: ${JSON.stringify(res)}`); }).catch((err: any) => { console.info(`${tcNumber} featureAbility.startAbilityhost error: ${JSON.stringify(err)}`); + done() }); console.info(`${tcNumber} featureAbility.startAbility end`); }); @@ -332,6 +340,7 @@ export default function test() { }; commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { console.info('FMS_timedRefresh_0500 publish' + JSON.stringify(err)); + done() }); }; commonEvent.subscribe(subscriberOnRefresh, onRefreshCallback); @@ -384,8 +393,10 @@ export default function test() { }; commonEvent.publish(deleteForm_Event, commonEventPublishData, (err) => { console.info('FMS_timedRefresh_0600 publish' + JSON.stringify(err)); + done() }); } + done() }; commonEvent.subscribe(subscriberSupply, onSupplyCallback); diff --git a/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts b/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts index 7f41953140cc2aa962ba2786d5eaa58b5a993eb7..0389de11ea41bb4a341a79de6ee303906eb70669 100644 --- a/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/ability/ability_runtime/newwant/actsnewwantarelyhap/entry/src/main/ets/MainAbility/MainAbility.ts @@ -88,5 +88,17 @@ export default class MainAbility extends Ability { commonEvent.publish("onNewWantMain_To_Test_CommonEvent", publishData, () => { console.log("ACTS_NewWant Publish CallBack onNewWantMain_To_Test_CommonEvent") }); + switch (want.action) { + case 'restartHapB': + commonEvent.publish("onNewWantMain1_To_Test_CommonEvent", publishData, () => { + console.log("ACTS_NewWant Publish CallBack onNewWantMain1_To_Test_CommonEvent") + }); + break; + case 'restartHapC': + commonEvent.publish("onNewWantMain2_To_Test_CommonEvent", publishData, () => { + console.log("ACTS_NewWant Publish CallBack onNewWantMain2_To_Test_CommonEvent") + }); + break; + } } }; diff --git a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts index 8a848aab9e28cd0abc12235a36d5d6ae7a39dae9..9f0688daa9e0d7534fac867c7279eae255ba0a59 100644 --- a/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts +++ b/ability/ability_runtime/newwant/actsnewwantrelyhap/entry/src/main/ets/SecondAbility/SecondAbility.ts @@ -142,5 +142,22 @@ export default class SecondAbility extends Ability { commonEvent.publish("onNewWantSecond_To_Test_CommonEvent", publishData,() => { console.log("ACTS_NewWant SecondAbility Publish CallBack onNewWantSecond_To_Test_CommonEvent") }); + switch (want.action) { + case 'restartSingleton': + commonEvent.publish("onNewWantSecond1_To_Test_CommonEvent", publishData,() => { + console.log("ACTS_NewWant SecondAbility Publish CallBack onNewWantSecond1_To_Test_CommonEvent") + }); + break; + case 'restartSecondAbility0700': + commonEvent.publish("onNewWantSecond2_To_Test_CommonEvent", publishData,() => { + console.log("ACTS_NewWant SecondAbility Publish CallBack onNewWantSecond2_To_Test_CommonEvent") + }); + break; + case 'restartSecondAbility0800': + commonEvent.publish("onNewWantSecond3_To_Test_CommonEvent", publishData,() => { + console.log("ACTS_NewWant SecondAbility Publish CallBack onNewWantSecond3_To_Test_CommonEvent") + }); + break; + } } }; diff --git a/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets index 9b12b9c4f4f575ad71b887c2e95e2258e4d869b9..0887c61ed3507706a86f0bd5e0b6bd2cf0c8a31a 100644 --- a/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets +++ b/ability/ability_runtime/newwant/actsnewwanttest/entry/src/main/ets/test/Ability.test.ets @@ -15,31 +15,21 @@ import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from "deccjsunit/index" import commonEvent from '@ohos.commonEvent' -import missionManager from '@ohos.application.missionManager' -import appManager from '@ohos.application.appManager' - - -import formProvider from '@ohos.application.formProvider'; -import FormInfo from '@ohos.application.formInfo'; -import formError from '@ohos.application.formError'; -var EXTENSION_INFO_ERR = 2097152 -var USERID_ERR = 2097177 -var trueInfo; -var array = new Array(); -function sleep(time) { - return new Promise((resolve)=>setTimeout(resolve,time)); -} - -const MAX_MISSION_NUM = 1024; + var subscriberInfo = { events: ['onCreateMain_To_Test_CommonEvent', 'onWindowStageCreateMain_To_Test_CommonEvent', 'onForegroundMain_To_Test_CommonEvent', 'onNewWantMain_To_Test_CommonEvent', + 'onNewWantMain1_To_Test_CommonEvent', + 'onNewWantMain2_To_Test_CommonEvent', 'onCreateSecond_To_Test_CommonEvent', 'onWindowStageCreateSecond_To_Test_CommonEvent', 'onForegroundSecond_To_Test_CommonEvent', 'onNewWantSecond_To_Test_CommonEvent', + 'onNewWantSecond1_To_Test_CommonEvent', + 'onNewWantSecond2_To_Test_CommonEvent', + 'onNewWantSecond3_To_Test_CommonEvent', ], }; @@ -307,7 +297,7 @@ export default function abilityTest(abilityContext) { case 'onForegroundSecond_To_Test_CommonEvent': flagOnForeground++; break; - case 'onNewWantSecond_To_Test_CommonEvent': + case 'onNewWantSecond1_To_Test_CommonEvent': flagOnNewWant++; expect(data.data).assertEqual('restartSingleton'); break; @@ -382,7 +372,7 @@ export default function abilityTest(abilityContext) { case 'onForegroundMain_To_Test_CommonEvent': flagOnForeground++; break; - case 'onNewWantMain_To_Test_CommonEvent': + case 'onNewWantMain1_To_Test_CommonEvent': flagOnNewWant++; expect(data.data).assertEqual('restartHapB'); break; @@ -457,7 +447,7 @@ export default function abilityTest(abilityContext) { case 'onForegroundMain_To_Test_CommonEvent': flagOnForeground++; break; - case 'onNewWantMain_To_Test_CommonEvent': + case 'onNewWantMain2_To_Test_CommonEvent': flagOnNewWant++; expect(data.data).assertEqual('restartHapC'); break; @@ -532,7 +522,7 @@ export default function abilityTest(abilityContext) { case 'onForegroundSecond_To_Test_CommonEvent': flagOnForeground++; break; - case 'onNewWantSecond_To_Test_CommonEvent': + case 'onNewWantSecond2_To_Test_CommonEvent': flagOnNewWant++; expect(data.data).assertEqual('restartSecondAbility0700'); break; @@ -607,7 +597,7 @@ export default function abilityTest(abilityContext) { case 'onForegroundSecond_To_Test_CommonEvent': flagOnForeground++; break; - case 'onNewWantSecond_To_Test_CommonEvent': + case 'onNewWantSecond3_To_Test_CommonEvent': flagOnNewWant++; expect(data.data).assertEqual('restartSecondAbility0800'); break; 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 b3266873926c57d3396281901620c5663dc7db3a..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/BUILD.gn +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (c) 2022 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//test/xts/tools/build/suite.gni") - -ohos_js_hap_suite("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" -} - -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 5e2915fe4fc033cd5c9bd579dc08fe7369e51016..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.application.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 809b6249166af9f894e0713c2c85221af8c0972c..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.application.Ability' - -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 7c31cb69818fe99a9442ea3aab183216260f6d74..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.connectAbility(wantMulti, paMultiConnect); - console.info('ZidlTest Client connectAbility end connectionId = ' + connectionId); - connectionOnewayId = globalThis.abilityContext.connectAbility(wantMultiOneway, paMultiOnewayConnect); - console.info('ZidlTest Client connectAbility end connectionOnewayId = ' + connectionOnewayId); - - connectionIdSingle = globalThis.abilityContext.connectAbility(wantSingle, paSingleConnect); - console.info('ZidlTest Client connectAbility end connectionIdSingle = ' + connectionIdSingle); - connectionOnewayIdSingle = globalThis.abilityContext.connectAbility(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.disconnectAbility(connectionId, (err) => { - console.info('ZidlTest Client disconnectAbility result ' + JSON.stringify(err)); - connectionId = -1; - testProxyMulti = null; - count++; - checkDone(); - }) - - globalThis.abilityContext.disconnectAbility(connectionOnewayId, (err) => { - console.info('ZidlTest Client disconnectAbility2 result ' + JSON.stringify(err)); - connectionOnewayId = -1; - testProxyMultiOneway = null; - count++; - checkDone(); - }) - - globalThis.abilityContext.disconnectAbility(connectionIdSingle, (err) => { - console.info('ZidlTest Client disconnectAbility result ' + JSON.stringify(err)); - connectionIdSingle = -1; - testProxyMulti = null; - count++; - checkDone(); - }) - - globalThis.abilityContext.disconnectAbility(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 831fb3d8118747dad4cfed307da30e4f1de0575a..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlclienttest/entry/src/main/module.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.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" - } - ] - } -} 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 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..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 c669685f1410928a447df0948ace3aa24bfcd9c8..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("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" - subsystem_name = XTS_SUITENAME - final_hap_path = - "${SUITES_OUTPUT_ROOT}/${XTS_SUITENAME}/testcases/${hap_name}.hap" - testonly = true -} - -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 98eb012db14b28a1f92522e305b9d4538e496dd3..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.application.AbilityStage" - -export default class MyAbilityStage extends AbilityStage { - onCreate() { - console.log("MyAbilityStage onCreate") - globalThis.stageOnCreateRun = 1; - globalThis.stageContext = this.context; - } -} \ No newline at end of file diff --git a/ability/ability_runtime/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 3b14eab6176b2efafc47359b4875d61774d66c9c..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.application.Ability' - -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 a30b037489b5d261b7405e566bc6352014518367..0000000000000000000000000000000000000000 --- a/ability/ability_runtime/zidltest/actsamszidlservice/entry/src/main/module.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "module": { - "name": "phone", - "type": "entry", - "srcEntrance": "./ets/Application/AbilityStage.ts", - "description": "$string:phone_entry_dsc", - "mainElement": "MainAbility", - "deviceTypes": [ - "phone" - ], - "deliveryWithInstall": true, - "installationFree": false, - "uiSyntax": "ets", - "pages": "$profile:main_pages", - "abilities": [ - { - "name": "com.example.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 100644 index cc53179a48f88f20acc379c138a001e9a15838f6..0000000000000000000000000000000000000000 Binary files a/ability/ability_runtime/zidltest/actsamszidlservice/signature/openharmony_sx.p7b and /dev/null differ